org.jbind.xml.schema.cmp
Class ElemRef

java.lang.Object
  extended byorg.jbind.xml.schema.cmp.Component
      extended byorg.jbind.xml.schema.cmp.Content
          extended byorg.jbind.xml.schema.cmp.ElemDesc
              extended byorg.jbind.xml.schema.cmp.ElemRefOrDecl
                  extended byorg.jbind.xml.schema.cmp.ElemRef
All Implemented Interfaces:
IComponent, IContentDesc, IDataDesc, IDataRefOrDecl, IDefaultTextContentProvider, IElemDesc, IElemRef, IElemRefOrDecl, IHasBindingAttributes, IHasLocation, IHasRange, ISourceInfo

public class ElemRef
extends ElemRefOrDecl
implements IElemRef


Field Summary
 
Fields inherited from class org.jbind.xml.schema.cmp.ElemRefOrDecl
myDefault, myDefaultTextContent, myFixed
 
Constructor Summary
ElemRef(ISourceInfo aSourceInfo, IRange aRange, IElemRefOrDecl anElemRefOrDecl)
           
 
Method Summary
 void accept(IComponentVisitor aVisitor)
          Accepts a visitor.
 void addValueConstraints(java.lang.String aDefault, java.lang.String aFixed, IConstraintViolations aViolations)
           
 IAttribute getBindingAttribute(java.lang.String aName)
          Gets the specified binding attribute.
 IAttribute getDefaultedLocalBindingAttribute(java.lang.String aName)
          Gets a local binding attribute.
 java.lang.String getDesc()
          Gets a description that is output if the content was not matched when an instance is read in.
 IAttribute getLocalBindingAttribute(java.lang.String aName)
          Gets a local binding attribute.
 IElemRefOrDecl getSubstitute(java.lang.String aNamespace, java.lang.String aName)
          Gets an element declaration that can be substituted for this element declaration.
 IElemDecl getSubstitutionGroup()
           
 IAnyType getType()
          Gets the data type.
 boolean isAbstract()
           
 boolean isActive(BlockType aBlockType)
          Checks if the specified block type is active for the declaration.
 boolean isActive(FinalType aFinalType)
          Checks if the specified final type is active for the declaration.
 boolean isNillable()
           
 boolean isReference()
          Checks if this component is defined as a reference to another component.
 java.util.Iterator iterSubstitutes()
          Iterates the possible substitutes for this declaration.
 
Methods inherited from class org.jbind.xml.schema.cmp.ElemRefOrDecl
add, checkIdentityConstraints, collectElemDescs, createUseState, doAddToParentWithNewRange, getDefault, getDefaultTextContent, getFixed, getRange, getSymbolspace, iterIdentityConstraints, replaceSubstitutions, validate
 
Methods inherited from class org.jbind.xml.schema.cmp.ElemDesc
addToParent, checkValueConstraints, createData, createEmptyData, createUncheckedData, createUseStateProxy
 
Methods inherited from class org.jbind.xml.schema.cmp.Content
getMaxOccurs, getMinOccurs, getRange, isEmptiable, isUnbounded
 
Methods inherited from class org.jbind.xml.schema.cmp.Component
addSubComponent, getAnnotation, getBindings, getDefaultedLocalStringBindingAttribute, getGlobalRef, getLocalStringBindingAttribute, getLocation, getName, getNamespace, getParentComponent, getPrefixToNamespaceMapping, getStringBindingAttribute, isAnonymous, isTopLevelComponent, setBindings, setParentComponent, visitSubComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jbind.xml.core.cmp.IComponent
addSubComponent, getBindings, getGlobalRef, getName, getNamespace, getParentComponent, getSymbolspace, isAnonymous, isTopLevelComponent, setBindings, setParentComponent, validate
 
Methods inherited from interface org.jbind.xml.core.cmp.ISourceInfo
getAnnotation, getPrefixToNamespaceMapping
 
Methods inherited from interface org.jbind.xml.base.IHasLocation
getLocation
 
Methods inherited from interface org.jbind.xml.base.IHasBindingAttributes
getDefaultedLocalStringBindingAttribute, getLocalStringBindingAttribute, getStringBindingAttribute
 
Methods inherited from interface org.jbind.xml.core.content.IDataDesc
checkValueConstraints, createData, createEmptyData, createUncheckedData, getDefault, getFixed
 
Methods inherited from interface org.jbind.xml.core.bridge.IDefaultTextContentProvider
getDefaultTextContent
 
Methods inherited from interface org.jbind.xml.core.content.IElemDesc
checkIdentityConstraints
 
Methods inherited from interface org.jbind.xml.core.content.IContentDesc
addToParent, collectElemDescs, createUseState, createUseStateProxy, getMaxOccurs, getMinOccurs, getRange, isEmptiable, isUnbounded, replaceSubstitutions
 
Methods inherited from interface org.jbind.xml.base.IHasRange
getRange
 

Constructor Detail

ElemRef

public ElemRef(ISourceInfo aSourceInfo,
               IRange aRange,
               IElemRefOrDecl anElemRefOrDecl)
Method Detail

accept

public void accept(IComponentVisitor aVisitor)
            throws XmlException
Description copied from interface: IComponent
Accepts a visitor. The implementation calls the corresponding visitXXXStart and vistXXXEnd methods of the visitor (e.g. visitComplexTypeStart and visitComplexTypeEnd).

Specified by:
accept in interface IComponent
Parameters:
aVisitor - (required).
Throws:
XmlException

getDesc

public java.lang.String getDesc()
Description copied from interface: IContentDesc
Gets a description that is output if the content was not matched when an instance is read in.

Specified by:
getDesc in interface IContentDesc
Returns:
(required).

addValueConstraints

public void addValueConstraints(java.lang.String aDefault,
                                java.lang.String aFixed,
                                IConstraintViolations aViolations)
Specified by:
addValueConstraints in interface IDataRefOrDecl

getSubstitute

public IElemRefOrDecl getSubstitute(java.lang.String aNamespace,
                                    java.lang.String aName)
Description copied from interface: IElemRefOrDecl
Gets an element declaration that can be substituted for this element declaration.

Specified by:
getSubstitute in interface IElemRefOrDecl
Parameters:
aNamespace - (required). The namespace of the substituting declaration.
aName - (required). The name of the substituting declaration.
Returns:
(optional).

getType

public IAnyType getType()
Description copied from interface: IDataDesc
Gets the data type.

Specified by:
getType in interface IDataDesc
Returns:
(required).

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in interface IElemDesc

isNillable

public boolean isNillable()
Specified by:
isNillable in interface IElemDesc

isActive

public boolean isActive(BlockType aBlockType)
Description copied from interface: IDataDesc
Checks if the specified block type is active for the declaration.

Specified by:
isActive in interface IDataDesc
Parameters:
aBlockType - (required).
Returns:
Returns true iff the specified block type is active.

isActive

public boolean isActive(FinalType aFinalType)
Description copied from interface: IDataDesc
Checks if the specified final type is active for the declaration. Controls whether the declaration can be the head of a substitution group.

Specified by:
isActive in interface IDataDesc
Returns:
Returns true iff the specified block type is active.

iterSubstitutes

public java.util.Iterator iterSubstitutes()
Description copied from interface: IElemRefOrDecl
Iterates the possible substitutes for this declaration.

Specified by:
iterSubstitutes in interface IElemRefOrDecl
Returns:
(required). An iterator of IElemRefOrDecl.

isReference

public boolean isReference()
Description copied from interface: IComponent
Checks if this component is defined as a reference to another component.

Specified by:
isReference in interface IComponent
Returns:
Returns true iff this component is a reference to another component.

getSubstitutionGroup

public IElemDecl getSubstitutionGroup()
Specified by:
getSubstitutionGroup in interface IElemRefOrDecl

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 Component

getLocalBindingAttribute

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

Specified by:
getLocalBindingAttribute in interface IHasBindingAttributes
Overrides:
getLocalBindingAttribute in class Component

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
Overrides:
getDefaultedLocalBindingAttribute in class Component