org.jbind.xml.schema.cmp
Class AttributesModel

java.lang.Object
  extended byorg.jbind.xml.schema.cmp.AttributesModel
All Implemented Interfaces:
IAttributesModel, IHasLocation

public class AttributesModel
extends java.lang.Object
implements IAttributesModel


Constructor Summary
AttributesModel(ISourceInfo aSourceInfo)
           
 
Method Summary
 void addAttrRefOrDecl(IAttrRefOrDecl anAttribute, IConstraintViolations aViolations)
           
 void completeDerivedModel(IConstraintViolations aViolations)
          Completes the attributes model of a derived type.
 IAttributesModel extend(IComplexType aType)
           
 IAttrDesc getAttrDesc(IRef aRef, IHasLocation aHasLocation)
          Gets an attribute description.
 IAttrDesc getAttrDesc(java.lang.String aNamespace, java.lang.String aLocalName, IHasLocation aHasLocation)
          Gets an attribute description.
 IAttrRefOrDecl getAttrRefOrDecl(IRef aRef)
          Gets the specified attribute.
 IAttrRefOrDecl getAttrRefOrDecl(java.lang.String aNamespace, java.lang.String aName)
           
 IAttrRefOrDecl getDefaultAttr(IRef aRef)
           
 IAttrRefOrDecl getIdAttribute()
          Gets the usage of the id attribute, if existing.
 ILocation getLocation()
           
 IWildcard getWildcard()
           
 boolean hasAttribute(IRef aRef)
          Checks if the specified attribute is contained in the attributes model.
 java.util.Iterator iterAttributes()
          Iterates the attributes.
 IAttributesModel restrict(IComplexType aType)
           
 void setAttrGroupDecl(IAttrGroupDecl anAttrGroupDecl)
           
 void setWildcard(IWildcard aWildcard)
           
 void validate(IConstraintViolations aViolations)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributesModel

public AttributesModel(ISourceInfo aSourceInfo)
Method Detail

extend

public IAttributesModel extend(IComplexType aType)
Specified by:
extend in interface IAttributesModel

restrict

public IAttributesModel restrict(IComplexType aType)
Specified by:
restrict in interface IAttributesModel

setAttrGroupDecl

public void setAttrGroupDecl(IAttrGroupDecl anAttrGroupDecl)
Specified by:
setAttrGroupDecl in interface IAttributesModel

getWildcard

public IWildcard getWildcard()
Specified by:
getWildcard in interface IAttributesModel

setWildcard

public void setWildcard(IWildcard aWildcard)
Specified by:
setWildcard in interface IAttributesModel

addAttrRefOrDecl

public void addAttrRefOrDecl(IAttrRefOrDecl anAttribute,
                             IConstraintViolations aViolations)
Specified by:
addAttrRefOrDecl in interface IAttributesModel

completeDerivedModel

public void completeDerivedModel(IConstraintViolations aViolations)
Description copied from interface: IAttributesModel
Completes the attributes model of a derived type.

If this attributes model is an extension then all attributes from the parent model are copied into this model. Duplicated attributes are reported as constraint violations.

If this attributes model is a restriction then for each attribute it is checked if it is a valid restriction of an attribute of the base model. In addition, all attributes of the base model that were not restricted are copied into this model.

Specified by:
completeDerivedModel in interface IAttributesModel

iterAttributes

public java.util.Iterator iterAttributes()
Description copied from interface: IAttributesModel
Iterates the attributes.

Specified by:
iterAttributes in interface IAttributesModel
Returns:
(required). An iterator if IAttrRefOrDecl.

getAttrDesc

public IAttrDesc getAttrDesc(java.lang.String aNamespace,
                             java.lang.String aLocalName,
                             IHasLocation aHasLocation)
                      throws XmlException
Description copied from interface: IAttributesModel
Gets an attribute description. Skippable attribute wildcards are not returned.

Specified by:
getAttrDesc in interface IAttributesModel
Parameters:
aNamespace - (required).
aLocalName - (required).
aHasLocation - (optional).
Returns:
(optional).
Throws:
XmlException - Raised if the attribute is not contained in the attributes model.

getAttrDesc

public IAttrDesc getAttrDesc(IRef aRef,
                             IHasLocation aHasLocation)
                      throws XmlException
Description copied from interface: IAttributesModel
Gets an attribute description. Skippable attribute wildcards are not returned.

Specified by:
getAttrDesc in interface IAttributesModel
Parameters:
aRef - (required).
aHasLocation - (optional).
Returns:
(optional).
Throws:
XmlException - Raised if the attribute is not contained in the attribute model.

getIdAttribute

public IAttrRefOrDecl getIdAttribute()
Description copied from interface: IAttributesModel
Gets the usage of the id attribute, if existing. An attributes model may contain at most one usage of a type that is equal to or derived from the built-in ID type.

Specified by:
getIdAttribute in interface IAttributesModel
Returns:
An attribute declaration (optional).

hasAttribute

public boolean hasAttribute(IRef aRef)
Description copied from interface: IAttributesModel
Checks if the specified attribute is contained in the attributes model. Attribute wildcards are not considered.

Specified by:
hasAttribute in interface IAttributesModel
Parameters:
aRef - (required).
Returns:
Returns true iff the attribute is contained in the attributes model.

getAttrRefOrDecl

public IAttrRefOrDecl getAttrRefOrDecl(IRef aRef)
Description copied from interface: IAttributesModel
Gets the specified attribute.

Specified by:
getAttrRefOrDecl in interface IAttributesModel
Parameters:
aRef - (required).
Returns:
(optional).

getAttrRefOrDecl

public IAttrRefOrDecl getAttrRefOrDecl(java.lang.String aNamespace,
                                       java.lang.String aName)
Specified by:
getAttrRefOrDecl in interface IAttributesModel

validate

public void validate(IConstraintViolations aViolations)
Specified by:
validate in interface IAttributesModel

getDefaultAttr

public IAttrRefOrDecl getDefaultAttr(IRef aRef)
Specified by:
getDefaultAttr in interface IAttributesModel

getLocation

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