Java Doc for XmlBeanDefinitionReader.java in  » J2EE » spring-framework-2.0.6 » org » springframework » beans » factory » xml » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.beans.factory.xml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.beans.factory.support.AbstractBeanDefinitionReader
      org.springframework.beans.factory.xml.XmlBeanDefinitionReader

XmlBeanDefinitionReader
public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader (Code)
Bean definition reader for XML bean definitions. Delegates the actual XML document reading to an implementation of the BeanDefinitionDocumentReader interface.

Typically applied to a org.springframework.beans.factory.support.DefaultListableBeanFactory or a org.springframework.context.support.GenericApplicationContext .

This class loads a DOM document and applies the BeanDefinitionDocumentReader to it. The document reader will register each bean definition with the given bean factory, talking to the latter's implementation of the org.springframework.beans.factory.support.BeanDefinitionRegistry interface.
author:
   Juergen Hoeller
author:
   Rob Harrop
since:
   26.11.2003
See Also:   XmlBeanDefinitionReader.setDocumentReaderClass
See Also:   BeanDefinitionDocumentReader
See Also:   DefaultBeanDefinitionDocumentReader
See Also:   BeanDefinitionRegistry
See Also:   org.springframework.beans.factory.support.DefaultListableBeanFactory
See Also:   org.springframework.context.support.GenericApplicationContext



Field Summary
final public static  intVALIDATION_AUTO
     Indicates that the validation mode should be detected automatically.
final public static  intVALIDATION_DTD
     Indicates that DTD validation should be used.
final public static  intVALIDATION_NONE
     Indicates that the validation should be disabled.
final public static  intVALIDATION_XSD
     Indicates that XSD validation should be used.

Constructor Summary
public  XmlBeanDefinitionReader(BeanDefinitionRegistry beanFactory)
     Create new XmlBeanDefinitionReader for the given bean factory.

Method Summary
protected  BeanDefinitionDocumentReadercreateBeanDefinitionDocumentReader()
     Create the BeanDefinitionDocumentReader to use for actually reading bean definitions from an XML document.
protected  NamespaceHandlerResolvercreateDefaultNamespaceHandlerResolver()
     Create the default implementation of NamespaceHandlerResolver used if none is specified.
protected  XmlReaderContextcreateReaderContext(Resource resource)
     Create the XmlReaderContext to pass over to the document reader.
protected  intdetectValidationMode(Resource resource)
     Detects which kind of validation to perform on the XML file identified by the supplied Resource .
protected  intdoLoadBeanDefinitions(InputSource inputSource, Resource resource)
     Actually load bean definitions from the specified XML file.
public  intloadBeanDefinitions(Resource resource)
     Load bean definitions from the specified XML file.
public  intloadBeanDefinitions(EncodedResource encodedResource)
     Load bean definitions from the specified XML file.
public  intloadBeanDefinitions(InputSource inputSource)
     Load bean definitions from the specified XML file.
public  intloadBeanDefinitions(InputSource inputSource, String resourceDescription)
     Load bean definitions from the specified XML file.
public  intregisterBeanDefinitions(Document doc, Resource resource)
     Register the bean definitions contained in the given DOM document.
public  voidsetDocumentLoader(DocumentLoader documentLoader)
     Specify the DocumentLoader to use.
public  voidsetDocumentReaderClass(Class documentReaderClass)
     Specify the BeanDefinitionDocumentReader implementation to use, responsible for the actual reading of the XML bean definition document.
public  voidsetEntityResolver(EntityResolver entityResolver)
     Set a SAX entity resolver to be used for parsing.
public  voidsetErrorHandler(ErrorHandler errorHandler)
     Set an implementation of the org.xml.sax.ErrorHandler interface for custom handling of XML parsing errors and warnings.
public  voidsetEventListener(ReaderEventListener eventListener)
     Specify which ReaderEventListener to use.
public  voidsetNamespaceAware(boolean namespaceAware)
     Set whether or not the XML parser should be XML namespace aware.
public  voidsetNamespaceHandlerResolver(NamespaceHandlerResolver namespaceHandlerResolver)
     Specify the NamespaceHandlerResolver to use.
public  voidsetParserClass(Class parserClass)
     Set the XmlBeanDefinitionParser implementation to use, responsible for the actual parsing of XML bean definitions.
public  voidsetProblemReporter(ProblemReporter problemReporter)
     Specify which org.springframework.beans.factory.parsing.ProblemReporter to use.
public  voidsetSourceExtractor(SourceExtractor sourceExtractor)
     Specify the SourceExtractor to use.
public  voidsetValidating(boolean validating)
     Set if the XML parser should validate the document and thus enforce a DTD.
public  voidsetValidationMode(int validationMode)
     Set the validation mode to use.
public  voidsetValidationModeName(String validationModeName)
     Set the validation mode to use by name.

Field Detail
VALIDATION_AUTO
final public static int VALIDATION_AUTO(Code)
Indicates that the validation mode should be detected automatically.



VALIDATION_DTD
final public static int VALIDATION_DTD(Code)
Indicates that DTD validation should be used.



VALIDATION_NONE
final public static int VALIDATION_NONE(Code)
Indicates that the validation should be disabled.



VALIDATION_XSD
final public static int VALIDATION_XSD(Code)
Indicates that XSD validation should be used.




Constructor Detail
XmlBeanDefinitionReader
public XmlBeanDefinitionReader(BeanDefinitionRegistry beanFactory)(Code)
Create new XmlBeanDefinitionReader for the given bean factory.
Parameters:
  beanFactory - the BeanFactory to load bean definitions into,in the form of a BeanDefinitionRegistry




Method Detail
createBeanDefinitionDocumentReader
protected BeanDefinitionDocumentReader createBeanDefinitionDocumentReader()(Code)
Create the BeanDefinitionDocumentReader to use for actually reading bean definitions from an XML document.

Default implementation instantiates the specified "documentReaderClass".
See Also:   XmlBeanDefinitionReader.setDocumentReaderClass




createDefaultNamespaceHandlerResolver
protected NamespaceHandlerResolver createDefaultNamespaceHandlerResolver()(Code)
Create the default implementation of NamespaceHandlerResolver used if none is specified. Default implementation returns an instance of DefaultNamespaceHandlerResolver .



createReaderContext
protected XmlReaderContext createReaderContext(Resource resource)(Code)
Create the XmlReaderContext to pass over to the document reader.



detectValidationMode
protected int detectValidationMode(Resource resource)(Code)
Detects which kind of validation to perform on the XML file identified by the supplied Resource . If the file has a DOCTYPE definition then DTD validation is used otherwise XSD validation is assumed.



doLoadBeanDefinitions
protected int doLoadBeanDefinitions(InputSource inputSource, Resource resource) throws BeanDefinitionStoreException(Code)
Actually load bean definitions from the specified XML file.
Parameters:
  inputSource - the SAX InputSource to read from
Parameters:
  resource - the resource descriptor for the XML file the number of bean definitions found
throws:
  BeanDefinitionStoreException - in case of loading or parsing errors



loadBeanDefinitions
public int loadBeanDefinitions(Resource resource) throws BeanDefinitionStoreException(Code)
Load bean definitions from the specified XML file.
Parameters:
  resource - the resource descriptor for the XML file the number of bean definitions found
throws:
  BeanDefinitionStoreException - in case of loading or parsing errors



loadBeanDefinitions
public int loadBeanDefinitions(EncodedResource encodedResource) throws BeanDefinitionStoreException(Code)
Load bean definitions from the specified XML file.
Parameters:
  encodedResource - the resource descriptor for the XML file,allowing to specify an encoding to use for parsing the file the number of bean definitions found
throws:
  BeanDefinitionStoreException - in case of loading or parsing errors



loadBeanDefinitions
public int loadBeanDefinitions(InputSource inputSource) throws BeanDefinitionStoreException(Code)
Load bean definitions from the specified XML file.
Parameters:
  inputSource - the SAX InputSource to read from the number of bean definitions found
throws:
  BeanDefinitionStoreException - in case of loading or parsing errors



loadBeanDefinitions
public int loadBeanDefinitions(InputSource inputSource, String resourceDescription) throws BeanDefinitionStoreException(Code)
Load bean definitions from the specified XML file.
Parameters:
  inputSource - the SAX InputSource to read from
Parameters:
  resourceDescription - a description of the resource(can be null or empty) the number of bean definitions found
throws:
  BeanDefinitionStoreException - in case of loading or parsing errors



registerBeanDefinitions
public int registerBeanDefinitions(Document doc, Resource resource) throws BeanDefinitionStoreException(Code)
Register the bean definitions contained in the given DOM document. Called by loadBeanDefinitions.

Creates a new instance of the parser class and invokes registerBeanDefinitions on it.
Parameters:
  doc - the DOM document
Parameters:
  resource - the resource descriptor (for context information) the number of bean definitions found
throws:
  BeanDefinitionStoreException - in case of parsing errors
See Also:   XmlBeanDefinitionReader.loadBeanDefinitions
See Also:   XmlBeanDefinitionReader.setDocumentReaderClass
See Also:   BeanDefinitionDocumentReader.registerBeanDefinitions




setDocumentLoader
public void setDocumentLoader(DocumentLoader documentLoader)(Code)
Specify the DocumentLoader to use. The default implementation is DefaultDocumentLoader which loads Document instances using JAXP.



setDocumentReaderClass
public void setDocumentReaderClass(Class documentReaderClass)(Code)
Specify the BeanDefinitionDocumentReader implementation to use, responsible for the actual reading of the XML bean definition document.

Default is DefaultBeanDefinitionDocumentReader.
Parameters:
  documentReaderClass - the desired BeanDefinitionDocumentReader implementation class
See Also:   BeanDefinitionDocumentReader
See Also:   DefaultBeanDefinitionDocumentReader




setEntityResolver
public void setEntityResolver(EntityResolver entityResolver)(Code)
Set a SAX entity resolver to be used for parsing. By default, BeansDtdResolver will be used. Can be overridden for custom entity resolution, for example relative to some specific base path.
See Also:   BeansDtdResolver



setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)(Code)
Set an implementation of the org.xml.sax.ErrorHandler interface for custom handling of XML parsing errors and warnings.

If not set, a default SimpleSaxErrorHandler is used that simply logs warnings using the logger instance of the view class, and rethrows errors to discontinue the XML transformation.
See Also:   SimpleSaxErrorHandler




setEventListener
public void setEventListener(ReaderEventListener eventListener)(Code)
Specify which ReaderEventListener to use. Default implementation is EmptyReaderEventListener which discards every event notification. External tools can provide an alternative implementation to monitor the components being registered in the BeanFactory.



setNamespaceAware
public void setNamespaceAware(boolean namespaceAware)(Code)
Set whether or not the XML parser should be XML namespace aware. Default is "false".



setNamespaceHandlerResolver
public void setNamespaceHandlerResolver(NamespaceHandlerResolver namespaceHandlerResolver)(Code)
Specify the NamespaceHandlerResolver to use. If none is specified a default instance will be created by XmlBeanDefinitionReader.createDefaultNamespaceHandlerResolver() .



setParserClass
public void setParserClass(Class parserClass)(Code)
Set the XmlBeanDefinitionParser implementation to use, responsible for the actual parsing of XML bean definitions.
See Also:   XmlBeanDefinitionReader.setDocumentReaderClass
See Also:   XmlBeanDefinitionParser



setProblemReporter
public void setProblemReporter(ProblemReporter problemReporter)(Code)
Specify which org.springframework.beans.factory.parsing.ProblemReporter to use. Default implementation is org.springframework.beans.factory.parsing.FailFastProblemReporter which exhibits fail fast behaviour. External tools can provide an alternative implementation that collates errors and warnings for display in the tool UI.



setSourceExtractor
public void setSourceExtractor(SourceExtractor sourceExtractor)(Code)
Specify the SourceExtractor to use. The default implementation is NullSourceExtractor which simply returns null as the source object. This means that during normal runtime execution no additional source metadata is attached to the bean configuration metadata.



setValidating
public void setValidating(boolean validating)(Code)
Set if the XML parser should validate the document and thus enforce a DTD.
See Also:   XmlBeanDefinitionReader.setValidationMode



setValidationMode
public void setValidationMode(int validationMode)(Code)
Set the validation mode to use. Defaults to XmlBeanDefinitionReader.VALIDATION_AUTO .



setValidationModeName
public void setValidationModeName(String validationModeName)(Code)
Set the validation mode to use by name. Defaults to XmlBeanDefinitionReader.VALIDATION_AUTO .



Fields inherited from org.springframework.beans.factory.support.AbstractBeanDefinitionReader
final protected Log logger(Code)(Java Doc)

Methods inherited from org.springframework.beans.factory.support.AbstractBeanDefinitionReader
public ClassLoader getBeanClassLoader()(Code)(Java Doc)
public BeanDefinitionRegistry getBeanFactory()(Code)(Java Doc)
public BeanNameGenerator getBeanNameGenerator()(Code)(Java Doc)
public ResourceLoader getResourceLoader()(Code)(Java Doc)
public int loadBeanDefinitions(Resource[] resources) throws BeanDefinitionStoreException(Code)(Java Doc)
public int loadBeanDefinitions(String location) throws BeanDefinitionStoreException(Code)(Java Doc)
public int loadBeanDefinitions(String[] locations) throws BeanDefinitionStoreException(Code)(Java Doc)
public void setBeanClassLoader(ClassLoader beanClassLoader)(Code)(Java Doc)
public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)(Code)(Java Doc)
public void setResourceLoader(ResourceLoader resourceLoader)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.