Java Doc for ElementDescriptor.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.Descriptor
      org.apache.commons.betwixt.NodeDescriptor
         org.apache.commons.betwixt.ElementDescriptor

ElementDescriptor
public class ElementDescriptor extends NodeDescriptor (Code)

ElementDescriptor describes the XML elements to be created for a bean instance.

It contains AttributeDescriptor's for all it's attributes and ElementDescriptor's for it's child elements.
author:
   James Strachan
author:
   Martin van den Bemt




Constructor Summary
public  ElementDescriptor()
     Constructs an ElementDescriptor that refers to a primitive type.
public  ElementDescriptor(boolean primitiveType)
     Base constructor.
public  ElementDescriptor(String localName)
     Creates a ElementDescriptor with no namespace URI or prefix.
Parameters:
  localName - the (xml) local name of this node.
public  ElementDescriptor(String localName, String qualifiedName, String uri)
    

Method Summary
public  voidaddAttributeDescriptor(AttributeDescriptor descriptor)
    
public  voidaddContentDescriptor(Descriptor descriptor)
     Adds a descriptor for child content.
public  voidaddElementDescriptor(ElementDescriptor descriptor)
     Adds a descriptor for a child element.
public  ElementDescriptorfindParent(ElementDescriptor elementDescriptor)
     Finds the parent of the given descriptor.
public  AttributeDescriptorgetAttributeDescriptor(String name)
     Returns an attribute descriptor with a given name or null.
Parameters:
  name - to search for; will be checked against the attributes' qualified name.
public  AttributeDescriptor[]getAttributeDescriptors()
    
protected  ListgetAttributeList()
     Lazily creates the mutable List.
public  Descriptor[]getContentDescriptors()
     Returns descriptors for the child content of the element this describes.
protected  ListgetContentList()
     Lazily creates the mutable List of child content descriptors.
public  ExpressiongetContextExpression()
     Returns the expression used to evaluate the new context of this element.
public  ElementDescriptorgetElementDescriptor(String name)
     Gets a child ElementDescriptor matching the given name if one exists. Note that (so long as there are no better matches), a null name acts as a wildcard.
public  ElementDescriptor[]getElementDescriptors()
     Returns descriptors for the child elements of the element this describes.
protected  ListgetElementList()
     Lazily creates the mutable List of child elements.
public  ClassgetImplementationClass()
     Gets the class which should be used for instantiation.
public  TextDescriptorgetPrimaryBodyTextDescriptor()
    

Gets the primary descriptor for body text of this element.

public  booleanhasAttributes()
    
public  booleanhasChildren()
    
public  booleanhasContent()
     Returns true if this element has child content.
public  booleanisCollective()
    
public  booleanisHollow()
    

Is this decriptor hollow?

A hollow descriptor is one which gives only the class that the subgraph is mapped to rather than describing the entire subgraph. A new XMLBeanInfo should be introspected and that used to describe the subgraph. A hollow descriptor should not have any child descriptors.

public  booleanisPolymorphic()
    

Is this a polymorphic element?

A polymorphic element's name is not fixed at introspection time and it's resolution is postponed to bind time.

public  booleanisPrimitiveType()
    
public  booleanisSimple()
    

Is this a simple element?

A simple element is one without child elements or attributes.

public  booleanisUseBindTimeTypeForMapping()
    

Is the bind time type to be used to determine the mapping?

The mapping for an object property value can either be the introspection time type (based on the logical type of the property) or the bind time type (based on the type of the actual instance).

public  booleanisWrapCollectionsInElement()
     Returns true if collective bean properties should wrap the items in a parent element.
public  voidremoveAttributeDescriptor(AttributeDescriptor descriptor)
     Removes an attribute descriptor from this element descriptor.
public  voidremoveElementDescriptor(ElementDescriptor descriptor)
     Removes an element descriptor from this element descriptor.
public  voidsetAttributeDescriptors(AttributeDescriptor[] attributeDescriptors)
     Sets the AttributesDescriptors for this element.
public  voidsetCollective(boolean isCollectiveType)
     Sets whether the element described is a collective.
public  voidsetContentDescriptors(Descriptor[] contentDescriptors)
     Sets the descriptors for the child content of the element this describes.
public  voidsetContextExpression(Expression contextExpression)
    
public  voidsetElementDescriptors(ElementDescriptor[] elementDescriptors)
     Sets the descriptors for the child element of the element this describes.
public  voidsetHollow(boolean isHollow)
     Sets whether this descriptor is hollow. A hollow descriptor is one which gives only the class that the subgraph is mapped to rather than describing the entire subgraph. A new XMLBeanInfo should be introspected and that used to describe the subgraph. A hollow descriptor should not have any child descriptors.
public  voidsetImplementationClass(Class implementationClass)
     Sets the class which should be used for instantiation.
public  voidsetPrimitiveType(boolean primitiveType)
    
public  voidsetUseBindTimeTypeForMapping(boolean useBindTimeTypeForMapping)
    

Sets whether the bind time type to be used to determine the mapping.

public  voidsetWrapCollectionsInElement(boolean wrapCollectionsInElement)
     Sets whether Collection bean properties should wrap items in a parent element.
public  StringtoString()
     Returns something useful for logging.


Constructor Detail
ElementDescriptor
public ElementDescriptor()(Code)
Constructs an ElementDescriptor that refers to a primitive type.



ElementDescriptor
public ElementDescriptor(boolean primitiveType)(Code)
Base constructor.
Parameters:
  primitiveType - if true, this element refers to a primitive type



ElementDescriptor
public ElementDescriptor(String localName)(Code)
Creates a ElementDescriptor with no namespace URI or prefix.
Parameters:
  localName - the (xml) local name of this node. This will be used to set both qualified and local name for this name.



ElementDescriptor
public ElementDescriptor(String localName, String qualifiedName, String uri)(Code)
Creates a ElementDescriptor with namespace URI and qualified name
Parameters:
  localName - the (xml) local name of this node
Parameters:
  qualifiedName - the (xml) qualified name of this node
Parameters:
  uri - the (xml) namespace prefix of this node




Method Detail
addAttributeDescriptor
public void addAttributeDescriptor(AttributeDescriptor descriptor)(Code)
Adds an attribute to the element this ElementDescriptor describes
Parameters:
  descriptor - the AttributeDescriptor that will be added to the attributes associated with element this ElementDescriptor describes



addContentDescriptor
public void addContentDescriptor(Descriptor descriptor)(Code)
Adds a descriptor for child content.
Parameters:
  descriptor - the Descriptor describing the child content to add
since:
   0.5



addElementDescriptor
public void addElementDescriptor(ElementDescriptor descriptor)(Code)
Adds a descriptor for a child element.
Parameters:
  descriptor - the ElementDescriptor describing the child element to add



findParent
public ElementDescriptor findParent(ElementDescriptor elementDescriptor)(Code)
Finds the parent of the given descriptor.
Parameters:
  elementDescriptor - ElementDescriptor ElementDescriptor, not null



getAttributeDescriptor
public AttributeDescriptor getAttributeDescriptor(String name)(Code)
Returns an attribute descriptor with a given name or null.
Parameters:
  name - to search for; will be checked against the attributes' qualified name. AttributeDescriptor with the given name,or null if no descriptor has that name
since:
   0.8



getAttributeDescriptors
public AttributeDescriptor[] getAttributeDescriptors()(Code)
Returns the attribute descriptors for this element descriptors for the attributes of the element that this ElementDescriptor describes



getAttributeList
protected List getAttributeList()(Code)
Lazily creates the mutable List. This nullifies the attributeDescriptors array so that as items are added to the list the Array is ignored until it is explicitly asked for. list of AttributeDescriptors's describing the attributesof the element that this ElementDescriptor describes



getContentDescriptors
public Descriptor[] getContentDescriptors()(Code)
Returns descriptors for the child content of the element this describes. the Descriptor describing the child elementsof the element that this ElementDescriptor describes
since:
   0.5



getContentList
protected List getContentList()(Code)
Lazily creates the mutable List of child content descriptors. This nullifies the contentDescriptors array so that as items are added to the list the Array is ignored until it is explicitly asked for. list of Descriptor's describe the child content of the element that this Descriptor describes
since:
   0.5



getContextExpression
public Expression getContextExpression()(Code)
Returns the expression used to evaluate the new context of this element. the expression used to evaluate the new context of this element



getElementDescriptor
public ElementDescriptor getElementDescriptor(String name)(Code)
Gets a child ElementDescriptor matching the given name if one exists. Note that (so long as there are no better matches), a null name acts as a wildcard. In other words, an ElementDescriptor the first descriptor with a null name will match any name passed in, unless some other matches the name exactly.
Parameters:
  name - the localname to be matched, not null the child ElementDescriptor with the given name if one exists, otherwise null



getElementDescriptors
public ElementDescriptor[] getElementDescriptors()(Code)
Returns descriptors for the child elements of the element this describes. the ElementDescriptor describing the child elementsof the element that this ElementDescriptor describes



getElementList
protected List getElementList()(Code)
Lazily creates the mutable List of child elements. This nullifies the elementDescriptors array so that as items are added to the list the Array is ignored until it is explicitly asked for. list of ElementDescriptor's describe the child elements of the element that this ElementDescriptor describes



getImplementationClass
public Class getImplementationClass()(Code)
Gets the class which should be used for instantiation. the class which should be used for instantiation of beans mapped from this element, null if the standard class should be used



getPrimaryBodyTextDescriptor
public TextDescriptor getPrimaryBodyTextDescriptor()(Code)

Gets the primary descriptor for body text of this element. Betwixt collects all body text for any element together. This makes it rounds tripping difficult for beans that write more than one mixed content property.

The algorithm used in the default implementation is that the first TextDescriptor found amongst the descriptors is returned. the primary descriptor or null if this element has no mixed body content
since:
   0.5




hasAttributes
public boolean hasAttributes()(Code)
Returns true if this element has AttributeDescriptors true if this element has attributes
See Also:   ElementDescriptor.getAttributeDescriptors



hasChildren
public boolean hasChildren()(Code)
Returns true if this element has child ElementDescriptors true if this element has child elements
See Also:   ElementDescriptor.getElementDescriptors



hasContent
public boolean hasContent()(Code)
Returns true if this element has child content. true if this element has either child mixed content or child elements
See Also:   ElementDescriptor.getContentDescriptors
since:
   0.5



isCollective
public boolean isCollective()(Code)
Does this describe a collective?



isHollow
public boolean isHollow()(Code)

Is this decriptor hollow?

A hollow descriptor is one which gives only the class that the subgraph is mapped to rather than describing the entire subgraph. A new XMLBeanInfo should be introspected and that used to describe the subgraph. A hollow descriptor should not have any child descriptors. TODO: consider whether a subclass would be better

true if this is hollow



isPolymorphic
public boolean isPolymorphic()(Code)

Is this a polymorphic element?

A polymorphic element's name is not fixed at introspection time and it's resolution is postponed to bind time.


since:
   0.7 true if ElementDescriptor.getQualifiedName is null, false otherwise



isPrimitiveType
public boolean isPrimitiveType()(Code)
Returns true if this element refers to a primitive type property whether this element refers to a primitive type (or property of a parent object)



isSimple
public boolean isSimple()(Code)

Is this a simple element?

A simple element is one without child elements or attributes. This corresponds to the simple type concept used in XML Schema. TODO: need to consider whether it's sufficient to calculate which are simple types (and so don't get IDs assigned etc).

true if it is a SimpleType element



isUseBindTimeTypeForMapping
public boolean isUseBindTimeTypeForMapping()(Code)

Is the bind time type to be used to determine the mapping?

The mapping for an object property value can either be the introspection time type (based on the logical type of the property) or the bind time type (based on the type of the actual instance).


since:
   0.7 true if the bind time type is to be used to determine the mapping,false if the introspection time type is to be used



isWrapCollectionsInElement
public boolean isWrapCollectionsInElement()(Code)
Returns true if collective bean properties should wrap the items in a parent element. In other words, should the mapping for bean properties which are Collections enclosed the item elements within a parent element. Normally only used when this describes a collection bean property. true if the elements for the items in the collection should be contained in a parent element



removeAttributeDescriptor
public void removeAttributeDescriptor(AttributeDescriptor descriptor)(Code)
Removes an attribute descriptor from this element descriptor.
Parameters:
  descriptor - the AttributeDescriptor to be removed, not null
since:
   0.8



removeElementDescriptor
public void removeElementDescriptor(ElementDescriptor descriptor)(Code)
Removes an element descriptor from this element descriptor.
Parameters:
  descriptor - the ElementDescriptor that will be removed.
since:
   0.8



setAttributeDescriptors
public void setAttributeDescriptors(AttributeDescriptor[] attributeDescriptors)(Code)
Sets the AttributesDescriptors for this element. This sets descriptors for the attributes of the element describe by the ElementDescriptor.
Parameters:
  attributeDescriptors - the AttributeDescriptor describe the attributesof the element described by this ElementDescriptor



setCollective
public void setCollective(boolean isCollectiveType)(Code)
Sets whether the element described is a collective.
since:
   0.7
Parameters:
  isCollectiveType -



setContentDescriptors
public void setContentDescriptors(Descriptor[] contentDescriptors)(Code)
Sets the descriptors for the child content of the element this describes.
Parameters:
  contentDescriptors - the Descriptors of the element that this describes
since:
   0.5



setContextExpression
public void setContextExpression(Expression contextExpression)(Code)
Sets the expression used to evaluate the new context of this element
Parameters:
  contextExpression - the expression used to evaluate the new context of this element



setElementDescriptors
public void setElementDescriptors(ElementDescriptor[] elementDescriptors)(Code)
Sets the descriptors for the child element of the element this describes. Also sets the child content descriptors for this element
Parameters:
  elementDescriptors - the ElementDescriptors of the element that this describes



setHollow
public void setHollow(boolean isHollow)(Code)
Sets whether this descriptor is hollow. A hollow descriptor is one which gives only the class that the subgraph is mapped to rather than describing the entire subgraph. A new XMLBeanInfo should be introspected and that used to describe the subgraph. A hollow descriptor should not have any child descriptors. TODO: consider whether a subclass would be better
Parameters:
  isHollow - true if this is hollow



setImplementationClass
public void setImplementationClass(Class implementationClass)(Code)
Sets the class which should be used for instantiation.
Parameters:
  implementationClass - the class which should be used for instantiationor null to use the mapped type
since:
   0.5



setPrimitiveType
public void setPrimitiveType(boolean primitiveType)(Code)
Sets whether this element refers to a primitive type (or property of a parent object)
Parameters:
  primitiveType - true if this element refers to a primitive type



setUseBindTimeTypeForMapping
public void setUseBindTimeTypeForMapping(boolean useBindTimeTypeForMapping)(Code)

Sets whether the bind time type to be used to determine the mapping. The mapping for an object property value can either be the introspection time type (based on the logical type of the property) or the bind time type (based on the type of the actual instance).

Note: this property is write once, read many. So, the first time that this method is called the value will be set but subsequent calls will be ignored.


since:
   0.7
Parameters:
  useBindTimeTypeForMapping - true if the bind time type is to be used to determine the mapping, false if the introspection time type is to be used



setWrapCollectionsInElement
public void setWrapCollectionsInElement(boolean wrapCollectionsInElement)(Code)
Sets whether Collection bean properties should wrap items in a parent element. In other words, should the mapping for bean properties which are Collections enclosed the item elements within a parent element. Normally only used when this describes a collection bean property.
Parameters:
  wrapCollectionsInElement - true if the elements for the items in the collection should be contained in a parent element



toString
public String toString()(Code)
Returns something useful for logging. a string useful for logging



Methods inherited from org.apache.commons.betwixt.NodeDescriptor
public String getLocalName()(Code)(Java Doc)
public String getQualifiedName()(Code)(Java Doc)
public String getURI()(Code)(Java Doc)
public void setLocalName(String localName)(Code)(Java Doc)
public void setQualifiedName(String qualifiedName)(Code)(Java Doc)
public void setURI(String uri)(Code)(Java Doc)

Methods inherited from org.apache.commons.betwixt.Descriptor
public Options getOptions()(Code)(Java Doc)
public String getPropertyName()(Code)(Java Doc)
public Class getPropertyType()(Code)(Java Doc)
public Class getSingularPropertyType()(Code)(Java Doc)
public Expression getTextExpression()(Code)(Java Doc)
public Updater getUpdater()(Code)(Java Doc)
public void setOptions(Options options)(Code)(Java Doc)
public void setPropertyName(String propertyName)(Code)(Java Doc)
public void setPropertyType(Class propertyType)(Code)(Java Doc)
public void setSingularPropertyType(Class singularPropertyType)(Code)(Java Doc)
public void setTextExpression(Expression textExpression)(Code)(Java Doc)
public void setUpdater(Updater updater)(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.