Java Doc for BeanReader.java in  » Library » Apache-commons-betwixt-0.8-src » org » apache » commons » betwixt » io » 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 » Library » Apache commons betwixt 0.8 src » org.apache.commons.betwixt.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.betwixt.io.BeanReader

BeanReader
public class BeanReader extends Digester (Code)

BeanReader reads a tree of beans from an XML document.

Call BeanReader.registerBeanClass(Class) or BeanReader.registerBeanClass(String,Class) to add rules to map a bean class.


author:
   James Strachan



Constructor Summary
public  BeanReader()
     Construct a new BeanReader with default properties.
public  BeanReader(SAXParser parser)
     Construct a new BeanReader, allowing a SAXParser to be passed in.
public  BeanReader(XMLReader reader)
     Construct a new BeanReader, allowing an XMLReader to be passed in.

Method Summary
protected  voidaddBeanCreateRule(String path, ElementDescriptor elementDescriptor, Class beanClass)
    
public  voidderegisterBeanClass(Class beanClass)
    

Remove the given class from the register.

public  voidflushRegisteredBeanClasses()
    

Flush all registered bean classes.

public  BindingConfigurationgetBindingConfiguration()
     Gets the dynamic configuration setting to be used for bean reading.
public  LoggetLog()
    

Get the current level for logging.

public  booleangetMatchIDs()
     Should the reader use ID attributes to match beans.
public  ReadConfigurationgetReadConfiguration()
     Gets read specific configuration details.
public  XMLIntrospectorgetXMLIntrospector()
    

Get the introspector used.

public  voidregisterBeanClass(Class beanClass)
    

Register a bean class and add mapping rules for this bean class.

A bean class is introspected when it is registered. It will not be introspected again even if the introspection settings are changed. If re-introspection is required, then BeanReader.deregisterBeanClass must be called and the bean re-registered.

A bean class can only be registered once.

public  voidregisterBeanClass(String path, Class beanClass)
    

Registers a bean class and add mapping rules for this bean class at the given path expression.

A bean class is introspected when it is registered. It will not be introspected again even if the introspection settings are changed. If re-introspection is required, then BeanReader.deregisterBeanClass must be called and the bean re-registered.

A bean class can only be registered once.

public  voidregisterBeanClass(InputSource mapping, Class beanClass)
    

Registers a class with a custom mapping. This mapping is specified by the standard dot betwixt document contained in the given InputSource.

Note: the custom mapping will be registered with the introspector.

public  voidregisterMultiMapping(InputSource mapping)
    

Registers a class with a multi-mapping. This mapping is specified by the multi-mapping document contained in the given InputSource.

Note: the custom mappings will be registered with the introspector.

public  voidsetBindingConfiguration(BindingConfiguration bindingConfiguration)
     Sets the dynamic configuration setting to be used for bean reading.
public  voidsetLog(Log log)
    

Set the current logging level.

public  voidsetMatchIDs(boolean matchIDs)
     Set whether the read should use ID attributes to match beans.
public  voidsetReadConfiguration(ReadConfiguration readConfiguration)
     Sets the read specific configuration details.
public  voidsetXMLIntrospector(XMLIntrospector introspector)
    

Set the introspector to be used.



Constructor Detail
BeanReader
public BeanReader()(Code)
Construct a new BeanReader with default properties.



BeanReader
public BeanReader(SAXParser parser)(Code)
Construct a new BeanReader, allowing a SAXParser to be passed in. This allows BeanReader to be used in environments which are unfriendly to JAXP1.1 (such as WebLogic 6.0). Thanks for the request to change go to James House (james@interobjective.com). This may help in places where you are able to load JAXP 1.1 classes yourself.
Parameters:
  parser - use this SAXParser



BeanReader
public BeanReader(XMLReader reader)(Code)
Construct a new BeanReader, allowing an XMLReader to be passed in. This allows BeanReader to be used in environments which are unfriendly to JAXP1.1 (such as WebLogic 6.0). Note that if you use this option you have to configure namespace and validation support yourself, as these properties only affect the SAXParser and emtpy constructor.
Parameters:
  reader - use this XMLReader as source for SAX events




Method Detail
addBeanCreateRule
protected void addBeanCreateRule(String path, ElementDescriptor elementDescriptor, Class beanClass)(Code)
Adds a new bean create rule for the specified path
Parameters:
  path - the digester path at which this rule should be added
Parameters:
  elementDescriptor - the ElementDescriptor describes the expected element
Parameters:
  beanClass - the Class of the bean created by this rule



deregisterBeanClass
public void deregisterBeanClass(Class beanClass)(Code)

Remove the given class from the register. Calling this method will allow the bean class to be re-registered by a subsequent call to registerBeanClass. This allows (for example) a bean to be reintrospected after a change to the introspection settings.

Note that deregistering a bean does not remove the Digester rules associated with that bean.


Parameters:
  beanClass - the Class to remove from the set of registered bean classes
since:
   0.5



flushRegisteredBeanClasses
public void flushRegisteredBeanClasses()(Code)

Flush all registered bean classes. This allows all bean classes to be re-registered by a subsequent calls to registerBeanClass.

Note that deregistering a bean does not remove the Digester rules associated with that bean.


since:
   0.5



getBindingConfiguration
public BindingConfiguration getBindingConfiguration()(Code)
Gets the dynamic configuration setting to be used for bean reading. the BindingConfiguration settings, not null
since:
   0.5



getLog
public Log getLog()(Code)

Get the current level for logging.

the Log implementation this class logs to



getMatchIDs
public boolean getMatchIDs()(Code)
Should the reader use ID attributes to match beans. true if ID and IDREF attributes should be used to match instancesBindingConfiguration.getMapIDs



getReadConfiguration
public ReadConfiguration getReadConfiguration()(Code)
Gets read specific configuration details. the ReadConfiguration, not null
since:
   0.5



getXMLIntrospector
public XMLIntrospector getXMLIntrospector()(Code)

Get the introspector used.

The XMLBeanInfo used to map each bean is created by the XMLIntrospector. One way in which the mapping can be customized is by altering the XMLIntrospector.

the XMLIntrospector used for the introspection



registerBeanClass
public void registerBeanClass(Class beanClass) throws IntrospectionException(Code)

Register a bean class and add mapping rules for this bean class.

A bean class is introspected when it is registered. It will not be introspected again even if the introspection settings are changed. If re-introspection is required, then BeanReader.deregisterBeanClass must be called and the bean re-registered.

A bean class can only be registered once. If the same class is registered a second time, this registration will be ignored. In order to change a registration, call BeanReader.deregisterBeanClass before calling this method.

All the rules required to digest this bean are added when this method is called. Other rules that you want to execute before these should be added before this method is called. Those that should be executed afterwards, should be added afterwards.


Parameters:
  beanClass - the Class to be registered
throws:
  IntrospectionException - if the bean introspection fails



registerBeanClass
public void registerBeanClass(String path, Class beanClass) throws IntrospectionException(Code)

Registers a bean class and add mapping rules for this bean class at the given path expression.

A bean class is introspected when it is registered. It will not be introspected again even if the introspection settings are changed. If re-introspection is required, then BeanReader.deregisterBeanClass must be called and the bean re-registered.

A bean class can only be registered once. If the same class is registered a second time, this registration will be ignored. In order to change a registration, call BeanReader.deregisterBeanClass before calling this method.

All the rules required to digest this bean are added when this method is called. Other rules that you want to execute before these should be added before this method is called. Those that should be executed afterwards, should be added afterwards.


Parameters:
  path - the xml path expression where the class is to registered. This should be in digester path notation
Parameters:
  beanClass - the Class to be registered
throws:
  IntrospectionException - if the bean introspection fails



registerBeanClass
public void registerBeanClass(InputSource mapping, Class beanClass) throws IntrospectionException, IOException, SAXException(Code)

Registers a class with a custom mapping. This mapping is specified by the standard dot betwixt document contained in the given InputSource.

Note: the custom mapping will be registered with the introspector. This must remain so for the reading to work correctly It is recommended that use of the pre-registeration process provided by XMLIntrospector.register be considered as an alternative to this method.


See Also:   BeanReader.registerBeanClass(Class)
See Also:    since the general notes given there
See Also:   apply equally to this
since:
   0.7
Parameters:
  mapping - InputSource giving the dot betwixt document specifying the mapping
Parameters:
  beanClass - Class that should be register
throws:
  IntrospectionException -
throws:
  SAXException -
throws:
  IOException -



registerMultiMapping
public void registerMultiMapping(InputSource mapping) throws IntrospectionException, IOException, SAXException(Code)

Registers a class with a multi-mapping. This mapping is specified by the multi-mapping document contained in the given InputSource.

Note: the custom mappings will be registered with the introspector. This must remain so for the reading to work correctly It is recommended that use of the pre-registeration process provided by XMLIntrospector.register be considered as an alternative to this method.


See Also:   BeanReader.registerBeanClass(Class)
See Also:    since the general notes given there
See Also:   apply equally to this
See Also:   XMLIntrospector.register(InputSource)
See Also:    for more details on the multi-mapping format
since:
   0.7
Parameters:
  mapping - InputSource giving the multi-mapping document specifying the mapping
throws:
  IntrospectionException -
throws:
  SAXException -
throws:
  IOException -



setBindingConfiguration
public void setBindingConfiguration(BindingConfiguration bindingConfiguration)(Code)
Sets the dynamic configuration setting to be used for bean reading.
Parameters:
  bindingConfiguration - the BindingConfiguration settings, not null
since:
   0.5



setLog
public void setLog(Log log)(Code)

Set the current logging level.


Parameters:
  log - the Logimplementation to use for logging



setMatchIDs
public void setMatchIDs(boolean matchIDs)(Code)
Set whether the read should use ID attributes to match beans.
Parameters:
  matchIDs - pass true if ID's should be matchedBindingConfiguration.setMapIDs



setReadConfiguration
public void setReadConfiguration(ReadConfiguration readConfiguration)(Code)
Sets the read specific configuration details.
Parameters:
  readConfiguration - not null
since:
   0.5



setXMLIntrospector
public void setXMLIntrospector(XMLIntrospector introspector)(Code)

Set the introspector to be used.

The XMLBeanInfo used to map each bean is created by the XMLIntrospector. One way in which the mapping can be customized is by altering the XMLIntrospector.


Parameters:
  introspector - use this introspector



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