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

java.lang.Object
  extended by org.apache.directory.api.converter.schema.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
protected  String description
          The schema element description
protected  Map<String,List<String>> extensions
          The optional list of extensions
protected  List<String> names
          The list of names for this schemaElements
protected  boolean obsolete
          The obsolete flag
protected  String oid
          The schema element oid
 
Constructor Summary
SchemaElementImpl()
           
 
Method Summary
abstract  String dnToLdif(String schemaName)
          Transform a Schema Element to a LDIF String
protected  String extensionsToLdif(String id)
          Return the extensions formated as Ldif lines
 String getDescription()
          
 List<String> getExtension(String key)
          
 Map<String,List<String>> getExtensions()
          
 List<String> getNames()
           
 String getOid()
          Returns the schema element's OID
 boolean isObsolete()
          Tells if the attributeType is obsolete
protected  String schemaToLdif(String schemaName, String type)
          Transform a Schema to a LDIF formated String
 void setDescription(String description)
          Set the schema element's description
 void setExtensions(Map<String,List<String>> extensions)
          Set a list of extensions for a schemaElement
 void setNames(List<String> names)
          Set a list of names for a schemaElement
 void setObsolete(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.converter.schema.SchemaElement
toLdif
 

Field Detail

oid

protected String oid
The schema element oid


description

protected String description
The schema element description


names

protected List<String> names
The list of names for this schemaElements


obsolete

protected boolean obsolete
The obsolete flag


extensions

protected Map<String,List<String>> extensions
The optional list of extensions

Constructor Detail

SchemaElementImpl

public SchemaElementImpl()
Method Detail

isObsolete

public boolean isObsolete()
Tells if the attributeType is obsolete

Specified by:
isObsolete in interface SchemaElement
Returns:
true if the schema element is obsolete, folse otherwise

setObsolete

public void setObsolete(boolean obsolete)
Set the obsolete flag

Specified by:
setObsolete in interface SchemaElement
Parameters:
obsolete - The value to be set

getOid

public String getOid()
Returns the schema element's OID

Specified by:
getOid in interface SchemaElement

getDescription

public String getDescription()

Specified by:
getDescription in interface SchemaElement
Returns:
Return the schema element description

setDescription

public void setDescription(String description)
Set the schema element's description

Specified by:
setDescription in interface SchemaElement
Parameters:
description - The schema element's description

getNames

public List<String> getNames()
Specified by:
getNames in interface SchemaElement
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:
setNames in interface SchemaElement
Parameters:
names - The list of names of this schemaElement

getExtension

public List<String> getExtension(String key)

Specified by:
getExtension in interface SchemaElement
Parameters:
key - the Extension key
Returns:
The list of a values for a given extension

getExtensions

public Map<String,List<String>> getExtensions()

Specified by:
getExtensions in interface SchemaElement
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:
setExtensions in interface SchemaElement
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 transform
type - The ObjectClass type
Returns:
A LDIF String representing the schema
Throws:
LdapException - If the transformation can't be done


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