com.novell.admin.ns
Class AttributeDefinition

java.lang.Object
  extended bycom.novell.admin.ns.AttributeDefinition
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultAttributeDefinition, LDAPAttributeDefinition, NDSAttributeDefinition

public abstract class AttributeDefinition
extends java.lang.Object
implements java.io.Serializable

Default class for attribute definitions.

Objects of this type are immutable, and any extensions to this class must enforce the immutable nature.

Attributes may have lower and upper bounds associated with them. If bounds are applicable, the attribute is sized. The attribute may be hidden, indicating that any class with a hidden attribute will not return a value for such an attribute. If the attribute may contain only a single value it is said to be a single-valued attribute. The attribute may be read-only, indicating that values associated with the attribute cannot be modified.

See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList aliasNames
          List of alias names for the attribute.
protected  long lowerBound
          Lower bound for the attribute.
protected  java.lang.String name
          Name of the attribute.
protected  boolean sized
          Flag to indicate if the attribute is sized or not.
protected  Syntax syntax
          Syntax of the attribute.
protected  long upperBound
          Upper bound for the attribute.
 
Constructor Summary
AttributeDefinition(java.lang.String attrName, Syntax syntax)
          Simple constructor that assumes the attribute is not sized and no aliases.
AttributeDefinition(java.lang.String attrName, Syntax syntax, boolean sized, long lowerBound, long upperBound, java.lang.String[] aliasArray)
          Constructor with bounds and alias names.
AttributeDefinition(java.lang.String attrName, Syntax syntax, long lowerBound, long upperBound)
          Constructor that assumes the attribute is sized.
 
Method Summary
abstract  ObjectAttribute createAttribute()
          Abstract factory method for creating ObjectAttributes.
 boolean equals(java.lang.Object obj)
          Checks to see if this definition is equal to another.
 java.lang.String[] getAliasNames()
          Retrieves the alias names of the attribute.
 long getLowerBound()
          Returns the lower bound of the attribute.
 java.lang.String getName()
          Returns the name of this attribute definition.
 Syntax getSyntax()
          Returns the Syntax of this attribute definition.
 long getUpperBound()
          Returns the upper bound of the attribute.
 boolean isAberrant()
          Check to see if the attribute behaves in some atypical manner.
abstract  boolean isHidden()
          Checks to see if an attribute is hidden.
abstract  boolean isReadOnly()
          Checks to see if an attribute is read-only.
abstract  boolean isSingleValued()
          Check to see if attribute is single-valued.
 boolean isSized()
          Checks to see if the attribute is sized.
 java.lang.String toString()
          Converts this attribute definition to a String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

aliasNames

protected java.util.ArrayList aliasNames
List of alias names for the attribute.


lowerBound

protected long lowerBound
Lower bound for the attribute.

The bound should be inclusive. It should also be zero if the attribute is not sized.


name

protected java.lang.String name
Name of the attribute.


sized

protected boolean sized
Flag to indicate if the attribute is sized or not.


syntax

protected Syntax syntax
Syntax of the attribute.


upperBound

protected long upperBound
Upper bound for the attribute.

The bound should be inclusive. It should also be zero if the attribute is not sized.

Constructor Detail

AttributeDefinition

public AttributeDefinition(java.lang.String attrName,
                           Syntax syntax)
Simple constructor that assumes the attribute is not sized and no aliases.

Parameters:
attrName - Name of the attribute.
syntax - Syntax for the attribute.

AttributeDefinition

public AttributeDefinition(java.lang.String attrName,
                           Syntax syntax,
                           boolean sized,
                           long lowerBound,
                           long upperBound,
                           java.lang.String[] aliasArray)
Constructor with bounds and alias names.

Parameters:
attrName - Name of the attribute.
syntax - Syntax for the attribute.
sized - Indicates whether the lower and upper bounds are defined.
lowerBound - Lower bound for values associated with this attribute.
upperBound - Upper bound for values associated with this attribute.
aliasArray - The alternate names which can be used to access the attribute. May be null.

AttributeDefinition

public AttributeDefinition(java.lang.String attrName,
                           Syntax syntax,
                           long lowerBound,
                           long upperBound)
Constructor that assumes the attribute is sized. This constructor is kept for old NDSNamespace compatibility.

Parameters:
attrName - Name of the attribute.
syntax - Syntax for the attribute.
lowerBound - Lower bound for values associated with this attribute.
upperBound - Upper bound for values associated with this attribute.
Method Detail

createAttribute

public abstract ObjectAttribute createAttribute()
Abstract factory method for creating ObjectAttributes.

This method is used to create a brand new Attribute. The returned ObjectAttribute should contain the necessary ValueComponents so that it is considered fully, but minimally, constructed.

Returns:
A newly created ObjectAttribute.

equals

public boolean equals(java.lang.Object obj)
Checks to see if this definition is equal to another.

Parameters:
obj - The other AttributeDefinition to compare this to.
Returns:
True if objects are equal, false otherwise.

getAliasNames

public java.lang.String[] getAliasNames()
Retrieves the alias names of the attribute.

Returns:
String array of the alias names.

getLowerBound

public long getLowerBound()
Returns the lower bound of the attribute.

Returns:
lower bound for sized attributes.

getName

public java.lang.String getName()
Returns the name of this attribute definition.

Returns:
Name of the attribute definition.

getSyntax

public Syntax getSyntax()
Returns the Syntax of this attribute definition.

Returns:
The syntax of the attribute definition.

getUpperBound

public long getUpperBound()
Returns the upper bound of the attribute.

Returns:
upper bound for sized attributes.

isAberrant

public boolean isAberrant()
Check to see if the attribute behaves in some atypical manner.

The behavior of attributes which return true are atypical and should not be handled like normal attributes. Most common are attributes that may be modified but are handled in a namespace specific manner. Most attributes should return false which is the default.

Returns:
True if aberrant, false if multivalued.

isHidden

public abstract boolean isHidden()
Checks to see if an attribute is hidden.

Returns:
true if hidden, false otherwise.

isReadOnly

public abstract boolean isReadOnly()
Checks to see if an attribute is read-only.

Returns:
true if read-only, false otherwise.

isSingleValued

public abstract boolean isSingleValued()
Check to see if attribute is single-valued.

Returns:
true if single-value, false if multi-valued.

isSized

public boolean isSized()
Checks to see if the attribute is sized.

Returns:
True if sized, otherwise false.

toString

public java.lang.String toString()
Converts this attribute definition to a String.

Returns:
Name of the attribute definition.
See Also:
getName().


API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated September 2 2004 0111.