public abstract class SchemaDefinition
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap |
aliasAttributeNames
Table of alias attribute names.
|
protected java.util.HashMap |
aliasClassNames
Table of alias class names.
|
protected java.util.HashMap |
attributes
Table of attribute definitions.
|
protected java.util.HashMap |
classes
Table of class definitions.
|
protected java.util.HashMap |
expandedClasses
Table of expanded class definitions.
|
protected NamespaceSnapin |
namespace
The namespace that created this.
|
protected java.util.HashMap |
objectTypeCache
The table of ObjectType objects for the schema.
|
| Constructor and Description |
|---|
SchemaDefinition() |
SchemaDefinition(NamespaceSnapin ns) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canContain(java.lang.String parentClass,
java.lang.String childClass)
Tests if objects of one class type may contain objects of another
class type.
|
void |
clearAttributes()
Clears the internal table of schema attribute definitions and the alias table.
|
void |
clearClasses()
Clears the internal table of schema class definitions and the alias table.
|
void |
clearObjectTypeCache()
Clears the internal ObjectType cache.
|
java.lang.Object |
clone()
Creates an exact duplicate of this object without creating a new object.
|
AttributeDefinition |
getAttributeDefinition(java.lang.String attrName)
Returns the AttributeDefinition object for a given attribute name.
|
AttributeDefinition[] |
getAttributeDefinitions()
Returns an array containing all attribute definitions.
|
ClassDefinition[] |
getAuxiliaryClassDefinitions() |
ClassDefinition |
getClassDefinition(java.lang.String className)
Returns the expanded ClassDefinition object for a given class name.
|
ClassDefinition[] |
getClassDefinitions() |
ClassDefinition[] |
getClassesUsingAttribute(java.lang.String attrName)
Returns an array of expanded class definitions that use a particular
attribute, whether mandatory or optional, whether specified directly or inherited.
|
ClassDefinition[] |
getContainmentClasses(java.lang.String className)
Returns all containment classes for a specific class type, including
inherited ones.
|
ClassDefinition[] |
getEffectiveClasses(java.lang.String parentClass)
Returns the effective classes that may be instantiated in a parent class.
|
AttributeDefinition[] |
getMandatoryAttributes(java.lang.String className)
Retrieves all mandatory attributes for a specific class.
|
AttributeDefinition[] |
getNamingAttributes(java.lang.String className)
Retrieves all naming attributes for a specific class.
|
int |
getNumberOfAttributes()
Returns the number of attribute definitions in the schema definition.
|
int |
getNumberOfClasses()
Returns the number of class definitions in the schema definition.
|
ObjectType |
getObjectType(java.lang.String className)
Returns an ObjectType object for a specific class.
|
AttributeDefinition[] |
getOptionalAttributes(java.lang.String className)
Retrieves all optional attributes for a specific class.
|
ClassDefinition |
getRawClassDefinition(java.lang.String className)
Looks up a specific class definition and returns it in raw (unexpanded) form.
|
ClassDefinition[] |
getRawClassDefinitions() |
ClassDefinition[] |
getSubClasses(java.lang.String className)
Retrieve ALL classes which derive from a specific class type.
|
ClassDefinition[] |
getSuperClasses(java.lang.String className)
Retrieves all classes from which a specific class inherits.
|
boolean |
isAttributeDefined(java.lang.String attrName)
Determines if an attribute is defined.
|
boolean |
isClassDefined(java.lang.String className)
Determines if a given class is defined.
|
java.lang.String |
translateAliasAttributeName(java.lang.String oldName)
Translate an alias attribute name into the official name.
|
java.lang.String |
translateAliasClassName(java.lang.String oldName)
Translate an alias class name into the official name.
|
protected java.util.HashMap attributes
protected java.util.HashMap classes
protected java.util.HashMap expandedClasses
protected java.util.HashMap aliasClassNames
protected java.util.HashMap aliasAttributeNames
protected java.util.HashMap objectTypeCache
protected NamespaceSnapin namespace
public SchemaDefinition(NamespaceSnapin ns)
public SchemaDefinition()
public final int getNumberOfAttributes()
public final int getNumberOfClasses()
public ClassDefinition[] getAuxiliaryClassDefinitions()
public ClassDefinition[] getClassDefinitions()
public ClassDefinition[] getRawClassDefinitions()
public AttributeDefinition[] getAttributeDefinitions()
public ClassDefinition[] getClassesUsingAttribute(java.lang.String attrName)
attrName - The name of the attribute used.public AttributeDefinition getAttributeDefinition(java.lang.String attrName) throws NamespaceException
attrName - The name of the attribute.NamespaceException - NamespaceException.ATTRIBUTE_NOT_DEFINED.public boolean canContain(java.lang.String parentClass,
java.lang.String childClass)
parentClass - The name of the parent class type.childClass - The name of the child class type.public ClassDefinition[] getContainmentClasses(java.lang.String className) throws NamespaceException
You can get a String array of the containment classes with: getClassDefinition(className).getContainmentClasses()
className - The name of the class to get containment classes for.NamespaceException - Refer to NamespaceException documentation.public ClassDefinition[] getEffectiveClasses(java.lang.String parentClass)
parentClass - The name of the parent class.public ClassDefinition getClassDefinition(java.lang.String className) throws NamespaceException
The expanded class definition also contains inherited attributes and classes in its tables of mandatory, optional, naming, containment, and superclasses.
className - The name of the class.NamespaceException - NamespaceException.CLASS_NOT_DEFINED.public ClassDefinition getRawClassDefinition(java.lang.String className) throws NamespaceException
A class in raw form lists only those attribute and class rules specified directly by the class, not the inherited ones.
Use this function as a generic replacement for getUnexpandedClassDefinition which was originally coded to return an NDSClassDefinition.className - The name of the class to look up.NamespaceException - Class is not defined.public final boolean isClassDefined(java.lang.String className)
className - The name of the class to check.
This may be the standard name or an alias name.public final boolean isAttributeDefined(java.lang.String attrName)
attrName - The name of the attribute to check.public ClassDefinition[] getSubClasses(java.lang.String className)
The class definitions returned are in expanded form.
className - Name of the super class.public ClassDefinition[] getSuperClasses(java.lang.String className) throws NamespaceException
The class definitions returned are in unexpanded form. This routine was kept for backward compatibility. You can get the complete list as a String array with: getClassDefinition(className).getSuperClasses();
className - The name of the subclass.NamespaceException - Thrown if the class is not defined in schema.public AttributeDefinition[] getNamingAttributes(java.lang.String className) throws NamespaceException
For backward compatibility. Deprecated. Use getClassDefinition(className).getNamingAttributes();
className - The name of the class.NamespaceException - Thrown if the class is not defined in the schema.public AttributeDefinition[] getOptionalAttributes(java.lang.String className) throws NamespaceException
For backward compatibility. Deprecated. Use getClassDefinition(className).getOptionalAttributes();
className - The name of the class.NamespaceException - Thrown if the class not defined in schema.public AttributeDefinition[] getMandatoryAttributes(java.lang.String className) throws NamespaceException
For backward compatibility. Deprecated. Use getClassDefinition(className).getMandatoryAttributes();
className - The name of the class.NamespaceException - Thrown if the class is not defined in the schema.public java.lang.String translateAliasAttributeName(java.lang.String oldName)
public java.lang.String translateAliasClassName(java.lang.String oldName)
public ObjectType getObjectType(java.lang.String className) throws SPIException
className - The name of the class.SPIException - Refer to SPIException documentation.public java.lang.Object clone()
clone in class java.lang.Objectpublic void clearAttributes()
public void clearClasses()
public void clearObjectTypeCache()
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 ${TODAY} ${TSTAMP}.