org.exolab.castor.builder.binding
Class ExtendedBinding
- java.io.Serializable
public class ExtendedBinding
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:
<xsd:element name="foo">
<xsd:complextype>
<xsd:attribute name="bar" type="xsd:string"/>
</xsd:complextype>
</xsd:element>
The path to identify the attribute 'bar' will be:
/foo/@bar
The keywords
complexType and
group are used to identify
respectively an XML Schema ComplexType and a Model Group
definition.
$Revision: 6302 $ $Date: 2005-03-05 06:42:06 -0700 (Sat, 05 Mar 2005) $
addAttributeBinding , addAttributeBinding , addComplexTypeBinding , addComplexTypeBinding , addElementBinding , addElementBinding , addGroupBinding , addGroupBinding , addInclude , addInclude , addPackage , addPackage , enumerateAttributeBinding , enumerateComplexTypeBinding , enumerateElementBinding , enumerateGroupBinding , enumerateInclude , enumeratePackage , getAttributeBinding , getAttributeBinding , getAttributeBindingCount , getComplexTypeBinding , getComplexTypeBinding , getComplexTypeBindingCount , getDefaultBindingType , getElementBinding , getElementBinding , getElementBindingCount , getGroupBinding , getGroupBinding , getGroupBindingCount , getInclude , getInclude , getIncludeCount , getNamingXML , getPackage , getPackage , getPackageCount , isValid , marshal , marshal , removeAllAttributeBinding , removeAllComplexTypeBinding , removeAllElementBinding , removeAllGroupBinding , removeAllInclude , removeAllPackage , removeAttributeBinding , removeComplexTypeBinding , removeElementBinding , removeGroupBinding , removeInclude , removePackage , setAttributeBinding , setAttributeBinding , setComplexTypeBinding , setComplexTypeBinding , setDefaultBindingType , setElementBinding , setElementBinding , setGroupBinding , setGroupBinding , setInclude , setInclude , setNamingXML , setPackage , setPackage , unmarshalBinding , validate |
ATTRIBUTE_PREFIX
protected static final String ATTRIBUTE_PREFIX
COMPLEXTYPE_ID
protected static final String COMPLEXTYPE_ID
GROUP_ID
protected static final String GROUP_ID
PATH_SEPARATOR
protected static final String PATH_SEPARATOR
Constants needed to create the XPath
ExtendedBinding
public ExtendedBinding()
Default constructor.
java.lang.Object.Object()
getComponentBindingType
public ComponentBindingType 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.
annotated
- the XML Schema annotated structure for which to query the
Binding object for a ComponentBinding.
- the ComponentBinding that corresponds to the given Annotated XML
Schema structure.
getSchemaLocation
public static String getSchemaLocation(Structure structure)
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:
- the location of the parent structure
- 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
structure
- the structure for which to return a representation.
- a string representation of an XML Schema Component.
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com