org.jbind.xml.schema.constraint
Class TypeKeyRefConstraint

java.lang.Object
  extended byorg.jbind.xml.schema.cmp.Component
      extended byorg.jbind.xml.schema.constraint.IdentityConstraintComponent
          extended byorg.jbind.xml.schema.constraint.TypeIdentityConstraint
              extended byorg.jbind.xml.schema.constraint.TypeKeyRefConstraint
All Implemented Interfaces:
IComponent, IConstraint, IHasBindingAttributes, IHasLocation, IIdentityConstraint, IIdentityConstraintComponent, IReferenceConstraint, ISourceInfo, ITypeIdentityConstraint, ITypeKeyRefConstraint

public class TypeKeyRefConstraint
extends TypeIdentityConstraint
implements ITypeKeyRefConstraint


Constructor Summary
TypeKeyRefConstraint(ISourceInfo aSourceInfo, java.lang.String aNamespace, java.lang.String aName)
           
 
Method Summary
 java.lang.String getConstraintKey()
          Gets the key of the reference constraint.
 ConstraintType getConstraintType()
           
 ITypeInstanceConstraint getReferredConstraint()
           
 void globalCheck(IDataContext aContext, IAnyTypeData aData, IAnyTypeData anEnclosingData, IConstraintViolations aViolations)
          Checks if the specified data satisfies the constraint globally.
 boolean isSingleNotMultipleReference()
          Indicates if the constraint references a single data object or if it references multiple data objects.
 void resolveLocalTypeInstances(java.util.Map aMap, IAnyTypeData aData, IConstraintViolations aViolations)
           
 void setReferredConstraint(ITypeInstanceConstraint aConstraint)
           
 
Methods inherited from class org.jbind.xml.schema.constraint.IdentityConstraintComponent
accept, createKey, getDataType, getNbFields, getSelector, getSymbolspace, isFinal, isReference, isRestriction, localCheck, select, select, setDataType, setFields, setSelector, validate
 
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.constraint.IIdentityConstraintComponent
getNbFields, getSelector, setFields, setSelector
 
Methods inherited from interface org.jbind.xml.core.cmp.IComponent
accept, addSubComponent, getBindings, getGlobalRef, getName, getNamespace, getParentComponent, getSymbolspace, isAnonymous, isReference, 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
getBindingAttribute, getDefaultedLocalBindingAttribute, getDefaultedLocalStringBindingAttribute, getLocalBindingAttribute, getLocalStringBindingAttribute, getStringBindingAttribute
 
Methods inherited from interface org.jbind.xml.core.constraint.IIdentityConstraint
getDataType, setDataType
 
Methods inherited from interface org.jbind.xml.core.constraint.IConstraint
isFinal, isRestriction, localCheck
 

Constructor Detail

TypeKeyRefConstraint

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

globalCheck

public void globalCheck(IDataContext aContext,
                        IAnyTypeData aData,
                        IAnyTypeData anEnclosingData,
                        IConstraintViolations aViolations)
Description copied from interface: IConstraint
Checks if the specified data satisfies the constraint globally.

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

resolveLocalTypeInstances

public void resolveLocalTypeInstances(java.util.Map aMap,
                                      IAnyTypeData aData,
                                      IConstraintViolations aViolations)
Specified by:
resolveLocalTypeInstances in interface ITypeKeyRefConstraint

getConstraintType

public ConstraintType getConstraintType()
Specified by:
getConstraintType in interface IConstraint

getReferredConstraint

public ITypeInstanceConstraint getReferredConstraint()
Specified by:
getReferredConstraint in interface ITypeKeyRefConstraint

setReferredConstraint

public void setReferredConstraint(ITypeInstanceConstraint aConstraint)

isSingleNotMultipleReference

public boolean isSingleNotMultipleReference()
Description copied from interface: IReferenceConstraint
Indicates if the constraint references a single data object or if it references multiple data objects.

Specified by:
isSingleNotMultipleReference in interface IReferenceConstraint
Returns:
Returns true iff a single data object is referenced.

getConstraintKey

public java.lang.String getConstraintKey()
Description copied from interface: IReferenceConstraint
Gets the key of the reference constraint. The key must be unique within the type the reference constraint belongs to. The key is used by the methods that are generated for reference constraints to access their referenced data.

Specified by:
getConstraintKey in interface IReferenceConstraint
Returns:
(required).