Class ObjectClassHolder
- java.lang.Object
-
- org.apache.directory.api.ldap.schema.converter.SchemaElementImpl
-
- org.apache.directory.api.ldap.schema.converter.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.ldap.schema.converter.SchemaElementImpl
description, extensions, names, obsolete, oid
-
-
Constructor Summary
Constructors Constructor Description ObjectClassHolder(String oid)Create an instance of ObjectClass element
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdnToLdif(String schemaName)Transform a schema name to a Dn pointing to the correct position in the DITObjectClassTypeEnumgetClassType()List<String>getMay()List<String>getMust()List<String>getSuperiors()Get the list of superior for this objectClassvoidsetClassType(ObjectClassTypeEnum classType)Set the objectClass type.voidsetMay(List<String> may)Set the list of optional attributesvoidsetMust(List<String> must)Set the list of mandatory attributesvoidsetSuperiors(List<String> superiors)Set the list of inherited objectClassesStringtoLdif(String schemaName)Convert this objectClass to a Ldif stringStringtoString()-
Methods inherited from class org.apache.directory.api.ldap.schema.converter.SchemaElementImpl
extensionsToLdif, getDescription, getExtension, getExtensions, getNames, getOid, isObsolete, schemaToLdif, setDescription, setExtensions, setNames, setObsolete
-
-
-
-
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
-
setMust
public void setMust(List<String> must)
Set the list of mandatory attributes- Parameters:
must- The list of mandatory 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()
-
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:
dnToLdifin classSchemaElementImpl- Parameters:
schemaName- The schema name- Returns:
- the Dn associated with this schema in the DIT
- Throws:
LdapException- If the conversion goes wrong
-
-