Public Member Functions | Static Public Member Functions | Static Protected Attributes

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

Inheritance diagram for org.exolab.castor.builder.binding.ExtendedBinding:
org.exolab.castor.builder.binding.Binding

List of all members.

Public Member Functions

 ExtendedBinding ()
ComponentBindingType getComponentBindingType (Annotated annotated)

Static Public Member Functions

static String getSchemaLocation (Structure structure)

Static Protected Attributes

static final String PATH_SEPARATOR = "/"
static final String ATTRIBUTE_PREFIX = "@"
static final String COMPLEXTYPE_ID = "complexType:"
static final String GROUP_ID = "group:"

Detailed Description

This class adds the necessary logic to a Binding Object to bring the gap between the XML Schema Object Model and the Binding File. It queries the Binding Object to retrieve the the associated ComponentBinding.

An "XPath like" representation of an XML Schema structure is built to lookup the component bindings in their storage structure. The algorithm used to build the "XPath like" representation is summarized in the following example: Given the XML schema declaration: <blockquote>

        <xsd:element name="foo">
            <xsd:complextype>
                <xsd:attribute name="bar" type="xsd:string"/>
            </xsd:complextype>
        </xsd:element>>
    

</blockquote> The path to identify the attribute 'bar' will be: <blockquote>

        /foo/
    

</blockquote> The keywords complexType and group are used to identify respectively an XML Schema ComplexType and a Model Group definition.

Author:
Arnaud Blandin
Version:
Revision:
1.3
Date:
2004/10/06 08:50:45

Constructor & Destructor Documentation

org.exolab.castor.builder.binding.ExtendedBinding.ExtendedBinding (  ) 

Default constructor.

See also:
java.lang.Object.Object()

Member Function Documentation

ComponentBindingType org.exolab.castor.builder.binding.ExtendedBinding.getComponentBindingType ( Annotated  annotated  ) 

Returns the ComponentBinding that corresponds to the given Annotated XML Schema structure An Schema location will be built for the given Annotated XML schema structure.

Parameters:
annotated the XML Schema annotated structure for which to query the Binding object for a ComponentBinding.
Returns:
the ComponentBinding that corresponds to the given Annotated XML Schema structure.

References org.exolab.castor.xml.schema.Structure.ATTRIBUTE, org.exolab.castor.xml.schema.AttributeDecl.getReference(), org.exolab.castor.xml.schema.ElementDecl.getReference(), org.exolab.castor.builder.binding.ExtendedBinding.getSchemaLocation(), org.exolab.castor.xml.schema.Structure.getStructureType(), org.exolab.castor.xml.schema.AttributeDecl.isReference(), and org.exolab.castor.xml.schema.ElementDecl.isReference().

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

static String org.exolab.castor.builder.binding.ExtendedBinding.getSchemaLocation ( Structure  structure  )  [static]

Returns a string representation of an XML Schema Component. This representation is directly adapted from XPath and will used as a key to store the component bindings.

The location of a structure is composed of two parts:

  1. the location of the parent structure
  2. the local location of the structure itself

The local location is defined by:

  • If the structure is an Element: the location is the XPath representation "/element_name"
  • If the structure is an Attribute: the location is the XPath representation "/@attribute_name"
  • If the structure is a ComplexType: the location is "complexType:complexType_name"
  • If the structure is a ModelGroup: the location is "group:group_name"

Note that only top-level groups and complexTypes are named and thus will

Parameters:
structure the structure for which to return a representation.

Referenced by org.exolab.castor.builder.binding.ExtendedBinding.getComponentBindingType().


Member Data Documentation

final String org.exolab.castor.builder.binding.ExtendedBinding.COMPLEXTYPE_ID = "complexType:" [static, protected]
final String org.exolab.castor.builder.binding.ExtendedBinding.GROUP_ID = "group:" [static, protected]

Constants needed to create the XPath


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