com.novell.admin.ns
Class ClassDefinition

java.lang.Object
  |
  +--com.novell.admin.ns.ClassDefinition
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultClassDefinition

public class ClassDefinition
extends java.lang.Object
implements java.io.Serializable

This class represents the schema definition for a particular class.

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


Field Summary
protected  boolean auxiliary
           
protected  java.util.Vector classContainmentNameVec
          List of classes that may contain this class.
protected  java.lang.String className
          Name of the class.
protected  boolean container
          Flags associtated with this class.
protected  boolean effective
           
protected  java.util.Hashtable mandatoryAttributeTable
          Table of mandatory attributes.
protected  java.util.Hashtable namingAttributeTable
          Table of naming attributes.
protected  boolean nonRemove
           
protected  java.util.Hashtable optionalAttributeTable
          Table of optional attributes.
 
Constructor Summary
ClassDefinition(java.lang.String name, java.lang.String[] classContainmentNames, AttributeDefinition[] mandatoryAttributes, AttributeDefinition[] namingAttributes, AttributeDefinition[] optionalAttributes)
          Constructor - Creates a class definition for a class.
ClassDefinition(java.lang.String name, java.lang.String[] classContainmentNames, AttributeDefinition[] mandatoryAttributes, AttributeDefinition[] namingAttributes, AttributeDefinition[] optionalAttributes, boolean container, boolean effective, boolean nonRemove, boolean auxiliary)
          Constructor - Creates a class definition for a class.
 
Method Summary
 boolean canBeContainedBy(java.lang.String parentClass)
          Checks to see if this class can be contained by another.
 boolean equals(java.lang.Object obj)
          Checks to see if this definition is equal to another.
 java.lang.String[] getContainmentClasses()
          Retrieves the classes that this class can be contained in.
 AttributeDefinition[] getMandatoryAttributes()
          Retrieves the mandatory attributes of the schema class.
 java.lang.String getName()
          Retrieves the name of the schema class.
 AttributeDefinition[] getNamingAttributes()
          Retrieves the naming attributes of the schema class.
 AttributeDefinition[] getOptionalAttributes()
          Retrieves the optional attributes of the schema class.
 boolean isAttributeMandatory(java.lang.String attrName)
          Checks to see if a particular attribute is mandatory.
 boolean isAttributeOptional(java.lang.String attrName)
          Checks to see if a particular attribute is optional.
 boolean isAuxiliary()
          Tests to see if this is an effective class.
 boolean isClassUsingAttribute(java.lang.String attrName)
          Checks to see if a particular attribute is being used by this class.
 boolean isContainer()
          Tests to see if this is an effective class.
 boolean isEffective()
          Tests to see if this is an effective class.
 boolean isNamedBy(java.lang.String attrName)
          Checks to see if an attribute is listed as a naming attribute.
 boolean isNonRemoveable()
          Tests to see if this is an effective class.
 java.lang.String toString()
          Retrieves the name of the schema class.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mandatoryAttributeTable

protected java.util.Hashtable mandatoryAttributeTable
Table of mandatory attributes.

optionalAttributeTable

protected java.util.Hashtable optionalAttributeTable
Table of optional attributes.

namingAttributeTable

protected java.util.Hashtable namingAttributeTable
Table of naming attributes.

classContainmentNameVec

protected java.util.Vector classContainmentNameVec
List of classes that may contain this class.

className

protected java.lang.String className
Name of the class.

container

protected boolean container
Flags associtated with this class.

effective

protected boolean effective

nonRemove

protected boolean nonRemove

auxiliary

protected boolean auxiliary
Constructor Detail

ClassDefinition

public ClassDefinition(java.lang.String name,
                       java.lang.String[] classContainmentNames,
                       AttributeDefinition[] mandatoryAttributes,
                       AttributeDefinition[] namingAttributes,
                       AttributeDefinition[] optionalAttributes,
                       boolean container,
                       boolean effective,
                       boolean nonRemove,
                       boolean auxiliary)
Constructor - Creates a class definition for a class.
Parameters:
name - The name of the schema class.
classContainmentNames - Names of classes that this class can be contained by.
mandatoryAttributes - Array of mandatory attribute definitions.

This array may either be 'null' or empty if there are no mandatory attributes.

optionalAttributes - Array of optional attributes definitions.

This array may either be 'null' or empty if there are no optional attributes.


ClassDefinition

public ClassDefinition(java.lang.String name,
                       java.lang.String[] classContainmentNames,
                       AttributeDefinition[] mandatoryAttributes,
                       AttributeDefinition[] namingAttributes,
                       AttributeDefinition[] optionalAttributes)
Constructor - Creates a class definition for a class.
Parameters:
name - The name of the schema class.
classContainmentNames - Names of classes that this class can be contained by.
mandatoryAttributes - Array of mandatory attribute definitions.

This array may either be 'null' or empty if there are no mandatory attributes.

optionalAttributes - Array of optional attributes definitions.

This array may either be 'null' or empty if there are no optional attributes.

Method Detail

getName

public java.lang.String getName()
Retrieves the name of the schema class.
Returns:
String - The class name.

getMandatoryAttributes

public AttributeDefinition[] getMandatoryAttributes()
Retrieves the mandatory attributes of the schema class.
Returns:
Array of the mandatory attributes.

getOptionalAttributes

public AttributeDefinition[] getOptionalAttributes()
Retrieves the optional attributes of the schema class.
Returns:
Array of the optional attributes.

getNamingAttributes

public AttributeDefinition[] getNamingAttributes()
Retrieves the naming attributes of the schema class.
Returns:
Array of the naming attribute definitions.

isNamedBy

public boolean isNamedBy(java.lang.String attrName)
Checks to see if an attribute is listed as a naming attribute.
Parameters:
attrName - name of the attribute being looked for.
Returns:
true if attribute is found as a naming attribute, false otherwise.

getContainmentClasses

public java.lang.String[] getContainmentClasses()
Retrieves the classes that this class can be contained in.
Returns:
Array of the containment class names.

canBeContainedBy

public boolean canBeContainedBy(java.lang.String parentClass)
Checks to see if this class can be contained by another.
Parameters:
parentClass - name of the class to check.
Returns:
True if the parentClass can contain this class, false otherwise.

isContainer

public boolean isContainer()
Tests to see if this is an effective class.
Returns:
True if an object of this type can be created, false otherwise.

isEffective

public boolean isEffective()
Tests to see if this is an effective class.
Returns:
True if an object of this type can be created, false otherwise.

isNonRemoveable

public boolean isNonRemoveable()
Tests to see if this is an effective class.
Returns:
True if an object of this type can be created, false otherwise.

isAuxiliary

public boolean isAuxiliary()
Tests to see if this is an effective class.
Returns:
true if an object of this type can be created, false otherwise.

isAttributeMandatory

public boolean isAttributeMandatory(java.lang.String attrName)
Checks to see if a particular attribute is mandatory.
Parameters:
attrName - Name of the attribute to look for.
Returns:
True if attribute is mandatory, false otherwise.

isAttributeOptional

public boolean isAttributeOptional(java.lang.String attrName)
Checks to see if a particular attribute is optional.
Parameters:
attrName - Name of the attribute to look for.
Returns:
True if attribute is optional, false otherwise.

isClassUsingAttribute

public boolean isClassUsingAttribute(java.lang.String attrName)
Checks to see if a particular attribute is being used by this class.
Parameters:
attrName - Name of the attribute to look for.
Returns:
True if attribute is used by this class, false otherwise.

toString

public java.lang.String toString()
Retrieves the name of the schema class.
Returns:
A String representing the class name.
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Checks to see if this definition is equal to another.
Parameters:
obj - The other ClassDefinition to compare this to.
Returns:
True if objects are equal, false otherwise.
Overrides:
equals in class java.lang.Object


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated December 17 2003 1746.