Public Member Functions | Protected Member Functions | Static Package Functions

org.exolab.castor.builder.binding.XMLBindingComponent Class Reference

Inheritance diagram for org.exolab.castor.builder.binding.XMLBindingComponent:
org.exolab.castor.builder.BindingComponent

List of all members.

Public Member Functions

 XMLBindingComponent (BuilderConfiguration config)
ExtendedBinding getBinding ()
void setBinding (ExtendedBinding binding)
void setView (Annotated annotated)
boolean equals (Object object)
int hashCode ()
Annotated getAnnotated ()
boolean createGroupItem ()
String getSchemaLocation ()
String getTargetNamespace ()
Schema getSchema ()
XMLType getXMLType ()
String getXMLName ()
String getValue ()
String getJavaClassName ()
String getJavaMemberName ()
String getQualifiedName ()
String getJavaPackage ()
int getUpperBound ()
int getLowerBound ()
String getExtends ()
String[] getImplements ()
boolean hasBoundProperties ()
boolean hasEquals ()
boolean isAbstract ()
boolean isFinal ()
boolean isFixed ()
boolean isNillable ()
boolean useWrapper ()
XSType getJavaType ()
String getCollectionType ()
String getValidator ()
String getXMLFieldHandler ()
short getType ()

Protected Member Functions

ComponentBindingType getComponentBinding ()

Static Package Functions

 [static initializer]

Detailed Description

This class is the implementation of BindingComponent from an XML Schema point of view. This specific implementation wraps an XML Schema annotated structure.

The XML Schema structure can be only of four different types:

The three first items can be customized using a binding file. Thus the XMLBindingComponent class takes into account the presence or not of a custom binding document in the computation of the needed information for the Source Generator to generate java classes from an XML Schema.

The customizable items are detailled in the binding file documentation.

This class acts like a window on a particular XML Schema structure that the user controls by changing the view on the Annotated Structure he is interested in.

Todo:
: add the link to the documentation.
See also:
org.exolab.castor.builder.BindingComponent
Author:
Arnaud Blandin
Version:
Revision:
1.10
Date:
2004/11/11 16:00:10

Constructor & Destructor Documentation

org.exolab.castor.builder.binding.XMLBindingComponent.XMLBindingComponent ( BuilderConfiguration  config  ) 

Constructs an XMLBindingComponent from an XML Schema Component.

Parameters:
config the BuilderConfiguration instance (must not be null).

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.getJavaType().


Member Function Documentation

org.exolab.castor.builder.binding.XMLBindingComponent.[static initializer] (  )  [static, package]
boolean org.exolab.castor.builder.binding.XMLBindingComponent.createGroupItem (  ) 

Returns true if the binding of this XMLBindingComponent will require the generation of 2 java classes. Indeed an a nested Model Group that can occur more than once is described by the SourceGenerator with a wrapper class.

Returns:
true if the binding of this XMLBindingComponent will require the generation of 2 java classes.

References org.exolab.castor.xml.schema.Particle.getMaxOccurs(), org.exolab.castor.xml.schema.XMLType.getName(), org.exolab.castor.xml.schema.Structure.getStructureType(), and org.exolab.castor.xml.schema.XMLType.isComplexType().

Referenced by org.exolab.castor.builder.SourceFactory.createSourceCode().

boolean org.exolab.castor.builder.binding.XMLBindingComponent.equals ( Object  object  ) 

Returns true if the given Object is equal to this instance of XMLBindingComponent.

Returns:
true if the given Object is equal to this instance of XMLBindingComponent.
See also:
java.lang.Object.equals(java.lang.Object)

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.binding.XMLBindingComponent.getAnnotated(), and org.exolab.castor.builder.binding.XMLBindingComponent.getComponentBinding().

Annotated org.exolab.castor.builder.binding.XMLBindingComponent.getAnnotated (  ) 
ExtendedBinding org.exolab.castor.builder.binding.XMLBindingComponent.getBinding (  ) 
String org.exolab.castor.builder.binding.XMLBindingComponent.getCollectionType (  ) 

Returns the collection name specified in the binding file. If no collection was specified, null will be returned and the default collection settings will be used.

Returns:
a string that represents the collection name specified in the binding file. If no collection was specified, null will be returned and the default collection settings will be used.

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.binding.FieldType.getCollection(), org.exolab.castor.builder.BindingComponent.MEMBER, and org.exolab.castor.builder.binding.types.FieldTypeCollectionType.toString().

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

ComponentBindingType org.exolab.castor.builder.binding.XMLBindingComponent.getComponentBinding (  )  [protected]

Returns the ComponentBinding used in that XMLBindingComponent to retrieve customized information.

Returns:
the ComponentBinding used in that XMLBinding.

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.equals().

String org.exolab.castor.builder.binding.XMLBindingComponent.getExtends (  ) 

Returns the name of a super class for the current XMLBinding. Null is returned if this XMLBinding is not meant to be mapped to a java class.

Returns:
the name of a super class for the current XMLBinding. Null is returned if this XMLBinding is not meant to be mapped to a java class

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.BindingComponent.CLASS, org.exolab.castor.builder.binding.ClassType.getExtends(), org.exolab.castor.builder.BuilderConfiguration.getProperty(), and org.exolab.castor.builder.binding.XMLBindingComponent.getType().

Referenced by org.exolab.castor.builder.SourceFactory.createSourceCode().

String [] org.exolab.castor.builder.binding.XMLBindingComponent.getImplements (  ) 

Returns an array of the different interface names implemented by the class that will represent the current XMLBindingComponent. Null is returned if no class binding is defined for the wrapped XML Schema structure.

Returns:

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.BindingComponent.CLASS, org.exolab.castor.builder.binding.ClassType.getImplements(), and org.exolab.castor.builder.binding.XMLBindingComponent.getType().

Referenced by org.exolab.castor.builder.SourceFactory.createSourceCode().

String org.exolab.castor.builder.binding.XMLBindingComponent.getJavaMemberName (  ) 

Returns a valid Java Member Name corresponding to this XMLBindingComponent. This name is not qualified, this is only a local Java Member name.

Returns:
a valid Java Member Name corresponding to this XMLBindingComponent. This name is not qualified, this is only a local Java member name.
See also:
getQualifiedName

Todo:
ADD A SWITCH TO DETERMINE WETHER OR NOT TO USE JAVA CONVENTIONS FOR THE JAVA CLASS NAME (SEE JAXB)

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.BindingComponent.CLASS, org.exolab.castor.builder.GroupNaming.createClassName(), org.exolab.castor.xml.schema.ContentModelGroup.enumerate(), org.exolab.castor.builder.binding.FieldType.getName(), org.exolab.castor.builder.binding.Interface.getName(), org.exolab.castor.builder.binding.ClassType.getName(), org.exolab.castor.xml.schema.ElementDecl.getParent(), org.exolab.castor.xml.schema.ElementDecl.getReference(), org.exolab.castor.xml.schema.AttributeDecl.getReference(), org.exolab.castor.xml.schema.ElementDecl.getReferenceName(), org.exolab.castor.xml.schema.Structure.getStructureType(), org.exolab.castor.builder.binding.XMLBindingComponent.getType(), org.exolab.castor.builder.binding.XMLBindingComponent.getXMLName(), org.exolab.castor.builder.BindingComponent.INTERFACE, org.exolab.castor.xml.schema.ElementDecl.isReference(), org.exolab.castor.xml.schema.AttributeDecl.isReference(), org.exolab.castor.builder.BindingComponent.MEMBER, and org.exolab.castor.builder.binding.XMLBindingComponent.setView().

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

String org.exolab.castor.builder.binding.XMLBindingComponent.getJavaPackage (  ) 

Returns the java package associated with this XML BindingComponent. The algorithm used to resolve the package is defined according to the following priorities:

  1. The package defined locally in the class declaration inside the binding file is used.
  2. If no package has been defined locally then a lookup to a defined mapping {targetNamespace, package name} is performed.
  3. If no package has been defined locally then a lookup to a defined mapping {schema location, package name} is performed.
Returns:
the java package associated with this XML BindingComponent.

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.BindingComponent.CLASS, org.exolab.castor.builder.binding.ClassType.getPackage(), org.exolab.castor.builder.binding.XMLBindingComponent.getSchemaLocation(), org.exolab.castor.builder.binding.XMLBindingComponent.getTargetNamespace(), org.exolab.castor.builder.binding.XMLBindingComponent.getType(), org.exolab.castor.builder.BuilderConfiguration.lookupPackageByLocation(), and org.exolab.castor.builder.BuilderConfiguration.lookupPackageByNamespace().

Referenced by org.exolab.castor.builder.SourceFactory.createSourceCode(), org.exolab.castor.builder.binding.XMLBindingComponent.getJavaType(), and org.exolab.castor.builder.binding.XMLBindingComponent.getQualifiedName().

XSType org.exolab.castor.builder.binding.XMLBindingComponent.getJavaType (  ) 
int org.exolab.castor.builder.binding.XMLBindingComponent.getLowerBound (  ) 

Returns the lower bound of the collection that is generated from this BindingComponent. The lower bound is a positive integer. In the case of an XML Schema component, it corresponds to the XML Schema minOccurs attribute, if any.

Returns:
an int representing the lower bound of the collection generated from this BindingComponent. 0 is returned by default.

Implements org.exolab.castor.builder.BindingComponent.

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

String org.exolab.castor.builder.binding.XMLBindingComponent.getQualifiedName (  ) 

Returns the fully qualified name used for generating a java name that represents this XMLBindingComponent.

The fully qualified name is computed according the following priority order:

  • If the XMLBinding wraps a class binding then the package name is the name defined locally in the <java-class> element. More precisely the package name will be the value of the attribute package.
  • Else the package name will be computed from the schemaLocation of the parent schema.
  • Else the package name will be computed from the target namespace of the parent schema.

Note: the computation of the namespace is a direct look-up for a defined mapping (Namespace, package) or (schema location, package).

Returns:
the fully qualified name used for generating a java name that represents this XMLBindingComponent.

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.binding.XMLBindingComponent.getJavaClassName(), and org.exolab.castor.builder.binding.XMLBindingComponent.getJavaPackage().

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo(), and org.exolab.castor.builder.SourceFactory.createSourceCode().

String org.exolab.castor.builder.binding.XMLBindingComponent.getSchemaLocation (  ) 

Returns the schemaLocation of the parent schema of the wrapped structure.

Returns:
the schemaLocation of the parent schema of the wrapped structure.

References org.exolab.castor.builder.binding.XMLBindingComponent.getSchema(), and org.exolab.castor.xml.schema.Schema.getSchemaLocation().

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.getJavaPackage().

short org.exolab.castor.builder.binding.XMLBindingComponent.getType (  ) 

Returns the type of this component binding. A component binding can be of three different types:

  • Interface: it represents the binding to a java interface.
  • Class: it represents the binding to a java class.
  • Member: it represents the binding to a java class member.

-1 is returned if the component binding is null.

Returns:
the type of this component binding. A component binding can be of three different types:
  • Interface: it represents the binding to a java interface.
  • Class: it represents the binding to a java class.
  • Member: it represents the binding to a java class member.
-1 is returned if the component binding is null.

Implements org.exolab.castor.builder.BindingComponent.

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.getExtends(), org.exolab.castor.builder.binding.XMLBindingComponent.getImplements(), org.exolab.castor.builder.binding.XMLBindingComponent.getJavaClassName(), org.exolab.castor.builder.binding.XMLBindingComponent.getJavaMemberName(), org.exolab.castor.builder.binding.XMLBindingComponent.getJavaPackage(), org.exolab.castor.builder.binding.XMLBindingComponent.hasBoundProperties(), org.exolab.castor.builder.binding.XMLBindingComponent.hasEquals(), org.exolab.castor.builder.binding.XMLBindingComponent.isAbstract(), and org.exolab.castor.builder.binding.XMLBindingComponent.isFinal().

int org.exolab.castor.builder.binding.XMLBindingComponent.getUpperBound (  ) 

Returns the upper bound of the collection that is generated from this BindingComponent. The upper bound is a positive integer. -1 is returned to indicate that the upper bound is unbounded.

In the case of an XML Schema component, the upper bound corresponds to the XML Schema maxOccurs attribute, if any.

Returns:
an int representing the lower bound of the collection generated from this BindingComponent. -1 is returned to indicate that the upper bound is unbounded. 1 is the default value.

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.xml.schema.Structure.getStructureType().

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

String org.exolab.castor.builder.binding.XMLBindingComponent.getValidator (  ) 

Returns the fully qualified name of the Validator to use.

Returns:
the fully qualified name of the Validator to use.

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.binding.FieldType.getValidator(), and org.exolab.castor.builder.BindingComponent.MEMBER.

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

String org.exolab.castor.builder.binding.XMLBindingComponent.getValue (  ) 

Returns the value specified in the XML Schema for the XML Schema component wrapped in this XMLBindingComponent. The value returned is the default or fixed value for an Element or an Attribute.

Returns:
the value specified in the XML Schema for the XML Schema annotated structure wrapped in this XMLBindingComponent.

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.xml.schema.Structure.getStructureType().

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

String org.exolab.castor.builder.binding.XMLBindingComponent.getXMLFieldHandler (  ) 

Returns the fully qualified name of the XMLFieldHandler to use.

Returns:
the fully qualified name of the XMLFieldHandler to use.

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.binding.FieldType.getHandler(), and org.exolab.castor.builder.BindingComponent.MEMBER.

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

String org.exolab.castor.builder.binding.XMLBindingComponent.getXMLName (  ) 
XMLType org.exolab.castor.builder.binding.XMLBindingComponent.getXMLType (  ) 

Returns the XMLType of the underlying structure. The XMLType of an element being its XML Schema type, the XMLType of a ComplexType being itself and the XMLType of an attribute being its XML Schema simpleType. Null is returned for a Model Group.

Returns:
the XMLType of the underlying structure.

References org.exolab.castor.xml.schema.Structure.ATTRIBUTE, org.exolab.castor.xml.schema.Structure.COMPLEX_TYPE, org.exolab.castor.xml.schema.Structure.ELEMENT, org.exolab.castor.xml.schema.Structure.getStructureType(), org.exolab.castor.xml.schema.XMLType.getType(), and org.exolab.castor.xml.schema.Structure.MODELGROUP.

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo(), org.exolab.castor.builder.SourceFactory.createSourceCode(), and org.exolab.castor.builder.binding.XMLBindingComponent.getJavaType().

boolean org.exolab.castor.builder.binding.XMLBindingComponent.hasBoundProperties (  ) 
boolean org.exolab.castor.builder.binding.XMLBindingComponent.hasEquals (  ) 
int org.exolab.castor.builder.binding.XMLBindingComponent.hashCode (  ) 

Returns the hashCode value for this object.

Returns:
the hashcode value for this object.
See also:
java.lang.hashCode()

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.binding.ComponentBindingType.getName().

boolean org.exolab.castor.builder.binding.XMLBindingComponent.isFinal (  ) 
boolean org.exolab.castor.builder.binding.XMLBindingComponent.isFixed (  ) 

Returns true if the wrapped XML Schema component is fixed (i.e the value used is fixed).

Returns:
true if the wrapped XML Schema component is fixed (i.e the value used is fixed).

References org.exolab.castor.xml.schema.Structure.getStructureType().

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

boolean org.exolab.castor.builder.binding.XMLBindingComponent.isNillable (  ) 

Returns true if the wrapped XML Schema component is nillable.

Returns:
true if the wrapped XML Schema component is nillable.

References org.exolab.castor.xml.schema.Structure.getStructureType().

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

void org.exolab.castor.builder.binding.XMLBindingComponent.setBinding ( ExtendedBinding  binding  ) 

Sets the Binding Object Model on which this XMLBindingComponent will query information.

Parameters:
binding the Extended Binding Object Model that wraps the information located in a binding file

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo(), org.exolab.castor.builder.SourceFactory.createSourceCode(), org.exolab.castor.builder.binding.XMLBindingComponent.getJavaType(), and org.exolab.castor.builder.SourceGenerator.setBinding().

void org.exolab.castor.builder.binding.XMLBindingComponent.setView ( Annotated  annotated  ) 

Sets the window on the given Annotated XML Schema structure. Once the window is set on a particular XML Schema structure all the information returned by this class are relative to that XML Schema structure.

Parameters:
annotated an Annotated XML Schema structure.
See also:
org.exolab.castor.xml.schema.Annotated

References org.exolab.castor.builder.BindingComponent.CLASS, org.exolab.castor.builder.binding.NamingXMLType.getComplexTypeName(), org.exolab.castor.builder.binding.ExtendedBinding.getComponentBindingType(), org.exolab.castor.builder.binding.ComponentBindingType.getComponentBindingTypeChoice(), org.exolab.castor.builder.binding.NamingXMLType.getElementName(), org.exolab.castor.builder.binding.ComponentBindingTypeChoice.getInterface(), org.exolab.castor.builder.binding.ComponentBindingTypeChoice.getJavaClass(), org.exolab.castor.builder.binding.ComponentBindingTypeChoice.getMember(), org.exolab.castor.builder.binding.NamingXMLType.getModelGroupName(), org.exolab.castor.builder.binding.Binding.getNamingXML(), org.exolab.castor.builder.binding.NamingType.getPrefix(), org.exolab.castor.xml.schema.Structure.getStructureType(), org.exolab.castor.builder.binding.NamingType.getSuffix(), org.exolab.castor.builder.BindingComponent.INTERFACE, and org.exolab.castor.builder.BindingComponent.MEMBER.

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo(), org.exolab.castor.builder.SourceFactory.createSourceCode(), org.exolab.castor.builder.binding.XMLBindingComponent.getJavaClassName(), org.exolab.castor.builder.binding.XMLBindingComponent.getJavaMemberName(), and org.exolab.castor.builder.binding.XMLBindingComponent.getJavaType().

boolean org.exolab.castor.builder.binding.XMLBindingComponent.useWrapper (  ) 

Returns true if the member represented by that XMLBindingComponent is to be represented by an Object wrapper. For instance an int will be represented by a java Integer if the property is set to true.

Returns:
true if the member represented by that XMLBindingComponent is to be represented by an Object wrapper.

Implements org.exolab.castor.builder.BindingComponent.

References org.exolab.castor.builder.binding.FieldType.getWrapper(), org.exolab.castor.builder.binding.FieldType.hasWrapper(), and org.exolab.castor.builder.BuilderConfiguration.usePrimitiveWrapper().

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.getJavaType().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties