## org.apache.xerces.impl.xs.identity
Class IdentityConstraint

    java.lang.Object
      |
      +--org.apache.xerces.impl.xs.identity.IdentityConstraint

All Implemented Interfaces:
  XSIDCDefinition, XSObject

Direct Known Subclasses:
  KeyRef, UniqueOrKey

public abstract class IdentityConstraint
extends java.lang.Object
implements XSIDCDefinition

Base class of Schema identity constraint.

Version:
  $Id: IdentityConstraint.java,v 1.7 2003/01/20 13:55:57 elena Exp $
Author:
  Andy Clark, IBM

Field Summary
`protected java.lang.String` `fElementName` name of owning element
`protected int` `fFieldCount` Field count.
`protected Field[]` `fFields` Fields.
`protected java.lang.String` `fIdentityConstraintName` Identity constraint name.
`protected java.lang.String` `fNamespace` target namespace
`protected Selector` `fSelector` Selector.
`protected short` `type` type

Fields inherited from interface org.apache.xerces.impl.xs.psvi.XSIDCDefinition
`IC_KEY, IC_KEYREF, IC_UNIQUE`

Constructor Summary
`protected` `IdentityConstraint(java.lang.String namespace, java.lang.String identityConstraintName, java.lang.String elemName)` Default constructor.

Method Summary
`void` `addField(Field field)` Adds a field.
`boolean` `equals(IdentityConstraint id)`
`XSObjectList` `getAnnotations()` Optional.
`short` `getCategory()` {identity-constraint category} One of key, keyref or unique.
`java.lang.String` `getElementName()`
`Field` `getFieldAt(int index)` Returns the field at the specified index.
`int` `getFieldCount()` Returns the field count.
`StringList` `getFieldStrs()` {fields} A non-empty list of restricted XPath ([XPath]) expressions.
`java.lang.String` `getIdentityConstraintName()` Returns the identity constraint name.
`java.lang.String` `getName()` The `name` of this `XSObject` depending on the `XSObject` type.
`java.lang.String` `getNamespace()` The namespace URI of this node, or `null` if it is unspecified.
`XSNamespaceItem` `getNamespaceItem()` A namespace schema information itemcorresponding to the target namespace of the component, if it's globally declared; or null otherwise.
`XSIDCDefinition` `getRefKey()` {referenced key} Required if {identity-constraint category} is keyref, forbidden otherwise.
`Selector` `getSelector()` Returns the selector.
`java.lang.String` `getSelectorStr()` {selector} A restricted XPath ([XPath]) expression
`short` `getType()` Get the type of the object, i.e ELEMENT_DECLARATION.
`void` `setSelector(Selector selector)` Sets the selector.
`java.lang.String` `toString()` Returns a string representation of this object.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### type

    protected short type

  type

### fNamespace

    protected java.lang.String fNamespace

  target namespace

### fIdentityConstraintName

    protected java.lang.String fIdentityConstraintName

  Identity constraint name.

### fElementName

    protected java.lang.String fElementName

  name of owning element

### fSelector

    protected Selector fSelector

  Selector.

### fFieldCount

    protected int fFieldCount

  Field count.

### fFields

    protected Field[] fFields

  Fields.

Constructor Detail

### IdentityConstraint

    protected IdentityConstraint(java.lang.String namespace,
                                 java.lang.String identityConstraintName,
                                 java.lang.String elemName)

  Default constructor.

Method Detail

### getIdentityConstraintName

    public java.lang.String getIdentityConstraintName()

  Returns the identity constraint name.

### setSelector

    public void setSelector(Selector selector)

  Sets the selector.

### getSelector

    public Selector getSelector()

  Returns the selector.

### addField

    public void addField(Field field)

  Adds a field.

### getFieldCount

    public int getFieldCount()

  Returns the field count.

### getFieldAt

    public Field getFieldAt(int index)

  Returns the field at the specified index.

### getElementName

    public java.lang.String getElementName()

### toString

    public java.lang.String toString()

  Returns a string representation of this object.
  Overrides:
    `toString` in class `java.lang.Object`

### equals

    public boolean equals(IdentityConstraint id)

### getType

    public short getType()

  Get the type of the object, i.e ELEMENT_DECLARATION.
  Specified by:
    `getType` in interface `XSObject`

### getName

    public java.lang.String getName()

  The `name` of this `XSObject` depending on the `XSObject` type.
  Specified by:
    `getName` in interface `XSObject`

### getNamespace

    public java.lang.String getNamespace()

  The namespace URI of this node, or `null` if it is unspecified. defines how a namespace URI is attached to schema components.
  Specified by:
    `getNamespace` in interface `XSObject`

### getCategory

    public short getCategory()

  {identity-constraint category} One of key, keyref or unique.
  Specified by:
    `getCategory` in interface `XSIDCDefinition`

### getSelectorStr

    public java.lang.String getSelectorStr()

  {selector} A restricted XPath ([XPath]) expression
  Specified by:
    `getSelectorStr` in interface `XSIDCDefinition`

### getFieldStrs

    public StringList getFieldStrs()

  {fields} A non-empty list of restricted XPath ([XPath]) expressions.
  Specified by:
    `getFieldStrs` in interface `XSIDCDefinition`

### getRefKey

    public XSIDCDefinition getRefKey()

  {referenced key} Required if {identity-constraint category} is keyref, forbidden otherwise. An identity-constraint definition with {identity-constraint category} equal to key or unique.
  Specified by:
    `getRefKey` in interface `XSIDCDefinition`

### getAnnotations

    public XSObjectList getAnnotations()

  Optional. Annotation.
  Specified by:
    `getAnnotations` in interface `XSIDCDefinition`

### getNamespaceItem

    public XSNamespaceItem getNamespaceItem()

  Description copied from interface: `XSObject`
  A namespace schema information itemcorresponding to the target namespace of the component, if it's globally declared; or null otherwise.
  Specified by:
    `getNamespaceItem` in interface `XSObject`
  See Also:
    `XSObject.getNamespaceItem()`

Copyright © 1999-2003 Apache XML Project. All Rights Reserved.