Class SchemaElementImpl
- java.lang.Object
-
- org.apache.directory.api.ldap.schema.converter.SchemaElementImpl
-
- All Implemented Interfaces:
SchemaElement
- Direct Known Subclasses:
AttributeTypeHolder,ObjectClassHolder
public abstract class SchemaElementImpl extends Object implements SchemaElement
An abstract SchemaElement implementation. It contains shared elements from AttributeType and ObjectClass, like obsolete, oid, description, names and extensions (not implemented)- Author:
- Apache Directory Project
-
-
Field Summary
Fields Modifier and Type Field Description protected StringdescriptionThe schema element descriptionprotected Map<String,List<String>>extensionsThe optional list of extensionsprotected List<String>namesThe list of names for this schemaElementsprotected booleanobsoleteThe obsolete flagprotected StringoidThe schema element oid
-
Constructor Summary
Constructors Constructor Description SchemaElementImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringdnToLdif(String schemaName)Transform a Schema Element to a LDIF Stringprotected StringextensionsToLdif(String id)Return the extensions formated as Ldif linesStringgetDescription()List<String>getExtension(String key)Map<String,List<String>>getExtensions()List<String>getNames()StringgetOid()booleanisObsolete()Tells if the attributeType is obsoleteprotected StringschemaToLdif(String schemaName, String type)Transform a Schema to a LDIF formated StringvoidsetDescription(String description)Set the schema element's descriptionvoidsetExtensions(Map<String,List<String>> extensions)Set a list of extensions for a schemaElementvoidsetNames(List<String> names)Set a list of names for a schemaElementvoidsetObsolete(boolean obsolete)Set the obsolete flag-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.schema.converter.SchemaElement
toLdif
-
-
-
-
Method Detail
-
isObsolete
public boolean isObsolete()
Tells if the attributeType is obsolete- Specified by:
isObsoletein interfaceSchemaElement- Returns:
- true if the schema element is obsolete, folse otherwise
-
setObsolete
public void setObsolete(boolean obsolete)
Set the obsolete flag- Specified by:
setObsoletein interfaceSchemaElement- Parameters:
obsolete- The value to be set
-
getOid
public String getOid()
- Specified by:
getOidin interfaceSchemaElement- Returns:
- the schema element's OID
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceSchemaElement- Returns:
- Return the schema element description
-
setDescription
public void setDescription(String description)
Set the schema element's description- Specified by:
setDescriptionin interfaceSchemaElement- Parameters:
description- The schema element's description
-
getNames
public List<String> getNames()
- Specified by:
getNamesin interfaceSchemaElement- Returns:
- The list of names for the schemaElement
- See Also:
SchemaElement.getNames()
-
setNames
public void setNames(List<String> names)
Set a list of names for a schemaElement- Specified by:
setNamesin interfaceSchemaElement- Parameters:
names- The list of names of this schemaElement
-
getExtension
public List<String> getExtension(String key)
- Specified by:
getExtensionin interfaceSchemaElement- Parameters:
key- the Extension key- Returns:
- The list of a values for a given extension
-
getExtensions
public Map<String,List<String>> getExtensions()
- Specified by:
getExtensionsin interfaceSchemaElement- Returns:
- The list of extensions for the schemaElement
-
setExtensions
public void setExtensions(Map<String,List<String>> extensions)
Set a list of extensions for a schemaElement- Specified by:
setExtensionsin interfaceSchemaElement- Parameters:
extensions- The list of extensions of this schemaElement
-
dnToLdif
public abstract String dnToLdif(String schemaName) throws LdapException
Transform a Schema Element to a LDIF String- Parameters:
schemaName- The schema element to transform- Returns:
- The Schema Element as a ldif String
- Throws:
LdapException- If the conversion goes wrong
-
extensionsToLdif
protected String extensionsToLdif(String id) throws LdapException
Return the extensions formated as Ldif lines- Parameters:
id- The attributeId : can be m-objectClassExtension or m-attributeTypeExtension- Returns:
- The extensions formated as ldif lines
- Throws:
LdapException- If the conversion goes wrong
-
schemaToLdif
protected String schemaToLdif(String schemaName, String type) throws LdapException
Transform a Schema to a LDIF formated String- Parameters:
schemaName- The schema to transformtype- The ObjectClass type- Returns:
- A LDIF String representing the schema
- Throws:
LdapException- If the transformation can't be done
-
-