org.apache.directory.shared.ldap.schema
Class AbstractSchemaObject

java.lang.Object
  extended byorg.apache.directory.shared.ldap.schema.AbstractSchemaObject
All Implemented Interfaces:
SchemaObject
Direct Known Subclasses:
AbstractAttributeType, AbstractMatchingRule, AbstractSyntax, DefaultObjectClass

public abstract class AbstractSchemaObject
extends java.lang.Object
implements SchemaObject

The abstract base class for all schema object types.

Version:
$Rev: 379008 $
Author:
Apache Directory Project

Field Summary
protected  java.lang.String description
          a short description of this SchemaObject
protected  boolean isObsolete
          whether or not this SchemaObject is active
protected  java.lang.String[] names
          a human readible identifiers for this SchemaObject
protected  java.lang.String oid
          a numeric object identifier
 
Constructor Summary
protected AbstractSchemaObject(java.lang.String oid)
          Creates an abstract SchemaObject.
protected AbstractSchemaObject(java.lang.String oid, boolean isObsolete)
          Creates an abstract SchemaObject.
protected AbstractSchemaObject(java.lang.String oid, java.lang.String description)
          Creates an abstract SchemaObject.
protected AbstractSchemaObject(java.lang.String oid, java.lang.String[] names)
          Creates an abstract SchemaObject.
protected AbstractSchemaObject(java.lang.String oid, java.lang.String[] names, boolean isObsolete)
          Creates an abstract SchemaObject.
protected AbstractSchemaObject(java.lang.String oid, java.lang.String[] names, boolean isObsolete, java.lang.String description)
          Creates an abstract SchemaObject.
protected AbstractSchemaObject(java.lang.String oid, java.lang.String name, boolean isObsolete)
          Creates an abstract SchemaObject.
 
Method Summary
 boolean equals(java.lang.Object obj)
          If the object implements SchemaObject and has the same OID as this SchemaObject then they are considered equal.
 java.lang.String getDescription()
          Gets a short description about this SchemaObject.
 java.lang.String getName()
          Gets the first name in the set of short names for this SchemaObject if any exists for it.
 java.lang.String[] getNames()
          Gets short names for this SchemaObject if any exists for it.
 java.lang.String getOid()
          Gets usually what is the numeric object identifier assigned to this SchemaObject.
 int hashCode()
          Based on the hashCode of the oid property.
 boolean isObsolete()
          Gets whether or not this SchemaObject has been inactivated.
protected  void setDescription(java.lang.String description)
          Sets the brief description for this SchemaObject.
protected  void setNames(java.lang.String[] names)
          Sets the human readable names for this SchemaObject.
protected  void setObsolete(boolean obsolete)
          Sets whether or not this SchemaObject is inactived.
 java.lang.String toString()
          Gets the String for the OID of this SchmeaObject.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

oid

protected final java.lang.String oid
a numeric object identifier


isObsolete

protected boolean isObsolete
whether or not this SchemaObject is active


names

protected java.lang.String[] names
a human readible identifiers for this SchemaObject


description

protected java.lang.String description
a short description of this SchemaObject

Constructor Detail

AbstractSchemaObject

protected AbstractSchemaObject(java.lang.String oid)
Creates an abstract SchemaObject.

Parameters:
oid - the numeric object identifier (OID)
Throws:
java.lang.NullPointerException - if oid is null
See Also:
SchemaObject.getOid(), MatchingRuleUse

AbstractSchemaObject

protected AbstractSchemaObject(java.lang.String oid,
                               java.lang.String[] names)
Creates an abstract SchemaObject.

Parameters:
oid - the numeric object identifier (OID)
names - the human readable names for this SchemaObject
Throws:
java.lang.NullPointerException - if oid is null

AbstractSchemaObject

protected AbstractSchemaObject(java.lang.String oid,
                               java.lang.String[] names,
                               boolean isObsolete)
Creates an abstract SchemaObject.

Parameters:
oid - the numeric object identifier (OID)
names - the human readable names for this SchemaObject
isObsolete - true if this object is inactive, false if active
Throws:
java.lang.NullPointerException - if oid is null

AbstractSchemaObject

protected AbstractSchemaObject(java.lang.String oid,
                               java.lang.String name,
                               boolean isObsolete)
Creates an abstract SchemaObject.

Parameters:
oid - the numeric object identifier (OID)
name - the first human readable name for this SchemaObject
isObsolete - true if this object is inactive, false if active
Throws:
java.lang.NullPointerException - if oid is null

AbstractSchemaObject

protected AbstractSchemaObject(java.lang.String oid,
                               boolean isObsolete)
Creates an abstract SchemaObject.

Parameters:
oid - the numeric object identifier (OID)
isObsolete - true if this object is inactive, false if active
Throws:
java.lang.NullPointerException - if oid is null

AbstractSchemaObject

protected AbstractSchemaObject(java.lang.String oid,
                               java.lang.String description)
Creates an abstract SchemaObject.

Parameters:
oid - the numeric object identifier (OID)
description - a brief description for the SchemaObject
Throws:
java.lang.NullPointerException - if oid is null

AbstractSchemaObject

protected AbstractSchemaObject(java.lang.String oid,
                               java.lang.String[] names,
                               boolean isObsolete,
                               java.lang.String description)
Creates an abstract SchemaObject.

Parameters:
oid - the numeric object identifier (OID)
names - the human readable names for this SchemaObject
isObsolete - true if this object is inactive, false if active
description - a brief description for the SchemaObject
Throws:
java.lang.NullPointerException - if oid is null
Method Detail

getOid

public java.lang.String getOid()
Description copied from interface: SchemaObject
Gets usually what is the numeric object identifier assigned to this SchemaObject. All schema objects except for MatchingRuleUses have an OID assigned specifically to then. A MatchingRuleUse's OID really is the OID of it's MatchingRule and not specific to the MatchingRuleUse. This effects how MatchingRuleUse objects are maintained by the system.

Specified by:
getOid in interface SchemaObject
Returns:
an OID for this SchemaObject or its MatchingRule if this SchemaObject is a MatchingRuleUse object
See Also:
SchemaObject.getOid()

isObsolete

public boolean isObsolete()
Description copied from interface: SchemaObject
Gets whether or not this SchemaObject has been inactivated. All SchemaObjects except Syntaxes allow for this parameter within their definition. For Syntaxes this property should always return false in which case it is never included in the description.

Specified by:
isObsolete in interface SchemaObject
Returns:
true if inactive, false if active
See Also:
SchemaObject.isObsolete()

getNames

public java.lang.String[] getNames()
Description copied from interface: SchemaObject
Gets short names for this SchemaObject if any exists for it.

Specified by:
getNames in interface SchemaObject
Returns:
the names for this SchemaObject
See Also:
SchemaObject.getNames()

getName

public java.lang.String getName()
Description copied from interface: SchemaObject
Gets the first name in the set of short names for this SchemaObject if any exists for it.

Specified by:
getName in interface SchemaObject
Returns:
the first of the names for this SchemaObject or null if one does not exist
See Also:
SchemaObject.getName()

getDescription

public java.lang.String getDescription()
Description copied from interface: SchemaObject
Gets a short description about this SchemaObject.

Specified by:
getDescription in interface SchemaObject
Returns:
a short description about this SchemaObject
See Also:
SchemaObject.getDescription()

setObsolete

protected void setObsolete(boolean obsolete)
Sets whether or not this SchemaObject is inactived.

Parameters:
obsolete - true if this object is inactive, false if it is in use

setNames

protected void setNames(java.lang.String[] names)
Sets the human readable names for this SchemaObject.

Parameters:
names - the human readable names for this SchemaObject

setDescription

protected void setDescription(java.lang.String description)
Sets the brief description for this SchemaObject.

Parameters:
description - the brief description for this SchemaObject

hashCode

public int hashCode()
Based on the hashCode of the oid property.

Returns:
the hashCode of the oid String

equals

public boolean equals(java.lang.Object obj)
If the object implements SchemaObject and has the same OID as this SchemaObject then they are considered equal.

Parameters:
obj - the object to test for equality
Returns:
true if obj is a SchemaObject and the OID's match

toString

public java.lang.String toString()
Gets the String for the OID of this SchmeaObject.

Returns:
the OID of this SchmeaObject


Copyright © 2003-2006 . All Rights Reserved.