org.apache.xmlbeans.impl.schema
Class SchemaIdentityConstraintImpl

java.lang.Object
  extended by org.apache.xmlbeans.impl.schema.SchemaIdentityConstraintImpl
All Implemented Interfaces:
SchemaAnnotated, SchemaComponent, SchemaIdentityConstraint

public class SchemaIdentityConstraintImpl
extends java.lang.Object
implements SchemaIdentityConstraint


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.xmlbeans.SchemaIdentityConstraint
SchemaIdentityConstraint.Ref
 
Field Summary
 
Fields inherited from interface org.apache.xmlbeans.SchemaIdentityConstraint
CC_KEY, CC_KEYREF, CC_UNIQUE
 
Fields inherited from interface org.apache.xmlbeans.SchemaComponent
ANNOTATION, ATTRIBUTE, ATTRIBUTE_GROUP, ELEMENT, IDENTITY_CONSTRAINT, MODEL_GROUP, NOTATION, TYPE
 
Constructor Summary
SchemaIdentityConstraintImpl(org.apache.xmlbeans.impl.schema.SchemaContainer c)
           
 
Method Summary
 void buildPaths()
           
 SchemaAnnotation getAnnotation()
          Returns the Schema annotation object or null if none present
 java.lang.String getChameleonNamespace()
           
 SchemaComponent.Ref getComponentRef()
          Used for on-demand loading of schema components.
 int getComponentType()
          Returns the type code for the schema object, either SchemaComponent.TYPE, SchemaComponent.ELEMENT, SchemaComponent.ATTRIBUTE, SchemaComponent.ATTRIBUTE_GROUP, SchemaComponent.MODEL_GROUP, SchemaComponent.IDENTITY_CONSTRAINT, or SchemaComponent.NOTATION.
 int getConstraintCategory()
          Return the constraint category.
 java.lang.Object getFieldPath(int index)
          Return a compiled xpath object for the field.
 java.lang.String[] getFields()
          Return (a copy of) the xpaths for all the fields.
 javax.xml.namespace.QName getName()
          The name of the schema component
 java.util.Map getNSMap()
          Return a read-only copy of the namespace map.
 XmlObject getParseObject()
           
 SchemaIdentityConstraint.Ref getRef()
           
 SchemaIdentityConstraint getReferencedKey()
          Returns the key that a key ref refers to.
 java.lang.String getSelector()
          Return the selector xpath as a string.
 java.lang.Object getSelectorPath()
          Return a compiled xpath object for the selector.
 java.lang.String getSourceName()
          The name of resource that represends the source .xsd in which this component was defined (if known)
See: SchemaTypeLoader.getSourceAsStream(String)

Example:
 java.lang.String getTargetNamespace()
           
 SchemaTypeSystem getTypeSystem()
          Returns the typesystem within which this component definition resides
 java.lang.Object getUserData()
          Returns user-specific information.
 boolean isResolved()
          Only applicable to keyrefs.
 void setAnnotation(SchemaAnnotation ann)
           
 void setConstraintCategory(int type)
           
 void setFields(java.lang.String[] fields)
           
 void setFilename(java.lang.String filename)
           
 void setName(javax.xml.namespace.QName name)
           
 void setNSMap(java.util.Map nsMap)
           
 void setParseContext(XmlObject o, java.lang.String targetNamespace, boolean chameleon)
           
 void setReferencedKey(SchemaIdentityConstraint.Ref key)
           
 void setSelector(java.lang.String selector)
           
 void setUserData(java.lang.Object data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaIdentityConstraintImpl

public SchemaIdentityConstraintImpl(org.apache.xmlbeans.impl.schema.SchemaContainer c)
Method Detail

setFilename

public void setFilename(java.lang.String filename)

getSourceName

public java.lang.String getSourceName()
Description copied from interface: SchemaComponent
The name of resource that represends the source .xsd in which this component was defined (if known)
See: SchemaTypeLoader.getSourceAsStream(String)

Example:
   SchemaType schemaType = ..;
   InputStream is = schemaType.getTypeSystem().getSourceAsStream(schemaType.getSourceName());
 

Specified by:
getSourceName in interface SchemaComponent

getSelector

public java.lang.String getSelector()
Description copied from interface: SchemaIdentityConstraint
Return the selector xpath as a string.

Specified by:
getSelector in interface SchemaIdentityConstraint

getSelectorPath

public java.lang.Object getSelectorPath()
Description copied from interface: SchemaIdentityConstraint
Return a compiled xpath object for the selector.

Specified by:
getSelectorPath in interface SchemaIdentityConstraint

setAnnotation

public void setAnnotation(SchemaAnnotation ann)

getAnnotation

public SchemaAnnotation getAnnotation()
Description copied from interface: SchemaAnnotated
Returns the Schema annotation object or null if none present

Specified by:
getAnnotation in interface SchemaAnnotated

setNSMap

public void setNSMap(java.util.Map nsMap)

getNSMap

public java.util.Map getNSMap()
Description copied from interface: SchemaIdentityConstraint
Return a read-only copy of the namespace map. This is the set of prefix to URI mappings that were in scope in the schema at the point at which this constraint was declared

Specified by:
getNSMap in interface SchemaIdentityConstraint

setSelector

public void setSelector(java.lang.String selector)

setFields

public void setFields(java.lang.String[] fields)

getFields

public java.lang.String[] getFields()
Description copied from interface: SchemaIdentityConstraint
Return (a copy of) the xpaths for all the fields.

Specified by:
getFields in interface SchemaIdentityConstraint

getFieldPath

public java.lang.Object getFieldPath(int index)
Description copied from interface: SchemaIdentityConstraint
Return a compiled xpath object for the field.

Specified by:
getFieldPath in interface SchemaIdentityConstraint

buildPaths

public void buildPaths()
                throws XPath.XPathCompileException
Throws:
XPath.XPathCompileException

setReferencedKey

public void setReferencedKey(SchemaIdentityConstraint.Ref key)

getReferencedKey

public SchemaIdentityConstraint getReferencedKey()
Description copied from interface: SchemaIdentityConstraint
Returns the key that a key ref refers to. Only valid for keyrefs.

Specified by:
getReferencedKey in interface SchemaIdentityConstraint

setConstraintCategory

public void setConstraintCategory(int type)

getConstraintCategory

public int getConstraintCategory()
Description copied from interface: SchemaIdentityConstraint
Return the constraint category. Either SchemaIdentityConstraint.CC_KEY, SchemaIdentityConstraint.CC_KEYREF, or SchemaIdentityConstraint.CC_UNIQUE.

Specified by:
getConstraintCategory in interface SchemaIdentityConstraint

setName

public void setName(javax.xml.namespace.QName name)

getName

public javax.xml.namespace.QName getName()
Description copied from interface: SchemaComponent
The name of the schema component

Specified by:
getName in interface SchemaComponent

getComponentType

public int getComponentType()
Description copied from interface: SchemaComponent
Returns the type code for the schema object, either SchemaComponent.TYPE, SchemaComponent.ELEMENT, SchemaComponent.ATTRIBUTE, SchemaComponent.ATTRIBUTE_GROUP, SchemaComponent.MODEL_GROUP, SchemaComponent.IDENTITY_CONSTRAINT, or SchemaComponent.NOTATION.

Specified by:
getComponentType in interface SchemaComponent

getTypeSystem

public SchemaTypeSystem getTypeSystem()
Description copied from interface: SchemaComponent
Returns the typesystem within which this component definition resides

Specified by:
getTypeSystem in interface SchemaComponent

setParseContext

public void setParseContext(XmlObject o,
                            java.lang.String targetNamespace,
                            boolean chameleon)

getParseObject

public XmlObject getParseObject()

getTargetNamespace

public java.lang.String getTargetNamespace()

getChameleonNamespace

public java.lang.String getChameleonNamespace()

isResolved

public boolean isResolved()
Only applicable to keyrefs. Other types are implicitly resolved.


getRef

public SchemaIdentityConstraint.Ref getRef()

getComponentRef

public SchemaComponent.Ref getComponentRef()
Description copied from interface: SchemaComponent
Used for on-demand loading of schema components.

Specified by:
getComponentRef in interface SchemaComponent

getUserData

public java.lang.Object getUserData()
Description copied from interface: SchemaIdentityConstraint
Returns user-specific information.

Specified by:
getUserData in interface SchemaIdentityConstraint
See Also:
SchemaBookmark

setUserData

public void setUserData(java.lang.Object data)