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

java.lang.Object
  extended by org.apache.directory.shared.ldap.schema.AbstractSchemaObject
      extended by org.apache.directory.shared.ldap.schema.AbstractAttributeType
All Implemented Interfaces:
java.io.Serializable, AttributeType, SchemaObject

public abstract class AbstractAttributeType
extends AbstractSchemaObject
implements java.io.Serializable, AttributeType

Attribute specification bean used to store the schema information for an attributeType definition.

Version:
$Rev: 664290 $
Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.schema.AbstractSchemaObject
description, isObsolete, names, oid, schema
 
Constructor Summary
protected AbstractAttributeType(java.lang.String oid)
          Creates an AttributeType using a unique OID.
 
Method Summary
 int getLength()
          Gets a length limit for this AttributeType.
 UsageEnum getUsage()
          Determines the usage for this AttributeType.
 boolean isAncestorOf(AttributeType descendant)
          Checks to see if this AttributeType is the ancestor of another attributeType.
 boolean isCanUserModify()
          Gets whether or not this AttributeType can be modified by a user.
 boolean isCollective()
          Gets whether or not this AttributeType is a collective attribute.
 boolean isDescentantOf(AttributeType ancestor)
          Checks to see if this AttributeType is the descendant of another attributeType.
 boolean isSingleValue()
          Gets whether or not this AttributeType is single-valued.
protected  void setCanUserModify(boolean canUserModify)
          Sets whether or not an attribute of this AttributeType can be modified by directory users.
protected  void setCollective(boolean collective)
          Sets whether or not an attribute of this AttributeType is a collective.
protected  void setLength(int length)
          Sets the length limit of this AttributeType based on its associated syntax.
protected  void setSingleValue(boolean singleValue)
          Sets whether or not an attribute of this AttributeType single valued or multi-valued.
protected  void setUsage(UsageEnum usage)
          The usage class for this attributeType.
 
Methods inherited from class org.apache.directory.shared.ldap.schema.AbstractSchemaObject
equals, getDescription, getName, getNamesRef, getOid, getSchema, hashCode, isObsolete, setDescription, setNames, setObsolete, setSchema, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.shared.ldap.schema.AttributeType
getEquality, getOrdering, getSubstr, getSuperior, getSyntax
 
Methods inherited from interface org.apache.directory.shared.ldap.schema.SchemaObject
getDescription, getName, getNamesRef, getOid, getSchema, isObsolete, setSchema
 

Constructor Detail

AbstractAttributeType

protected AbstractAttributeType(java.lang.String oid)
Creates an AttributeType using a unique OID.

Parameters:
oid - the IANA OID number for the attributeType
Method Detail

isSingleValue

public boolean isSingleValue()
Description copied from interface: AttributeType
Gets whether or not this AttributeType is single-valued.

Specified by:
isSingleValue in interface AttributeType
Returns:
true if only one value can exist for this AttributeType, false otherwise
See Also:
AttributeType.isSingleValue()

isCollective

public boolean isCollective()
Description copied from interface: AttributeType
Gets whether or not this AttributeType is a collective attribute.

Specified by:
isCollective in interface AttributeType
Returns:
true if the attribute is collective, false otherwise
See Also:
AttributeType.isCollective()

isCanUserModify

public boolean isCanUserModify()
Description copied from interface: AttributeType
Gets whether or not this AttributeType can be modified by a user.

Specified by:
isCanUserModify in interface AttributeType
Returns:
true if users can modify it, false if only the directory can.
See Also:
AttributeType.isCanUserModify()

getUsage

public UsageEnum getUsage()
Description copied from interface: AttributeType
Determines the usage for this AttributeType.

Specified by:
getUsage in interface AttributeType
Returns:
a type safe UsageEnum
See Also:
AttributeType.getUsage()

getLength

public int getLength()
Description copied from interface: AttributeType
Gets a length limit for this AttributeType.

Specified by:
getLength in interface AttributeType
Returns:
the length of the attribute
See Also:
AttributeType.getLength()

setSingleValue

protected void setSingleValue(boolean singleValue)
Sets whether or not an attribute of this AttributeType single valued or multi-valued.

Parameters:
singleValue - true if its is single valued, false if multi-valued

setCollective

protected void setCollective(boolean collective)
Sets whether or not an attribute of this AttributeType is a collective.

Parameters:
collective - true if it is collective, false otherwise

setCanUserModify

protected void setCanUserModify(boolean canUserModify)
Sets whether or not an attribute of this AttributeType can be modified by directory users.

Parameters:
canUserModify - true if directory users can modify, false otherwise

setUsage

protected void setUsage(UsageEnum usage)
The usage class for this attributeType.

Parameters:
usage - the way attributes of this AttributeType are used in the DSA

setLength

protected void setLength(int length)
Sets the length limit of this AttributeType based on its associated syntax.

Parameters:
length - the new length to set

isAncestorOf

public boolean isAncestorOf(AttributeType descendant)
                     throws javax.naming.NamingException
Checks to see if this AttributeType is the ancestor of another attributeType.

Specified by:
isAncestorOf in interface AttributeType
Parameters:
descendant - the perspective descendant to check
Returns:
true if the descendant is truly a derived from this AttributeType
Throws:
javax.naming.NamingException - if there are problems resolving superior types

isDescentantOf

public boolean isDescentantOf(AttributeType ancestor)
                       throws javax.naming.NamingException
Checks to see if this AttributeType is the descendant of another attributeType.

Specified by:
isDescentantOf in interface AttributeType
Parameters:
ancestor - the perspective ancestor to check
Returns:
true if this AttributeType truly descends from the ancestor
Throws:
javax.naming.NamingException - if there are problems resolving superior types


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.