Package com.sun.xml.xsom.impl
Class IdentityConstraintImpl
- java.lang.Object
-
- com.sun.xml.xsom.impl.ComponentImpl
-
- com.sun.xml.xsom.impl.IdentityConstraintImpl
-
- All Implemented Interfaces:
Ref.IdentityConstraint
,XSComponent
,XSIdentityConstraint
public class IdentityConstraintImpl extends ComponentImpl implements XSIdentityConstraint, Ref.IdentityConstraint
XSIdentityConstraint
implementation.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
-
Fields inherited from class com.sun.xml.xsom.impl.ComponentImpl
ownerDocument
-
Fields inherited from interface com.sun.xml.xsom.XSIdentityConstraint
KEY, KEYREF, UNIQUE
-
-
Constructor Summary
Constructors Constructor Description IdentityConstraintImpl(SchemaDocumentImpl _owner, AnnotationImpl _annon, org.xml.sax.Locator _loc, ForeignAttributesImpl fa, short category, java.lang.String name, XPathImpl selector, java.util.List<XPathImpl> fields, Ref.IdentityConstraint refer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
apply(XSFunction<T> function)
Accepts a functor.XSIdentityConstraint
get()
short
getCategory()
Returns the type of the identity constraint.java.util.List<XSXPath>
getFields()
Returns the list of field XPaths.java.lang.String
getName()
Name of the identity constraint.XSElementDecl
getParent()
Gets theXSElementDecl
that owns this identity constraint.XSIdentityConstraint
getReferencedKey()
If this isXSIdentityConstraint.KEYREF
, returns the keyXSIdentityConstraint
being referenced.XSXPath
getSelector()
Returns the selector XPath expression as string.java.lang.String
getTargetNamespace()
Target namespace of the identity constraint.void
setParent(ElementDecl parent)
void
visit(XSVisitor visitor)
Accepts a visitor.-
Methods inherited from class com.sun.xml.xsom.impl.ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.sun.xml.xsom.XSComponent
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle
-
-
-
-
Constructor Detail
-
IdentityConstraintImpl
public IdentityConstraintImpl(SchemaDocumentImpl _owner, AnnotationImpl _annon, org.xml.sax.Locator _loc, ForeignAttributesImpl fa, short category, java.lang.String name, XPathImpl selector, java.util.List<XPathImpl> fields, Ref.IdentityConstraint refer)
-
-
Method Detail
-
visit
public void visit(XSVisitor visitor)
Description copied from interface:XSComponent
Accepts a visitor.- Specified by:
visit
in interfaceXSComponent
-
apply
public <T> T apply(XSFunction<T> function)
Description copied from interface:XSComponent
Accepts a functor.- Specified by:
apply
in interfaceXSComponent
-
setParent
public void setParent(ElementDecl parent)
-
getParent
public XSElementDecl getParent()
Description copied from interface:XSIdentityConstraint
Gets theXSElementDecl
that owns this identity constraint.- Specified by:
getParent
in interfaceXSIdentityConstraint
- Returns:
- never null.
-
getName
public java.lang.String getName()
Description copied from interface:XSIdentityConstraint
Name of the identity constraint. A name uniquely identifies thisXSIdentityConstraint
within the namespace.- Specified by:
getName
in interfaceXSIdentityConstraint
- Returns:
- never null.
-
getTargetNamespace
public java.lang.String getTargetNamespace()
Description copied from interface:XSIdentityConstraint
Target namespace of the identity constraint. Just short forgetParent().getTargetNamespace()
.- Specified by:
getTargetNamespace
in interfaceXSIdentityConstraint
-
getCategory
public short getCategory()
Description copied from interface:XSIdentityConstraint
Returns the type of the identity constraint.- Specified by:
getCategory
in interfaceXSIdentityConstraint
- Returns:
- either
XSIdentityConstraint.KEY
,XSIdentityConstraint.KEYREF
, orXSIdentityConstraint.UNIQUE
.
-
getSelector
public XSXPath getSelector()
Description copied from interface:XSIdentityConstraint
Returns the selector XPath expression as string.- Specified by:
getSelector
in interfaceXSIdentityConstraint
- Returns:
- never null.
-
getFields
public java.util.List<XSXPath> getFields()
Description copied from interface:XSIdentityConstraint
Returns the list of field XPaths.- Specified by:
getFields
in interfaceXSIdentityConstraint
- Returns:
- a non-empty read-only list of
String
s, each representing the XPath.
-
getReferencedKey
public XSIdentityConstraint getReferencedKey()
Description copied from interface:XSIdentityConstraint
If this isXSIdentityConstraint.KEYREF
, returns the keyXSIdentityConstraint
being referenced.- Specified by:
getReferencedKey
in interfaceXSIdentityConstraint
- Returns:
- always non-null (when
XSIdentityConstraint.getCategory()
==XSIdentityConstraint.KEYREF
).
-
get
public XSIdentityConstraint get()
- Specified by:
get
in interfaceRef.IdentityConstraint
-
-