org.apache.directory.api.converter.schema
Class ObjectClassHolder

java.lang.Object
  extended by org.apache.directory.api.converter.schema.SchemaElementImpl
      extended by org.apache.directory.api.converter.schema.ObjectClassHolder
All Implemented Interfaces:
SchemaElement

public class ObjectClassHolder
extends SchemaElementImpl

A bean used to encapsulate the literal String values of an ObjectClass definition found within an OpenLDAP schema configuration file.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.api.converter.schema.SchemaElementImpl
description, extensions, names, obsolete, oid
 
Constructor Summary
ObjectClassHolder(String oid)
          Create an instance of ObjectClass element
 
Method Summary
 String dnToLdif(String schemaName)
          Transform a schema name to a Dn pointing to the correct position in the DIT
 ObjectClassTypeEnum getClassType()
           
 List<String> getMay()
           
 List<String> getMust()
           
 List<String> getSuperiors()
          Get the list of superior for this objectClass
 void setClassType(ObjectClassTypeEnum classType)
          Set the objectClass type.
 void setMay(List<String> may)
          Set the list of optional attributes
 void setMust(List<String> must)
          Set the list of mandatory attributes
 void setSuperiors(List<String> superiors)
          Set the list of inherited objectClasses
 String toLdif(String schemaName)
          Convert this objectClass to a Ldif string
 String toString()
           
 
Methods inherited from class org.apache.directory.api.converter.schema.SchemaElementImpl
extensionsToLdif, getDescription, getExtension, getExtensions, getNames, getOid, isObsolete, schemaToLdif, setDescription, setExtensions, setNames, setObsolete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectClassHolder

public ObjectClassHolder(String oid)
Create an instance of ObjectClass element

Parameters:
OID - the OjectClass OID
Method Detail

getSuperiors

public List<String> getSuperiors()
Get the list of superior for this objectClass

Returns:
A list of all inherited objectClasses

setSuperiors

public void setSuperiors(List<String> superiors)
Set the list of inherited objectClasses

Parameters:
superiors - The list of inherited objectClasses

getMust

public List<String> getMust()
Returns:
The list of mandatory attributes

setMust

public void setMust(List<String> must)
Set the list of mandatory attributes

Parameters:
must - The list of mandatory attributes

getMay

public List<String> getMay()
Returns:
The list of optional attributes

setMay

public void setMay(List<String> may)
Set the list of optional attributes

Parameters:
may - The list of optional attributes

getClassType

public ObjectClassTypeEnum getClassType()
Returns:
The objectClass type

setClassType

public void setClassType(ObjectClassTypeEnum classType)
Set the objectClass type.

Parameters:
classType - The objectClass type.

toLdif

public String toLdif(String schemaName)
              throws LdapException
Convert this objectClass to a Ldif string

Parameters:
schemaName - The name of the schema file containing this objectClass
Returns:
A ldif formatted string
Throws:
LdapException - If something went wrong

toString

public String toString()
Overrides:
toString in class Object
Returns:
a String representing this ObjectClass.

dnToLdif

public String dnToLdif(String schemaName)
                throws LdapException
Transform a schema name to a Dn pointing to the correct position in the DIT

Specified by:
dnToLdif in class SchemaElementImpl
Parameters:
schemaName - The schema name
Returns:
the Dn associated with this schema in the DIT
Throws:
LdapException - If the conversion goes wrong


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.