org.jbind.xml.schema.cmp
Class AttrRef

java.lang.Object
  extended byorg.jbind.xml.schema.cmp.Component
      extended byorg.jbind.xml.schema.cmp.AttrDesc
          extended byorg.jbind.xml.schema.cmp.AttrRefOrDecl
              extended byorg.jbind.xml.schema.cmp.AttrRef
All Implemented Interfaces:
IAttrDesc, IAttrRef, IAttrRefOrDecl, IComponent, IDataDesc, IDataRefOrDecl, IDefaultTextContentProvider, IHasBindingAttributes, IHasLocation, ISourceInfo

public class AttrRef
extends AttrRefOrDecl
implements IAttrRef


Field Summary
 
Fields inherited from class org.jbind.xml.schema.cmp.AttrRefOrDecl
myDefault, myFixed
 
Constructor Summary
AttrRef(ISourceInfo aSourceInfo, AttributeOccurence anOccurence, IAttrRefOrDecl anAttr)
           
 
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.
 IAttribute getLocalBindingAttribute(java.lang.String aName)
          Gets a local binding attribute.
 IAnyType getType()
          Gets the data type.
 boolean hasDefaultType()
          Indicates if the attribute declaration has an explicitly assigned type or if it got the "anySimpleType" by default.
 boolean isReference()
          Checks if this component is defined as a reference to another component.
 
Methods inherited from class org.jbind.xml.schema.cmp.AttrRefOrDecl
getDefault, getFixed, getOccurence, validate
 
Methods inherited from class org.jbind.xml.schema.cmp.AttrDesc
checkValueConstraints, createData, createEmptyData, createUncheckedData, getDefaultTextContent, getSymbolspace, isActive, isActive
 
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.content.IAttrRefOrDecl
getOccurence
 
Methods inherited from interface org.jbind.xml.core.content.IDataDesc
checkValueConstraints, createData, createEmptyData, createUncheckedData, getDefault, getFixed, isActive, isActive
 
Methods inherited from interface org.jbind.xml.core.bridge.IDefaultTextContentProvider
getDefaultTextContent
 
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
 

Constructor Detail

AttrRef

public AttrRef(ISourceInfo aSourceInfo,
               AttributeOccurence anOccurence,
               IAttrRefOrDecl anAttr)
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

addValueConstraints

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

getType

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

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

hasDefaultType

public boolean hasDefaultType()
Description copied from interface: IAttrRefOrDecl
Indicates if the attribute declaration has an explicitly assigned type or if it got the "anySimpleType" by default.

Specified by:
hasDefaultType in interface IAttrRefOrDecl
Returns:
Returns true iff the declaration got the default type.

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.

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