Class ReaderContext
java.lang.Object
org.springframework.beans.factory.parsing.ReaderContext
- Direct Known Subclasses:
XmlReaderContext
Context that gets passed along a bean definition reading process,
encapsulating all relevant configuration as well as state.
- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
-
Constructor Summary
ConstructorDescriptionReaderContext
(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor) Construct a newReaderContext
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Raise a regular error.void
Raise a regular error.void
error
(String message, Object source, ParseState parseState) Raise a regular error.void
error
(String message, Object source, ParseState parseState, Throwable cause) Raise a regular error.extractSource
(Object sourceCandidate) Call the source extractor for the given source object.void
Raise a fatal error.void
Raise a fatal error.void
fatal
(String message, Object source, ParseState parseState) Raise a fatal error.void
fatal
(String message, Object source, ParseState parseState, Throwable cause) Raise a fatal error.void
fireAliasRegistered
(String beanName, String alias, Object source) Fire an alias-registered event.void
fireComponentRegistered
(ComponentDefinition componentDefinition) Fire a component-registered event.void
fireDefaultsRegistered
(DefaultsDefinition defaultsDefinition) Fire a defaults-registered event.void
fireImportProcessed
(String importedResource, Object source) Fire an import-processed event.void
fireImportProcessed
(String importedResource, Resource[] actualResources, Object source) Fire an import-processed event.final Resource
Return the source extractor in use.void
Raise a non-critical warning.void
Raise a non-critical warning.void
warning
(String message, Object source, ParseState parseState) Raise a non-critical warning.void
warning
(String message, Object source, ParseState parseState, Throwable cause) Raise a non-critical warning.
-
Constructor Details
-
ReaderContext
public ReaderContext(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor) Construct a newReaderContext
.- Parameters:
resource
- the XML bean definition resourceproblemReporter
- the problem reporter in useeventListener
- the event listener in usesourceExtractor
- the source extractor in use
-
-
Method Details
-
getResource
-
fatal
Raise a fatal error. -
fatal
Raise a fatal error. -
fatal
Raise a fatal error. -
fatal
public void fatal(String message, @Nullable Object source, @Nullable ParseState parseState, @Nullable Throwable cause) Raise a fatal error. -
error
Raise a regular error. -
error
Raise a regular error. -
error
Raise a regular error. -
error
public void error(String message, @Nullable Object source, @Nullable ParseState parseState, @Nullable Throwable cause) Raise a regular error. -
warning
Raise a non-critical warning. -
warning
Raise a non-critical warning. -
warning
Raise a non-critical warning. -
warning
public void warning(String message, @Nullable Object source, @Nullable ParseState parseState, @Nullable Throwable cause) Raise a non-critical warning. -
fireDefaultsRegistered
Fire a defaults-registered event. -
fireComponentRegistered
Fire a component-registered event. -
fireAliasRegistered
Fire an alias-registered event. -
fireImportProcessed
Fire an import-processed event. -
fireImportProcessed
public void fireImportProcessed(String importedResource, Resource[] actualResources, @Nullable Object source) Fire an import-processed event. -
getSourceExtractor
Return the source extractor in use. -
extractSource
Call the source extractor for the given source object.- Parameters:
sourceCandidate
- the original source object- Returns:
- the source object to store, or
null
for none. - See Also:
-