org.jbind.xml.schema.element
Class Element

java.lang.Object
  extended byorg.jbind.xml.schema.element.Parent
      extended byorg.jbind.xml.schema.element.Element
All Implemented Interfaces:
IElement, IHasBindingAttributes, IHasLocation, INode, IParent, ISourceInfo, IXmlElement, IXmlNode
Direct Known Subclasses:
AppInfoElement, DocumentationElement, GenericSchemaElement, OpenAttributes, XPathConstraintElement

public abstract class Element
extends Parent
implements IElement


Constructor Summary
Element(CreationParams aCreationParams)
           
 
Method Summary
 void acceptAppInfoVisitor(IAppInfoVisitor aVisitor)
           
 void addAttribute(ACParams anACParams)
           
 IElement createChild(CreationParams aCreationParams, IConstraintViolations aViolations)
           
protected  IRef createGlobalRef(IQName aQName, ISymbolspace aSymbolSpace)
           
protected  IAttribute doCreateAttribute(ACParams anACParams)
          Hook method to create an attribute.
protected  IElement doCreateChild(CreationParams aCreationParams)
          Hook method to create a child element.
 IAnnotation getAnnotation()
           
 IAttributes getAttributes()
           
 IAttribute getBindingAttribute(java.lang.String aName)
          Gets the specified binding attribute.
protected  java.lang.Boolean getBoolean(java.lang.String anAttributeName)
           
 IElement getChildByClass(java.lang.Class aClass, java.lang.Object aMessage, IConstraintViolations aViolations)
           
 IAttribute getDefaultedLocalBindingAttribute(java.lang.String aName)
          Gets a local binding attribute.
 java.lang.String getDefaultedLocalStringBindingAttribute(java.lang.String aName)
          Gets a string valued defaulted local binding attribute.
 IAttribute getLocalBindingAttribute(java.lang.String aName)
          Gets a local binding attribute.
 java.lang.String getLocalName()
           
 java.lang.String getLocalStringBindingAttribute(java.lang.String aName)
          Gets a string valued local binding attribute.
 ILocation getLocation()
           
protected  java.lang.String getNamespace(java.lang.String aPrefix)
           
 java.lang.String getNamespaceUri()
           
 IElement getParent_()
           
 IComponentJobHelper getParentHelper()
           
 java.lang.String getPrefix()
           
 java.util.Map getPrefixToNamespaceMapping()
           
 IQName getQName()
           
 ISchema getSchema()
           
 ISchemaDocument getSchemaDocument()
           
protected  SchemaElement getSchemaElement()
           
 java.lang.String getStringBindingAttribute(java.lang.String aName)
          Gets a string valued binding attribute.
 IElement getSubElement(java.lang.Class aClass, java.lang.Object aMessage, IConstraintViolations aViolations)
           
protected  java.lang.String getTargetNamespace()
           
 boolean isTopLevelComponent()
           
 java.util.Iterator iterChildrenByClass(java.lang.Class aClass)
           
 void setLocation(ILocation aLocation)
           
 void setParent_(IElement anElement)
           
 java.lang.String toString()
           
 void validateElement(IElemValHelper aHelper, IConstraintViolations aViolations)
           
 
Methods inherited from class org.jbind.xml.schema.element.Parent
addChild, hasChildren, iterChildren, iterXmlNodes, visitChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jbind.xml.schema.element.IParent
addChild, hasChildren, iterChildren
 
Methods inherited from interface org.jbind.xml.core.cmp.IXmlElement
iterXmlNodes
 

Constructor Detail

Element

public Element(CreationParams aCreationParams)
Method Detail

isTopLevelComponent

public boolean isTopLevelComponent()
Specified by:
isTopLevelComponent in interface IElement

getSchemaDocument

public ISchemaDocument getSchemaDocument()
Specified by:
getSchemaDocument in interface IElement

createChild

public final IElement createChild(CreationParams aCreationParams,
                                  IConstraintViolations aViolations)
                           throws XmlException
Specified by:
createChild in interface IElement
Returns:
(required).
Throws:
XmlException

addAttribute

public final void addAttribute(ACParams anACParams)
                        throws XmlException
Specified by:
addAttribute in interface IElement
Throws:
XmlException

doCreateAttribute

protected IAttribute doCreateAttribute(ACParams anACParams)
                                throws XmlException
Hook method to create an attribute.

Parameters:
anACParams - (required).
Returns:
(optional). The created attribute.
Throws:
XmlException - Thrown if the creation was not successful.

doCreateChild

protected IElement doCreateChild(CreationParams aCreationParams)
                          throws XmlException
Hook method to create a child element.

Parameters:
aCreationParams - (required).
Returns:
(optional). The created element.
Throws:
XmlException - Raised if the creation was not successful.

validateElement

public void validateElement(IElemValHelper aHelper,
                            IConstraintViolations aViolations)
Specified by:
validateElement in interface IElement

getSchemaElement

protected SchemaElement getSchemaElement()

getTargetNamespace

protected java.lang.String getTargetNamespace()

getBoolean

protected java.lang.Boolean getBoolean(java.lang.String anAttributeName)

createGlobalRef

protected IRef createGlobalRef(IQName aQName,
                               ISymbolspace aSymbolSpace)

getSubElement

public IElement getSubElement(java.lang.Class aClass,
                              java.lang.Object aMessage,
                              IConstraintViolations aViolations)
Specified by:
getSubElement in interface IElement

iterChildrenByClass

public java.util.Iterator iterChildrenByClass(java.lang.Class aClass)
Specified by:
iterChildrenByClass in interface IElement

getChildByClass

public IElement getChildByClass(java.lang.Class aClass,
                                java.lang.Object aMessage,
                                IConstraintViolations aViolations)

getSchema

public ISchema getSchema()
Specified by:
getSchema in interface IElement

getStringBindingAttribute

public java.lang.String getStringBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a string valued binding attribute.

Specified by:
getStringBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required).
Returns:
(optional).

getBindingAttribute

public IAttribute getBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets the specified binding attribute. The attribute may be searched in different contexts (for example a schema component may asked its ancestor component and its schema for the specified attribute. The the first occurence is returned.

Specified by:
getBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required)
Returns:
(optional).

getLocalStringBindingAttribute

public java.lang.String getLocalStringBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a string valued local binding attribute.

Specified by:
getLocalStringBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required).
Returns:
(optional).

getLocalBindingAttribute

public IAttribute getLocalBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a local binding attribute.

Specified by:
getLocalBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required)
Returns:
(optional).

getDefaultedLocalStringBindingAttribute

public java.lang.String getDefaultedLocalStringBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a string valued defaulted local binding attribute.

Specified by:
getDefaultedLocalStringBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required).
Returns:
(optional).

getDefaultedLocalBindingAttribute

public IAttribute getDefaultedLocalBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a local binding attribute. If the binding attribute is not specified locally then a default value is looked for. Default values can be specified on schema elements. If a schema is included by another schema then the default values of the parent schema are considered too.

Specified by:
getDefaultedLocalBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required)
Returns:
(optional).

getParentHelper

public IComponentJobHelper getParentHelper()

getParent_

public IElement getParent_()
Specified by:
getParent_ in interface INode

setParent_

public void setParent_(IElement anElement)
Specified by:
setParent_ in interface INode

getNamespaceUri

public java.lang.String getNamespaceUri()

getPrefix

public java.lang.String getPrefix()

getLocalName

public java.lang.String getLocalName()

getQName

public IQName getQName()
Specified by:
getQName in interface IElement

getAttributes

public IAttributes getAttributes()
Specified by:
getAttributes in interface IXmlElement

getLocation

public ILocation getLocation()
Specified by:
getLocation in interface IHasLocation

setLocation

public void setLocation(ILocation aLocation)
Specified by:
setLocation in interface INode

getNamespace

protected java.lang.String getNamespace(java.lang.String aPrefix)

getPrefixToNamespaceMapping

public java.util.Map getPrefixToNamespaceMapping()
Specified by:
getPrefixToNamespaceMapping in interface ISourceInfo

toString

public java.lang.String toString()

getAnnotation

public IAnnotation getAnnotation()
Specified by:
getAnnotation in interface ISourceInfo

acceptAppInfoVisitor

public void acceptAppInfoVisitor(IAppInfoVisitor aVisitor)
Specified by:
acceptAppInfoVisitor in interface IXmlNode