org.apache.ws.jaxme.xs.impl
Class XSKeyRefImpl

java.lang.Object
  extended by org.apache.ws.jaxme.xs.impl.XSObjectImpl
      extended by org.apache.ws.jaxme.xs.impl.XSOpenAttrsImpl
          extended by org.apache.ws.jaxme.xs.impl.XSKeyRefImpl
All Implemented Interfaces:
XSKeyRef, XSObject, XSOpenAttrs

public class XSKeyRefImpl
extends XSOpenAttrsImpl
implements XSKeyRef

Default implementation of the XSKeyRef.

Author:
Chris Kirk

Constructor Summary
protected XSKeyRefImpl(XSElement pParent, XsEKeyref keyRef)
           
 
Method Summary
 XSAnnotation[] getAnnotations()
          Returns the array of annotations.
 XSIdentityConstraint getIdentityConstraint()
          Returns the name of the unique or key identity constraint that this keyref references.
 XSElementOrAttrRef[][] getMatchCriteria()
          Returns an array of references to element and attributes.
 java.lang.String getName()
          Returns the name of this constraint.
 void validate()
          Validates the objects internal state.
 
Methods inherited from class org.apache.ws.jaxme.xs.impl.XSOpenAttrsImpl
getOpenAttributes
 
Methods inherited from class org.apache.ws.jaxme.xs.impl.XSObjectImpl
getLocator, getParentObject, getXsObject, getXSSchema, isTopLevelObject, validateAllIn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ws.jaxme.xs.XSOpenAttrs
getOpenAttributes
 
Methods inherited from interface org.apache.ws.jaxme.xs.XSObject
getLocator, getParentObject, getXSSchema, isTopLevelObject
 

Constructor Detail

XSKeyRefImpl

protected XSKeyRefImpl(XSElement pParent,
                       XsEKeyref keyRef)
                throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException
Method Detail

getAnnotations

public XSAnnotation[] getAnnotations()
Description copied from interface: XSKeyRef
Returns the array of annotations.

Specified by:
getAnnotations in interface XSKeyRef

getName

public java.lang.String getName()
Description copied from interface: XSKeyRef
Returns the name of this constraint.

Specified by:
getName in interface XSKeyRef
See Also:
XSKeyRef.getName()

getIdentityConstraint

public XSIdentityConstraint getIdentityConstraint()
Description copied from interface: XSKeyRef
Returns the name of the unique or key identity constraint that this keyref references. The constraint must either be declared on the same element as this keyref or a descendant.

Specified by:
getIdentityConstraint in interface XSKeyRef
See Also:
XSKeyRef.getIdentityConstraint()

getMatchCriteria

public XSElementOrAttrRef[][] getMatchCriteria()
Description copied from interface: XSKeyRef
Returns an array of references to element and attributes. All references are relative to the element that declares this keyref.

The result is a two dimensional array, the first dimension corresponds to each xs:field used to declare the constraint. The second dimension is for each 'or' used within the fields xpath query.

Only tags and attributes that were matched by the xpath will be in the result, any xpath that fails to match anything will not be stored in this array.

Specified by:
getMatchCriteria in interface XSKeyRef
See Also:
XSKeyRef.getMatchCriteria()

validate

public void validate()
              throws org.xml.sax.SAXException
Description copied from interface: XSObject

Validates the objects internal state.

Specified by:
validate in interface XSObject
Overrides:
validate in class XSObjectImpl
Throws:
org.xml.sax.SAXException