com.novell.admin.ns
Class DefaultClassDefinition

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

public class DefaultClassDefinition
extends ClassDefinition
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.


Fields inherited from class com.novell.admin.ns.ClassDefinition
auxiliary, classContainmentNameVec, className, container, effective, mandatoryAttributeTable, namingAttributeTable, nonRemove, optionalAttributeTable
 
Constructor Summary
DefaultClassDefinition(java.lang.String name, java.lang.String[] classContainmentNames, AttributeDefinition[] mandatoryAttributes, AttributeDefinition[] namingAttributes, AttributeDefinition[] optionalAttributes)
          Constructor - Creates a class definition for a class.
DefaultClassDefinition(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
 

Constructor Detail

DefaultClassDefinition

public DefaultClassDefinition(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.


DefaultClassDefinition

public DefaultClassDefinition(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 final java.lang.String getName()
Retrieves the name of the schema class.
Returns:
String - The class name.
Overrides:
getName in class ClassDefinition

getMandatoryAttributes

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

getOptionalAttributes

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

getNamingAttributes

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

isNamedBy

public final 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.
Overrides:
isNamedBy in class ClassDefinition

getContainmentClasses

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

canBeContainedBy

public final 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.
Overrides:
canBeContainedBy in class ClassDefinition

isContainer

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

isEffective

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

isNonRemoveable

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

isAuxiliary

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

isAttributeMandatory

public final 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.
Overrides:
isAttributeMandatory in class ClassDefinition

isAttributeOptional

public final 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.
Overrides:
isAttributeOptional in class ClassDefinition

isClassUsingAttribute

public final 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.
Overrides:
isClassUsingAttribute in class ClassDefinition

toString

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

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 ClassDefinition


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.