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


java.lang.Object
   org.apache.commons.betwixt.digester.XMLIntrospectorHelper

XMLIntrospectorHelper
public class XMLIntrospectorHelper (Code)

XMLIntrospectorHelper a helper class for common code shared between the digestor and introspector.

TODO this class will be deprecated soon need to move the isLoop and isPrimitiveType but probably need to think about whether they need replacing with something different.
author:
   James Strachan
author:
   Martin van den Bemt


Field Summary
protected static  Loglog
    

Constructor Summary
public  XMLIntrospectorHelper()
    

Method Summary
public static  voidconfigureProperty(ElementDescriptor elementDescriptor, PropertyDescriptor propertyDescriptor)
     Configure an ElementDescriptor from a PropertyDescriptor.
public static  voidconfigureProperty(ElementDescriptor elementDescriptor, PropertyDescriptor propertyDescriptor, String updateMethodName, Class beanClass)
     Configure an ElementDescriptor from a PropertyDescriptor. A custom update method may be set.
Parameters:
  elementDescriptor - configure this ElementDescriptor
Parameters:
  propertyDescriptor - configure from this PropertyDescriptor
Parameters:
  updateMethodName - the name of the custom updater method to user.
public static  voidconfigureProperty(AttributeDescriptor attributeDescriptor, PropertyDescriptor propertyDescriptor)
    
public static  NodeDescriptorcreateDescriptor(PropertyDescriptor propertyDescriptor, boolean useAttributesForPrimitives, XMLIntrospector introspector)
     Process a property.
public static  voiddefaultAddMethods(XMLIntrospector introspector, ElementDescriptor rootDescriptor, Class beanClass)
     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 static  ElementDescriptorfindGetCollectionDescriptor(XMLIntrospector introspector, ElementDescriptor rootDescriptor, String propertyName)
     Attempts to find the element descriptor for the getter property that typically matches a collection or array.
public static  LoggetLog()
    
public static  booleanisLoopType(Class type)
    
public static  booleanisPrimitiveType(Class type)
     Is this a primitive type? TODO: this method will probably be removed when primitive types are subsumed into the simple type concept.
protected static  voidmakeElementDescriptorMap(ElementDescriptor rootDescriptor, Map map)
    
public static  voidsetLog(Log aLog)
    
protected static  voidswapDescriptor(ElementDescriptor rootDescriptor, ElementDescriptor oldValue, ElementDescriptor newValue)
     Traverse the tree of element descriptors and find the oldValue and swap it with the newValue.

Field Detail
log
protected static Log log(Code)
Log used for logging (Doh!)




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




Method Detail
configureProperty
public static void configureProperty(ElementDescriptor elementDescriptor, PropertyDescriptor propertyDescriptor)(Code)
Configure an ElementDescriptor from a PropertyDescriptor. This uses default element updater (the write method of the property).
Parameters:
  elementDescriptor - configure this ElementDescriptor
Parameters:
  propertyDescriptor - configure from this PropertyDescriptor



configureProperty
public static void configureProperty(ElementDescriptor elementDescriptor, PropertyDescriptor propertyDescriptor, String updateMethodName, Class beanClass)(Code)
Configure an ElementDescriptor from a PropertyDescriptor. A custom update method may be set.
Parameters:
  elementDescriptor - configure this ElementDescriptor
Parameters:
  propertyDescriptor - configure from this PropertyDescriptor
Parameters:
  updateMethodName - the name of the custom updater method to user. If null, then then
Parameters:
  beanClass - the Class from which the update method should be found.This may be null only when updateMethodName is also null.
since:
   0.5



configureProperty
public static void configureProperty(AttributeDescriptor attributeDescriptor, PropertyDescriptor propertyDescriptor)(Code)
Configure an AttributeDescriptor from a PropertyDescriptor
Parameters:
  attributeDescriptor - configure this AttributeDescriptor
Parameters:
  propertyDescriptor - configure from this PropertyDescriptor



createDescriptor
public static NodeDescriptor createDescriptor(PropertyDescriptor propertyDescriptor, boolean useAttributesForPrimitives, XMLIntrospector introspector) 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 - create a NodeDescriptor for this property
Parameters:
  useAttributesForPrimitives - write primitives as attributes (rather than elements)
Parameters:
  introspector - use this XMLIntrospector a correctly configured NodeDescriptor for the property
throws:
  IntrospectionException - when bean introspection failsXMLIntrospector.createDescriptor



defaultAddMethods
public static void defaultAddMethods(XMLIntrospector introspector, ElementDescriptor rootDescriptor, Class beanClass)(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.
Parameters:
  introspector - use this XMLIntrospector for introspection
Parameters:
  rootDescriptor - add defaults to this descriptor
Parameters:
  beanClass - the Class to which descriptor corresponds



findGetCollectionDescriptor
protected static ElementDescriptor findGetCollectionDescriptor(XMLIntrospector introspector, ElementDescriptor rootDescriptor, String propertyName)(Code)
Attempts to find the element descriptor for the getter property that typically matches a collection or array. The property name is used to match. e.g. if an addChild() method is detected the descriptor for the 'children' getter property should be returned.
Parameters:
  introspector - use this XMLIntrospector
Parameters:
  rootDescriptor - the ElementDescriptor whose child element will besearched for a match
Parameters:
  propertyName - the name of the 'adder' method to match ElementDescriptor for the matching getter



getLog
public static Log getLog()(Code)

Gets the current logging implementation.

current log



isLoopType
public static boolean isLoopType(Class type)(Code)
Is this a loop type class?
Parameters:
  type - is this Class a loop type? true if the type is a loop type, or if type is null org.apache.commons.betwixt.IntrospectionConfiguration.isLoopType(Class)



isPrimitiveType
public static boolean isPrimitiveType(Class type)(Code)
Is this a primitive type? TODO: this method will probably be removed when primitive types are subsumed into the simple type concept. This needs moving into XMLIntrospector so that the list of simple type can be varied.
Parameters:
  type - is this Class a primitive type? true for primitive types org.apache.commons.betwixt.strategy.TypeBindingStrategy



makeElementDescriptorMap
protected static void makeElementDescriptorMap(ElementDescriptor rootDescriptor, Map map)(Code)
Creates a map where the keys are the property names and the values are the ElementDescriptors
Parameters:
  rootDescriptor - the values of the maps are the children of this ElementDescriptor index by their property names
Parameters:
  map - the map to which the elements will be added



setLog
public static void setLog(Log aLog)(Code)

Sets the current logging implementation.


Parameters:
  aLog - use this Log



swapDescriptor
protected static void swapDescriptor(ElementDescriptor rootDescriptor, ElementDescriptor oldValue, ElementDescriptor newValue)(Code)
Traverse the tree of element descriptors and find the oldValue and swap it with the newValue. This would be much easier to do if ElementDescriptor supported a parent relationship.
Parameters:
  rootDescriptor - traverse child graph for this ElementDescriptor
Parameters:
  oldValue - replace this ElementDescriptor
Parameters:
  newValue - replace with this ElementDescriptor



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.