org.jbind.xml.core.cmp
Interface IAttributesModel

All Superinterfaces:
IHasLocation
All Known Implementing Classes:
AttributesModel

public interface IAttributesModel
extends IHasLocation

Contains the attributes of a complex type.


Method Summary
 void addAttrRefOrDecl(IAttrRefOrDecl anAttrRefOrDecl, 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.
 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 interface org.jbind.xml.base.IHasLocation
getLocation
 

Method Detail

getAttrDesc

public IAttrDesc getAttrDesc(IRef aRef,
                             IHasLocation aHasLocation)
                      throws XmlException
Gets an attribute description. Skippable attribute wildcards are not returned.

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

getAttrDesc

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

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

iterAttributes

public java.util.Iterator iterAttributes()
Iterates the attributes.

Returns:
(required). An iterator if IAttrRefOrDecl.

getIdAttribute

public IAttrRefOrDecl getIdAttribute()
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.

Returns:
An attribute declaration (optional).

getWildcard

public IWildcard getWildcard()

setWildcard

public void setWildcard(IWildcard aWildcard)

addAttrRefOrDecl

public void addAttrRefOrDecl(IAttrRefOrDecl anAttrRefOrDecl,
                             IConstraintViolations aViolations)

validate

public void validate(IConstraintViolations aViolations)

hasAttribute

public boolean hasAttribute(IRef aRef)
Checks if the specified attribute is contained in the attributes model. Attribute wildcards are not considered.

Parameters:
aRef - (required).
Returns:
Returns true iff the attribute is contained in the attributes model.

getAttrRefOrDecl

public IAttrRefOrDecl getAttrRefOrDecl(IRef aRef)
Gets the specified attribute.

Parameters:
aRef - (required).
Returns:
(optional).

getAttrRefOrDecl

public IAttrRefOrDecl getAttrRefOrDecl(java.lang.String aNamespace,
                                       java.lang.String aName)

extend

public IAttributesModel extend(IComplexType aType)

restrict

public IAttributesModel restrict(IComplexType aType)

getDefaultAttr

public IAttrRefOrDecl getDefaultAttr(IRef aRef)

completeDerivedModel

public void completeDerivedModel(IConstraintViolations aViolations)
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.


setAttrGroupDecl

public void setAttrGroupDecl(IAttrGroupDecl anAttrGroupDecl)