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


java.lang.Object
   org.apache.commons.betwixt.XMLIntrospector

XMLIntrospector
public class XMLIntrospector (Code)

XMLIntrospector an introspector of beans to create a XMLBeanInfo instance.

By default, XMLBeanInfo caching is switched on. This means that the first time that a request is made for a XMLBeanInfo for a particular class, the XMLBeanInfo is cached. Later requests for the same class will return the cached value.

Note :

This class makes use of the java.bean.Introspector class, which contains a BeanInfoSearchPath. To make sure betwixt can do his work correctly, this searchpath is completely ignored during processing. The original values will be restored after processing finished


author:
   James Strachan
author:
   Martin van den Bemt


Field Summary
protected  Loglog
    

Constructor Summary
public  XMLIntrospector()
    
public  XMLIntrospector(IntrospectionConfiguration configuration)
     Construct allows a custom configuration to be set on construction.

Method Summary
protected  voidaddProperties(BeanInfo beanInfo, List elements, List attributes, List contents)
    
protected  voidaddProperties(BeanProperty[] beanProperties, List elements, List attributes, List contents)
    
protected  voidaddProperties(BeanInfo beanInfo, List elements, List attributes)
    
protected  voidaddProperty(BeanInfo beanInfo, PropertyDescriptor propertyDescriptor, List elements, List attributes, List contents)
     Process a property.
protected  voidaddProperty(PropertyDescriptor propertyDescriptor, List elements, List attributes, List contents)
     Process a property.
protected  voidaddProperty(BeanProperty beanProperty, List elements, List attributes, List contents)
     Process a property.
protected  voidaddProperty(BeanInfo beanInfo, PropertyDescriptor propertyDescriptor, List elements, List attributes)
     Process a property.
public  voidassignAdder(Method twinParameterAdderMethod, ElementDescriptor matchingDescriptor)
     Assigns the given method as an adder method to the given descriptor.
public  DescriptorcreateDescriptor(PropertyDescriptor propertyDescriptor, boolean useAttributesForPrimitives)
     Create a XML descriptor from a bean one.
protected  NameMappercreateNameMapper()
     A Factory method to lazily create a strategy used to convert bean type names into element names.
protected  PluralStemmercreatePluralStemmer()
     A Factory method to lazily create a new strategy to detect matching singular and plural properties.
protected  XMLBeanInfocreateXMLBeanInfo(DynaClass dynaClass)
     Creates XMLBeanInfo for the given DynaClass.
protected  XMLBeanInfocreateXMLBeanInfo(BeanInfo beanInfo)
    
public  DescriptorcreateXMLDescriptor(BeanProperty beanProperty)
     Create a XML descriptor from a bean one.
public  voiddefaultAddMethods(ElementDescriptor rootDescriptor, Class beanClass)
     Add any addPropety(PropertyType) methods as Updaters which are often used for 1-N relationships in beans. This method does not preserve null property names.
The tricky part here is finding which ElementDescriptor corresponds to the method.
public  voiddefaultAddMethods(ElementDescriptor rootDescriptor, Class beanClass, boolean preservePropertyName)
     Add any addPropety(PropertyType) methods as Updaters which are often used for 1-N relationships in beans.
The tricky part here is finding which ElementDescriptor corresponds to the method.
protected synchronized  XMLBeanInfofindByXMLDescriptor(Class aClass)
    
public  voidflushCache()
     Flush existing cached XMLBeanInfo's.
public  NameMappergetAttributeNameMapper()
     Gets the name mapping strategy used to convert bean names into attributes. the strategy used to convert bean type names into attributenames.
public  ClassNormalizergetClassNormalizer()
     Gets the ClassNormalizer strategy. This is used to determine the Class to be introspected (the normalized Class).
public  IntrospectionConfigurationgetConfiguration()
     Gets the configuration to be used for introspection.
public  NameMappergetElementNameMapper()
     Gets the name mapping strategy used to convert bean names into elements. the strategy used to convert bean type names into element names.
public  LoggetLog()
    

Gets the current logging implementation.

public  NameMappergetNameMapper()
     Gets the name mapper strategy.
public  PluralStemmergetPluralStemmer()
     Get singular and plural matching strategy.
public  PolymorphicReferenceResolvergetPolymorphicReferenceResolver()
    

Gets the resolver for polymorphic references.

Though this is used only at bind time, it is typically tightly couple to the xml registry.

public  XMLBeanInfoRegistrygetRegistry()
    

Gets the current registry implementation. The registry is checked to see if it has an XMLBeanInfo for a class before introspecting.

public  XMLBeanInfointrospect(Object bean)
     Create a standard XMLBeanInfo by introspection The actual introspection depends only on the BeanInfo associated with the bean.
public  XMLBeanInfointrospect(DynaClass dynaClass)
     Creates XMLBeanInfo by reading the DynaProperties of a DynaBean.
public synchronized  XMLBeanInfointrospect(Class aClass, InputSource source)
    

Introspects the given Class using the dot betwixt document in the given InputSource.

Note: that the given mapping will not be registered by this method.

public  XMLBeanInfointrospect(Class aClass)
     Create a standard XMLBeanInfo by introspection. The actual introspection depends only on the BeanInfo associated with the bean.
public  XMLBeanInfointrospect(BeanInfo beanInfo)
     Create a standard XMLBeanInfo by introspection.
public  booleanisAttributesForPrimitives()
     Should attributes (or elements) be used for primitive types.
public  booleanisCachingEnabled()
    
public  booleanisLoopType(Class type)
    
public  booleanisPrimitiveType(Class type)
    
public  booleanisWrapCollectionsInElement()
    
public synchronized  Class[]register(InputSource source)
    

Registers the class mappings specified in the multi-class document given by the InputSource.

public  voidregister(Class aClass, InputSource source)
    

Registers the class mapping specified in the standard dot-betwixt file.

public  voidsetAttributeNameMapper(NameMapper nameMapper)
    
public  voidsetAttributesForPrimitives(boolean attributesForPrimitives)
     Set whether attributes (or elements) should be used for primitive types.
public  voidsetCachingEnabled(boolean cachingEnabled)
     Set whether XMLBeanInfo caching should be enabled.
public  voidsetClassNormalizer(ClassNormalizer classNormalizer)
     Sets the ClassNormalizer strategy. This is used to determine the Class to be introspected (the normalized Class).
public  voidsetConfiguration(IntrospectionConfiguration configuration)
     Sets the configuration to be used for introspection.
public  voidsetElementNameMapper(NameMapper nameMapper)
    
public  voidsetLog(Log log)
    
public  voidsetNameMapper(NameMapper nameMapper)
    
public  voidsetPluralStemmer(PluralStemmer pluralStemmer)
    
public  voidsetPolymorphicReferenceResolver(PolymorphicReferenceResolver polymorphicReferenceResolver)
    

Sets the resolver for polymorphic references.

Though this is used only at bind time, it is typically tightly couple to the xml registry.

public  voidsetRegistry(XMLBeanInfoRegistry registry)
    

Sets the XMLBeanInfoRegistry implementation. The registry is checked to see if it has an XMLBeanInfo for a class before introspecting.

public  voidsetUseBeanInfoSearchPath(boolean useBeanInfoSearchPath)
    
public  voidsetWrapCollectionsInElement(boolean wrapCollectionsInElement)
     Sets whether we should we wrap collections in an extra element.
public  booleanuseBeanInfoSearchPath()
     Should the original java.reflect.Introspector bean info search path be used? By default it will be false.

Field Detail
log
protected Log log(Code)
Log used for logging (Doh!) XMLIntrospector.getLog()




Constructor Detail
XMLIntrospector
public XMLIntrospector()(Code)
Base constructor



XMLIntrospector
public XMLIntrospector(IntrospectionConfiguration configuration)(Code)
Construct allows a custom configuration to be set on construction. This allows IntrospectionConfiguration subclasses to be easily used.
Parameters:
  configuration - IntrospectionConfiguration, not null




Method Detail
addProperties
protected void addProperties(BeanInfo beanInfo, List elements, List attributes, List contents) throws IntrospectionException(Code)
Loop through properties and process each one
Parameters:
  beanInfo - the BeanInfo whose properties will be processed
Parameters:
  elements - ElementDescriptor list to which elements will be added
Parameters:
  attributes - AttributeDescriptor list to which attributes will be added
Parameters:
  contents - Descriptor list to which mixed content will be added
throws:
  IntrospectionException - if the bean introspection failsXMLIntrospector.addProperties(BeanProperty[],List,List,List)



addProperties
protected void addProperties(BeanProperty[] beanProperties, List elements, List attributes, List contents)(Code)
Loop through properties and process each one
Parameters:
  beanProperties - the properties to be processed
Parameters:
  elements - ElementDescriptor list to which elements will be added
Parameters:
  attributes - AttributeDescriptor list to which attributes will be added
Parameters:
  contents - Descriptor list to which mixed content will be added
since:
   0.5



addProperties
protected void addProperties(BeanInfo beanInfo, List elements, List attributes) throws IntrospectionException(Code)
Loop through properties and process each one
Parameters:
  beanInfo - the BeanInfo whose properties will be processed
Parameters:
  elements - ElementDescriptor list to which elements will be added
Parameters:
  attributes - AttributeDescriptor list to which attributes will be added
throws:
  IntrospectionException - if the bean introspection failsXMLIntrospector.addProperties(BeanInfo,List,List,List)



addProperty
protected void addProperty(BeanInfo beanInfo, PropertyDescriptor propertyDescriptor, List elements, List attributes, List contents) throws IntrospectionException(Code)
Process a property. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.
Parameters:
  beanInfo - the BeanInfo whose property is being processed
Parameters:
  propertyDescriptor - the PropertyDescriptor to process
Parameters:
  elements - ElementDescriptor list to which elements will be added
Parameters:
  attributes - AttributeDescriptor list to which attributes will be added
Parameters:
  contents - Descriptor list to which mixed content will be added
throws:
  IntrospectionException - if the bean introspection failsXMLIntrospector.addProperty(PropertyDescriptor,List,List,List)



addProperty
protected void addProperty(PropertyDescriptor propertyDescriptor, List elements, List attributes, List contents) throws IntrospectionException(Code)
Process a property. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.
Parameters:
  propertyDescriptor - the PropertyDescriptor to process
Parameters:
  elements - ElementDescriptor list to which elements will be added
Parameters:
  attributes - AttributeDescriptor list to which attributes will be added
Parameters:
  contents - Descriptor list to which mixed content will be added
throws:
  IntrospectionException - if the bean introspection failsXMLIntrospector.addProperty(BeanProperty,List,List,List)



addProperty
protected void addProperty(BeanProperty beanProperty, List elements, List attributes, List contents)(Code)
Process a property. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.
Parameters:
  beanProperty - the bean property to process
Parameters:
  elements - ElementDescriptor list to which elements will be added
Parameters:
  attributes - AttributeDescriptor list to which attributes will be added
Parameters:
  contents - Descriptor list to which mixed content will be added
since:
   0.5



addProperty
protected void addProperty(BeanInfo beanInfo, PropertyDescriptor propertyDescriptor, List elements, List attributes) throws IntrospectionException(Code)
Process a property. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.
Parameters:
  beanInfo - the BeanInfo whose property is being processed
Parameters:
  propertyDescriptor - the PropertyDescriptor to process
Parameters:
  elements - ElementDescriptor list to which elements will be added
Parameters:
  attributes - AttributeDescriptor list to which attributes will be added
throws:
  IntrospectionException - if the bean introspection failsXMLIntrospector.addProperty(BeanInfo,PropertyDescriptor,List,List,List)



assignAdder
public void assignAdder(Method twinParameterAdderMethod, ElementDescriptor matchingDescriptor)(Code)
Assigns the given method as an adder method to the given descriptor.
Parameters:
  twinParameterAdderMethod - adder Method, not null
Parameters:
  matchingDescriptor - ElementDescriptor describing the element
since:
   0.8



createDescriptor
public Descriptor createDescriptor(PropertyDescriptor propertyDescriptor, boolean useAttributesForPrimitives) throws IntrospectionException(Code)
Create a XML descriptor from a bean one. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.
Parameters:
  propertyDescriptor - create a NodeDescriptor for this property
Parameters:
  useAttributesForPrimitives - write primitives as attributes (rather than elements) a correctly configured NodeDescriptor for the property
throws:
  IntrospectionException - when bean introspection failsXMLIntrospector.createXMLDescriptor



createNameMapper
protected NameMapper createNameMapper()(Code)
A Factory method to lazily create a strategy used to convert bean type names into element names. new default NameMapper implementation



createPluralStemmer
protected PluralStemmer createPluralStemmer()(Code)
A Factory method to lazily create a new strategy to detect matching singular and plural properties. new defualt PluralStemmer implementation



createXMLBeanInfo
protected XMLBeanInfo createXMLBeanInfo(DynaClass dynaClass)(Code)
Creates XMLBeanInfo for the given DynaClass.
Parameters:
  dynaClass - the class describing a DynaBean XMLBeanInfo that describes the properties of the given DynaClass



createXMLBeanInfo
protected XMLBeanInfo createXMLBeanInfo(BeanInfo beanInfo)(Code)
Factory method to create XMLBeanInfo instances
Parameters:
  beanInfo - the BeanInfo from which the XMLBeanInfo will be created XMLBeanInfo describing the bean-xml mapping



createXMLDescriptor
public Descriptor createXMLDescriptor(BeanProperty beanProperty)(Code)
Create a XML descriptor from a bean one. Go through and work out whether it's a loop property, a primitive or a standard. The class property is ignored.
Parameters:
  beanProperty - the BeanProperty specifying the property a correctly configured NodeDescriptor for the property
since:
   0.5



defaultAddMethods
public void defaultAddMethods(ElementDescriptor rootDescriptor, Class beanClass)(Code)
Add any addPropety(PropertyType) methods as Updaters which are often used for 1-N relationships in beans. This method does not preserve null property names.
The tricky part here is finding which ElementDescriptor corresponds to the method. e.g. a property 'items' might have an Element descriptor which the method addItem() should match to.
So the algorithm we'll use by default is to take the decapitalized name of the property being added and find the first ElementDescriptor that matches the property starting with the string. This should work for most use cases. e.g. addChild() would match the children property.
TODO this probably needs refactoring. It probably belongs in the bean wrapper (so that it'll work properly with dyna-beans) and so that the operations can be optimized by caching. Multiple hash maps are created and getMethods is called multiple times. This is relatively expensive and so it'd be better to push into a proper class and cache.

Parameters:
  rootDescriptor - add defaults to this descriptor
Parameters:
  beanClass - the Class to which descriptor corresponds



defaultAddMethods
public void defaultAddMethods(ElementDescriptor rootDescriptor, Class beanClass, boolean preservePropertyName)(Code)
Add any addPropety(PropertyType) methods as Updaters which are often used for 1-N relationships in beans.
The tricky part here is finding which ElementDescriptor corresponds to the method. e.g. a property 'items' might have an Element descriptor which the method addItem() should match to.
So the algorithm we'll use by default is to take the decapitalized name of the property being added and find the first ElementDescriptor that matches the property starting with the string. This should work for most use cases. e.g. addChild() would match the children property.
TODO this probably needs refactoring. It probably belongs in the bean wrapper (so that it'll work properly with dyna-beans) and so that the operations can be optimized by caching. Multiple hash maps are created and getMethods is called multiple times. This is relatively expensive and so it'd be better to push into a proper class and cache.

Parameters:
  rootDescriptor - add defaults to this descriptor
Parameters:
  beanClass - the Class to which descriptor corresponds
since:
   0.8



findByXMLDescriptor
protected synchronized XMLBeanInfo findByXMLDescriptor(Class aClass)(Code)
Attempt to lookup the XML descriptor for the given class using the classname + ".betwixt" using the same ClassLoader used to load the class or return null if it could not be loaded
Parameters:
  aClass - digester .betwixt file for this class XMLBeanInfo digested from the .betwixt file if one can be found.Otherwise null.



flushCache
public void flushCache()(Code)
Flush existing cached XMLBeanInfo's.



getAttributeNameMapper
public NameMapper getAttributeNameMapper()(Code)
Gets the name mapping strategy used to convert bean names into attributes. the strategy used to convert bean type names into attributenames. If no attributeNamemapper is known, it will default to the ElementNameMapper



getClassNormalizer
public ClassNormalizer getClassNormalizer()(Code)
Gets the ClassNormalizer strategy. This is used to determine the Class to be introspected (the normalized Class). the ClassNormalizer used to determine the Class to be introspectedfor a given Object.
since:
   0.5



getConfiguration
public IntrospectionConfiguration getConfiguration()(Code)
Gets the configuration to be used for introspection. The various introspection-time strategies and configuration variables have been consolidated as properties of this bean. This allows the configuration to be more easily shared. IntrospectionConfiguration, not null



getElementNameMapper
public NameMapper getElementNameMapper()(Code)
Gets the name mapping strategy used to convert bean names into elements. the strategy used to convert bean type names into element names. If no element mapper is currently defined then a default one is created.



getLog
public Log getLog()(Code)

Gets the current logging implementation.

the Log implementation which this class logs to



getNameMapper
public NameMapper getNameMapper()(Code)
Gets the name mapper strategy. the strategy used to convert bean type names into element namesXMLIntrospector.getElementNameMapper()XMLIntrospector.getAttributeNameMapper()



getPluralStemmer
public PluralStemmer getPluralStemmer()(Code)
Get singular and plural matching strategy. the strategy used to detect matching singular and plural properties



getPolymorphicReferenceResolver
public PolymorphicReferenceResolver getPolymorphicReferenceResolver()(Code)

Gets the resolver for polymorphic references.

Though this is used only at bind time, it is typically tightly couple to the xml registry. It is therefore convenient to keep both references together.

Note: though the implementation is set initially to the default registry, this reference is not updated when XMLIntrospector.setRegistry(XMLBeanInfoRegistry) is called. Therefore, a call to XMLIntrospector.setPolymorphicReferenceResolver(PolymorphicReferenceResolver) with the instance may be necessary.


since:
   0.7 PolymorphicReferenceResolver, not null



getRegistry
public XMLBeanInfoRegistry getRegistry()(Code)

Gets the current registry implementation. The registry is checked to see if it has an XMLBeanInfo for a class before introspecting. After standard introspection is complete, the instance will be passed to the registry.

This allows finely grained control over the caching strategy. It also allows the standard introspection mechanism to be overridden on a per class basis.

the XMLBeanInfoRegistry currently used



introspect
public XMLBeanInfo introspect(Object bean) throws IntrospectionException(Code)
Create a standard XMLBeanInfo by introspection The actual introspection depends only on the BeanInfo associated with the bean.
Parameters:
  bean - introspect this bean XMLBeanInfo describing bean-xml mapping
throws:
  IntrospectionException - when the bean introspection fails



introspect
public XMLBeanInfo introspect(DynaClass dynaClass)(Code)
Creates XMLBeanInfo by reading the DynaProperties of a DynaBean. Customizing DynaBeans using betwixt is not supported.
Parameters:
  dynaClass - the DynaBean to introspect XMLBeanInfo for the DynaClass



introspect
public synchronized XMLBeanInfo introspect(Class aClass, InputSource source) throws IOException, SAXException(Code)

Introspects the given Class using the dot betwixt document in the given InputSource.

Note: that the given mapping will not be registered by this method. Use XMLIntrospector.register(Class,InputSource) instead.


since:
   0.7
Parameters:
  aClass - Class, not null
Parameters:
  source - InputSource, not null XMLBeanInfo describing the mapping.
throws:
  SAXException - when the input source cannot be parsed
throws:
  IOException -



introspect
public XMLBeanInfo introspect(Class aClass) throws IntrospectionException(Code)
Create a standard XMLBeanInfo by introspection. The actual introspection depends only on the BeanInfo associated with the bean.
Parameters:
  aClass - introspect this class XMLBeanInfo describing bean-xml mapping
throws:
  IntrospectionException - when the bean introspection fails



introspect
public XMLBeanInfo introspect(BeanInfo beanInfo) throws IntrospectionException(Code)
Create a standard XMLBeanInfo by introspection. The actual introspection depends only on the BeanInfo associated with the bean.
Parameters:
  beanInfo - the BeanInfo the xml-bean mapping is based on XMLBeanInfo describing bean-xml mapping
throws:
  IntrospectionException - when the bean introspection fails



isAttributesForPrimitives
public boolean isAttributesForPrimitives()(Code)
Should attributes (or elements) be used for primitive types. true if primitive types will be mapped to attributes in the introspection



isCachingEnabled
public boolean isCachingEnabled()(Code)
Is XMLBeanInfo caching enabled? true if caching is enabled



isLoopType
public boolean isLoopType(Class type)(Code)
Is this class a loop?
Parameters:
  type - the Class to test true if the type is a loop type



isPrimitiveType
public boolean isPrimitiveType(Class type)(Code)
Is this class a primitive?
Parameters:
  type - the Class to test true for primitive types



isWrapCollectionsInElement
public boolean isWrapCollectionsInElement()(Code)
Should collections be wrapped in an extra element? whether we should we wrap collections in an extra element?



register
public synchronized Class[] register(InputSource source) throws IntrospectionException, IOException, SAXException(Code)

Registers the class mappings specified in the multi-class document given by the InputSource.

Note: that this method will override any existing mapping for the speficied classes.


since:
   0.7
Parameters:
  source - InputSource, not null Class array containing all mapped classes
throws:
  IntrospectionException -
throws:
  SAXException -
throws:
  IOException -



register
public void register(Class aClass, InputSource source) throws IOException, SAXException(Code)

Registers the class mapping specified in the standard dot-betwixt file. Subsequent introspections will use this registered mapping for the class.

Note: that this method will override any existing mapping for this class.


since:
   0.7
Parameters:
  aClass - Class, not null
Parameters:
  source - InputSource, not null
throws:
  SAXException - when the source cannot be parsed
throws:
  IOException -



setAttributeNameMapper
public void setAttributeNameMapper(NameMapper nameMapper)(Code)
Sets the strategy used to convert bean type names into attribute names
Parameters:
  nameMapper - the NameMapper to use for the convertion



setAttributesForPrimitives
public void setAttributesForPrimitives(boolean attributesForPrimitives)(Code)
Set whether attributes (or elements) should be used for primitive types.
Parameters:
  attributesForPrimitives - pass trus to map primitives to attributes,pass false to map primitives to elements



setCachingEnabled
public void setCachingEnabled(boolean cachingEnabled)(Code)
Set whether XMLBeanInfo caching should be enabled.
Parameters:
  cachingEnabled - ignored



setClassNormalizer
public void setClassNormalizer(ClassNormalizer classNormalizer)(Code)
Sets the ClassNormalizer strategy. This is used to determine the Class to be introspected (the normalized Class).
Parameters:
  classNormalizer - the ClassNormalizer to be used to determine the Class to be introspected for a given Object.
since:
   0.5



setConfiguration
public void setConfiguration(IntrospectionConfiguration configuration)(Code)
Sets the configuration to be used for introspection. The various introspection-time strategies and configuration variables have been consolidated as properties of this bean. This allows the configuration to be more easily shared.
Parameters:
  configuration - IntrospectionConfiguration, not null



setElementNameMapper
public void setElementNameMapper(NameMapper nameMapper)(Code)
Sets the strategy used to convert bean type names into element names
Parameters:
  nameMapper - the NameMapper to use for the conversion



setLog
public void setLog(Log log)(Code)

Sets the current logging implementation.


Parameters:
  log - the Log implementation to use for logging



setNameMapper
public void setNameMapper(NameMapper nameMapper)(Code)
Sets the strategy used to convert bean type names into element names
Parameters:
  nameMapper - the NameMapper strategy to be usedXMLIntrospector.setElementNameMapper(NameMapper)XMLIntrospector.setAttributeNameMapper(NameMapper)



setPluralStemmer
public void setPluralStemmer(PluralStemmer pluralStemmer)(Code)
Sets the strategy used to detect matching singular and plural properties
Parameters:
  pluralStemmer - the PluralStemmer used to match singular and plural



setPolymorphicReferenceResolver
public void setPolymorphicReferenceResolver(PolymorphicReferenceResolver polymorphicReferenceResolver)(Code)

Sets the resolver for polymorphic references.

Though this is used only at bind time, it is typically tightly couple to the xml registry. It is therefore convenient to keep both references together.

Note: though the implementation is set initially to the default registry, this reference is not updated when XMLIntrospector.setRegistry(XMLBeanInfoRegistry) is called. Therefore, a call to XMLIntrospector.setPolymorphicReferenceResolver(PolymorphicReferenceResolver) with the instance may be necessary.


since:
   0.7
Parameters:
  polymorphicReferenceResolver - The polymorphicReferenceResolver to set.



setRegistry
public void setRegistry(XMLBeanInfoRegistry registry)(Code)

Sets the XMLBeanInfoRegistry implementation. The registry is checked to see if it has an XMLBeanInfo for a class before introspecting. After standard introspection is complete, the instance will be passed to the registry.

This allows finely grained control over the caching strategy. It also allows the standard introspection mechanism to be overridden on a per class basis.

Note when using polymophic mapping with a custom registry, a call to XMLIntrospector.setPolymorphicReferenceResolver(PolymorphicReferenceResolver) may be necessary.


Parameters:
  registry - the XMLBeanInfoRegistry to use



setUseBeanInfoSearchPath
public void setUseBeanInfoSearchPath(boolean useBeanInfoSearchPath)(Code)
Specifies if you want to use the beanInfoSearchPath
See Also:   java.beans.Introspector
See Also:    for more details
Parameters:
  useBeanInfoSearchPath -



setWrapCollectionsInElement
public void setWrapCollectionsInElement(boolean wrapCollectionsInElement)(Code)
Sets whether we should we wrap collections in an extra element.
Parameters:
  wrapCollectionsInElement - pass true if collections should be wrapped in aparent element



useBeanInfoSearchPath
public boolean useBeanInfoSearchPath()(Code)
Should the original java.reflect.Introspector bean info search path be used? By default it will be false. boolean if the beanInfoSearchPath should be used.



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.