类 ReaderContext
- java.lang.Object
- org.springframework.beans.factory.parsing.ReaderContext
- 直接已知子类:
XmlReaderContext
public class ReaderContext extends Object
Context that gets passed along a bean definition reading process, encapsulating all relevant configuration as well as state.- 从以下版本开始:
- 2.0
- 作者:
- Rob Harrop, Juergen Hoeller
构造器概要
构造器 构造器 说明 ReaderContext(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor)
Construct a newReaderContext
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
error(String message, Object source)
Raise a regular error.void
error(String message, Object source, Throwable ex)
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.Object
extractSource(Object sourceCandidate)
Call the source extractor for the given source object.void
fatal(String message, Object source)
Raise a fatal error.void
fatal(String message, Object source, Throwable ex)
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 an component-registered event.void
fireDefaultsRegistered(DefaultsDefinition defaultsDefinition)
Fire an 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.Resource
getResource()
SourceExtractor
getSourceExtractor()
Return the source extractor in use.void
warning(String message, Object source)
Raise a non-critical warning.void
warning(String message, Object source, Throwable ex)
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.
构造器详细资料
ReaderContext
public ReaderContext(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor)
Construct a newReaderContext
.- 参数:
resource
- the XML bean definition resourceproblemReporter
- the problem reporter in useeventListener
- the event listener in usesourceExtractor
- the source extractor in use
方法详细资料
getResource
public final Resource getResource()
fatal
public void fatal(String message, Object source, ParseState parseState)
Raise a fatal error.
fatal
public void fatal(String message, Object source, ParseState parseState, Throwable cause)
Raise a fatal error.
error
public void error(String message, Object source, ParseState parseState)
Raise a regular error.
error
public void error(String message, Object source, ParseState parseState, Throwable cause)
Raise a regular error.
warning
public void warning(String message, Object source, Throwable ex)
Raise a non-critical warning.
warning
public void warning(String message, Object source, ParseState parseState)
Raise a non-critical warning.
warning
public void warning(String message, Object source, ParseState parseState, Throwable cause)
Raise a non-critical warning.
fireDefaultsRegistered
public void fireDefaultsRegistered(DefaultsDefinition defaultsDefinition)
Fire an defaults-registered event.
fireComponentRegistered
public void fireComponentRegistered(ComponentDefinition componentDefinition)
Fire an component-registered event.
fireAliasRegistered
public void fireAliasRegistered(String beanName, String alias, Object source)
Fire an alias-registered event.
fireImportProcessed
public void fireImportProcessed(String importedResource, Object source)
Fire an import-processed event.
fireImportProcessed
public void fireImportProcessed(String importedResource, Resource[] actualResources, Object source)
Fire an import-processed event.
getSourceExtractor
public SourceExtractor getSourceExtractor()
Return the source extractor in use.
extractSource
public Object extractSource(Object sourceCandidate)
Call the source extractor for the given source object.- 参数:
sourceCandidate
- the original source object- 返回:
- the source object to store, or
null
for none. - 另请参阅:
getSourceExtractor()
,SourceExtractor.extractSource(java.lang.Object, org.springframework.core.io.Resource)