XSOM 20110809-redhat-3

com.sun.xml.xsom.impl
Class IdentityConstraintImpl

java.lang.Object
  extended by com.sun.xml.xsom.impl.ComponentImpl
      extended by 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
IdentityConstraintImpl(SchemaDocumentImpl _owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl fa, short category, String name, XPathImpl selector, List<XPathImpl> fields, Ref.IdentityConstraint refer)
           
 
Method Summary
<T> T
apply(XSFunction<T> function)
          Accepts a functor.
 XSIdentityConstraint get()
           
 short getCategory()
          Returns the type of the identity constraint.
 List<XSXPath> getFields()
          Returns the list of field XPaths.
 String getName()
          Name of the identity constraint.
 XSElementDecl getParent()
          Gets the XSElementDecl that owns this identity constraint.
 XSIdentityConstraint getReferencedKey()
          If this is XSIdentityConstraint.KEYREF, returns the key XSIdentityConstraint being referenced.
 XSXPath getSelector()
          Returns the selector XPath expression as string.
 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,
                              Locator _loc,
                              ForeignAttributesImpl fa,
                              short category,
                              String name,
                              XPathImpl selector,
                              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 interface XSComponent

apply

public <T> T apply(XSFunction<T> function)
Description copied from interface: XSComponent
Accepts a functor.

Specified by:
apply in interface XSComponent

setParent

public void setParent(ElementDecl parent)

getParent

public XSElementDecl getParent()
Description copied from interface: XSIdentityConstraint
Gets the XSElementDecl that owns this identity constraint.

Specified by:
getParent in interface XSIdentityConstraint
Returns:
never null.

getName

public String getName()
Description copied from interface: XSIdentityConstraint
Name of the identity constraint. A name uniquely identifies this XSIdentityConstraint within the namespace.

Specified by:
getName in interface XSIdentityConstraint
Returns:
never null.

getTargetNamespace

public String getTargetNamespace()
Description copied from interface: XSIdentityConstraint
Target namespace of the identity constraint. Just short for getParent().getTargetNamespace().

Specified by:
getTargetNamespace in interface XSIdentityConstraint

getCategory

public short getCategory()
Description copied from interface: XSIdentityConstraint
Returns the type of the identity constraint.

Specified by:
getCategory in interface XSIdentityConstraint
Returns:
either XSIdentityConstraint.KEY,XSIdentityConstraint.KEYREF, or XSIdentityConstraint.UNIQUE.

getSelector

public XSXPath getSelector()
Description copied from interface: XSIdentityConstraint
Returns the selector XPath expression as string.

Specified by:
getSelector in interface XSIdentityConstraint
Returns:
never null.

getFields

public List<XSXPath> getFields()
Description copied from interface: XSIdentityConstraint
Returns the list of field XPaths.

Specified by:
getFields in interface XSIdentityConstraint
Returns:
a non-empty read-only list of Strings, each representing the XPath.

getReferencedKey

public XSIdentityConstraint getReferencedKey()
Description copied from interface: XSIdentityConstraint
If this is XSIdentityConstraint.KEYREF, returns the key XSIdentityConstraint being referenced.

Specified by:
getReferencedKey in interface XSIdentityConstraint
Returns:
always non-null (when XSIdentityConstraint.getCategory()==XSIdentityConstraint.KEYREF).

get

public XSIdentityConstraint get()
Specified by:
get in interface Ref.IdentityConstraint

XSOM 20110809-redhat-3

Copyright © 2012 Oracle. All Rights Reserved.