org.jbind.xml.schema.element
Class SchemaElement

java.lang.Object
  extended byorg.jbind.xml.schema.element.Parent
      extended byorg.jbind.xml.schema.element.Element
          extended byorg.jbind.xml.schema.element.OpenAttributes
              extended byorg.jbind.xml.schema.element.SchemaElement
All Implemented Interfaces:
IElement, IHasBindingAttributes, IHasLocation, IJobHelper, INode, IOpenAttributes, IParent, ISchemaElement, ISchemaJobHelper, ISourceInfo, IXmlElement, IXmlNode

public class SchemaElement
extends OpenAttributes
implements ISchemaElement, IOpenAttributes


Constructor Summary
SchemaElement(CreationParams aCreationParams, ISchemaElement aParentSchemaElement)
           
 
Method Summary
 boolean addElementId(java.lang.String anId)
          Adds the id of a schema element.
 void createJobs(IHasTopLevelJobs aSchemaJob)
           
protected  IAttribute doCreateAttribute(ACParams anACParams)
          Hook method to create an attribute.
 IElement doCreateChild(CreationParams aCreationParams)
          Hook method to create a child element.
 FormType getAttributeFormDefault()
           
 IAttribute getBindingAttribute(java.lang.String aName)
          Gets the specified binding attribute.
 java.util.Set getDefaultBlockTypes()
           
 java.util.Set getDefaultFinalTypes()
           
 FormType getElementFormDefault()
           
 ISchema getSchema()
           
 java.lang.String getTargetNamespace()
          Gets the target namespace.
 ITopLevelElement getTopLevelElement(IRef aGlobalRef)
          Gets a top level element.
 boolean isChameleon()
          Indicates if the schema element is a chameleon.
 java.util.Iterator iterAdditionalSources()
           
 java.util.Iterator iterTopLevelComponents()
           
 ITopLevelElement removeTopLevelElement(IRef aRef)
          Removed a top level element.
 void setSchema(ISchema aSchema)
           
 ITopLevelElement setTopLevelElement(ITopLevelElement aTopLevelElement)
          Sets a top level element.
 void validateElement(IElemValHelper aHelper, IConstraintViolations aViolations)
           
 
Methods inherited from class org.jbind.xml.schema.element.OpenAttributes
getAttributeString
 
Methods inherited from class org.jbind.xml.schema.element.Element
acceptAppInfoVisitor, addAttribute, createChild, createGlobalRef, getAnnotation, getAttributes, getBoolean, getChildByClass, getDefaultedLocalBindingAttribute, getDefaultedLocalStringBindingAttribute, getLocalBindingAttribute, getLocalName, getLocalStringBindingAttribute, getLocation, getNamespace, getNamespaceUri, getParent_, getParentHelper, getPrefix, getPrefixToNamespaceMapping, getQName, getSchemaDocument, getSchemaElement, getStringBindingAttribute, getSubElement, isTopLevelComponent, iterChildrenByClass, setLocation, setParent_, toString
 
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.instantiation.ISchemaElement
getStringBindingAttribute
 
Methods inherited from interface org.jbind.xml.base.IHasBindingAttributes
getDefaultedLocalBindingAttribute, getDefaultedLocalStringBindingAttribute, getLocalBindingAttribute, getLocalStringBindingAttribute
 
Methods inherited from interface org.jbind.xml.base.IHasLocation
getLocation
 
Methods inherited from interface org.jbind.xml.schema.element.IOpenAttributes
getAttributeString
 
Methods inherited from interface org.jbind.xml.schema.element.IElement
addAttribute, createChild, getQName, getSchemaDocument, getSubElement, isTopLevelComponent, iterChildrenByClass
 
Methods inherited from interface org.jbind.xml.schema.element.IParent
addChild, hasChildren, iterChildren
 
Methods inherited from interface org.jbind.xml.schema.element.INode
getParent_, setLocation, setParent_
 
Methods inherited from interface org.jbind.xml.core.cmp.IXmlNode
acceptAppInfoVisitor
 
Methods inherited from interface org.jbind.xml.core.cmp.ISourceInfo
getAnnotation, getPrefixToNamespaceMapping
 
Methods inherited from interface org.jbind.xml.core.cmp.IXmlElement
getAttributes, iterXmlNodes
 

Constructor Detail

SchemaElement

public SchemaElement(CreationParams aCreationParams,
                     ISchemaElement aParentSchemaElement)
Method Detail

iterTopLevelComponents

public java.util.Iterator iterTopLevelComponents()

removeTopLevelElement

public ITopLevelElement removeTopLevelElement(IRef aRef)
Description copied from interface: ISchemaElement
Removed a top level element.

Specified by:
removeTopLevelElement in interface ISchemaElement
Parameters:
aRef - (required).
Returns:
(optional). The removed element.

iterAdditionalSources

public java.util.Iterator iterAdditionalSources()

doCreateChild

public IElement doCreateChild(CreationParams aCreationParams)
                       throws XmlException
Description copied from class: Element
Hook method to create a child element.

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

doCreateAttribute

protected IAttribute doCreateAttribute(ACParams anACParams)
                                throws XmlException
Description copied from class: Element
Hook method to create an attribute.

Overrides:
doCreateAttribute in class OpenAttributes
Throws:
XmlException

getDefaultBlockTypes

public java.util.Set getDefaultBlockTypes()

getDefaultFinalTypes

public java.util.Set getDefaultFinalTypes()

getAttributeFormDefault

public FormType getAttributeFormDefault()

getElementFormDefault

public FormType getElementFormDefault()

getTopLevelElement

public ITopLevelElement getTopLevelElement(IRef aGlobalRef)
Description copied from interface: ISchemaElement
Gets a top level element.

Specified by:
getTopLevelElement in interface ISchemaElement
Parameters:
aGlobalRef - (required).
Returns:
(optional).

setTopLevelElement

public ITopLevelElement setTopLevelElement(ITopLevelElement aTopLevelElement)
Description copied from interface: ISchemaElement
Sets a top level element.

Specified by:
setTopLevelElement in interface ISchemaElement
Returns:
(optional). Returns any previously set top level element.

validateElement

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

createJobs

public void createJobs(IHasTopLevelJobs aSchemaJob)
Specified by:
createJobs in interface ISchemaElement

isChameleon

public boolean isChameleon()
Description copied from interface: ISchemaElement
Indicates if the schema element is a chameleon. A chameleon schema element has no target namespace of its own. It gets its target namespace when it is included or redefined by another schema element.

Specified by:
isChameleon in interface ISchemaElement

getTargetNamespace

public java.lang.String getTargetNamespace()
Description copied from interface: ISchemaElement
Gets the target namespace. A schema element that is included or redefined by another schema element returns the target namespace of the other schema element. A schema element that has no target namespace return the constant INamespaces.NO.

Specified by:
getTargetNamespace in interface ISchemaElement
Overrides:
getTargetNamespace in class Element

getSchema

public ISchema getSchema()
Specified by:
getSchema in interface ISchemaElement
Overrides:
getSchema in class Element

setSchema

public void setSchema(ISchema aSchema)
Specified by:
setSchema in interface ISchemaElement

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
Overrides:
getBindingAttribute in class Element

addElementId

public boolean addElementId(java.lang.String anId)
Description copied from interface: ISchemaElement
Adds the id of a schema element.

Specified by:
addElementId in interface ISchemaElement
Parameters:
anId - (required).
Returns:
Returns true iff the id was not already added, i.e. the id is unique so far.