org.jbind.xml.schema.constraint
Class IdentityConstraintComponent

java.lang.Object
  extended byorg.jbind.xml.schema.cmp.Component
      extended byorg.jbind.xml.schema.constraint.IdentityConstraintComponent
All Implemented Interfaces:
IComponent, IConstraint, IHasBindingAttributes, IHasLocation, IIdentityConstraint, IIdentityConstraintComponent, ISourceInfo
Direct Known Subclasses:
ElementIdentityConstraint, TypeIdentityConstraint

public abstract class IdentityConstraintComponent
extends Component
implements IIdentityConstraintComponent


Constructor Summary
IdentityConstraintComponent(ISourceInfo aSourceInfo, java.lang.String aNamespace, java.lang.String aName)
           
 
Method Summary
 void accept(IComponentVisitor aVisitor)
          Accepts a visitor.
protected  IKey createKey(IDataImpl aData, boolean aNullAllowed, IConstraintViolations aViolations)
           
 IAnyType getDataType()
          Gets the type of the data that is constrained.
 int getNbFields()
           
 IXPath getSelector()
           
 ISymbolspace getSymbolspace()
          Gets the symbol space.
 boolean isFinal()
          Indicates if the constraint must not be further restricted.
 boolean isReference()
          Checks if this component is defined as a reference to another component.
 boolean isRestriction(IConstraint aConstraint)
          Checks if this constraint is a restriction of the specified constraint.
 void localCheck(ICheckContext aCheckContext, IAnyTypeData aData, IConstraintViolations aViolations)
          Checks if the specified data satisfies the constraint locally.
protected  java.util.Iterator select(IAnyTypeData aData)
           
protected  java.util.Iterator select(IDataImpl aData)
           
 void setDataType(IAnyType aType)
          Sets the type of the data that is constrained.
 void setFields(java.util.List aFields)
           
 void setSelector(IXPath anXPath)
           
 void validate(IConstraintViolations aViolations)
          Validates the component.
 
Methods inherited from class org.jbind.xml.schema.cmp.Component
addSubComponent, getAnnotation, getBindingAttribute, getBindings, getDefaultedLocalBindingAttribute, getDefaultedLocalStringBindingAttribute, getGlobalRef, getLocalBindingAttribute, 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, isAnonymous, isTopLevelComponent, setBindings, setParentComponent
 
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
getBindingAttribute, getDefaultedLocalBindingAttribute, getDefaultedLocalStringBindingAttribute, getLocalBindingAttribute, getLocalStringBindingAttribute, getStringBindingAttribute
 
Methods inherited from interface org.jbind.xml.core.constraint.IConstraint
getConstraintType, globalCheck
 

Constructor Detail

IdentityConstraintComponent

public IdentityConstraintComponent(ISourceInfo aSourceInfo,
                                   java.lang.String aNamespace,
                                   java.lang.String aName)
Method Detail

getDataType

public IAnyType getDataType()
Description copied from interface: IIdentityConstraint
Gets the type of the data that is constrained. For reference constraints it is the type of the referenced data. For instance constraints it is the type of the instances.

Specified by:
getDataType in interface IIdentityConstraint
Returns:
(required).

setDataType

public void setDataType(IAnyType aType)
Description copied from interface: IIdentityConstraint
Sets the type of the data that is constrained.

Specified by:
setDataType in interface IIdentityConstraint
Parameters:
aType - (optional).

getSymbolspace

public ISymbolspace getSymbolspace()
Description copied from interface: IComponent
Gets the symbol space. A component that is not anonymous has a symbol space.

Specified by:
getSymbolspace in interface IComponent
Returns:
(optional).

accept

public void accept(IComponentVisitor aVisitor)
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).

localCheck

public void localCheck(ICheckContext aCheckContext,
                       IAnyTypeData aData,
                       IConstraintViolations aViolations)
Description copied from interface: IConstraint
Checks if the specified data satisfies the constraint locally.

Specified by:
localCheck in interface IConstraint
Parameters:
aData - (required).
aViolations - (required).

isRestriction

public boolean isRestriction(IConstraint aConstraint)
Description copied from interface: IConstraint
Checks if this constraint is a restriction of the specified constraint.

Specified by:
isRestriction in interface IConstraint
Parameters:
aConstraint - (required).
Returns:
Returns true iff this constraint is a restriction of the specified constraint.

isFinal

public boolean isFinal()
Description copied from interface: IConstraint
Indicates if the constraint must not be further restricted.

Specified by:
isFinal in interface IConstraint
Returns:
Returns true iff the constraint can not be restricted.

select

protected java.util.Iterator select(IAnyTypeData aData)
                             throws XmlException
Throws:
XmlException

select

protected java.util.Iterator select(IDataImpl aData)
                             throws XmlException
Throws:
XmlException

createKey

protected IKey createKey(IDataImpl aData,
                         boolean aNullAllowed,
                         IConstraintViolations aViolations)
                  throws XmlException
Throws:
XmlException

setFields

public void setFields(java.util.List aFields)
Specified by:
setFields in interface IIdentityConstraintComponent

getSelector

public IXPath getSelector()
Specified by:
getSelector in interface IIdentityConstraintComponent

setSelector

public void setSelector(IXPath anXPath)
Specified by:
setSelector in interface IIdentityConstraintComponent

getNbFields

public int getNbFields()
Specified by:
getNbFields in interface IIdentityConstraintComponent

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.

validate

public void validate(IConstraintViolations aViolations)
Description copied from interface: IComponent
Validates the component. This method is called as the last step of the component construction.

Specified by:
validate in interface IComponent
Parameters:
aViolations - (required).