Package org.ldaptive.schema
Class NameForm
- java.lang.Object
-
- org.ldaptive.schema.AbstractSchemaElement
-
- org.ldaptive.schema.AbstractNamedSchemaElement
-
- org.ldaptive.schema.NameForm
-
- All Implemented Interfaces:
SchemaElement
public class NameForm extends AbstractNamedSchemaElement
Bean for a name form schema element.NameFormDescription = LPAREN WSP numericoid ; object identifier [ SP "NAME" SP qdescrs ] ; short names (descriptors) [ SP "DESC" SP qdstring ] ; description [ SP "OBSOLETE" ] ; not active SP "OC" SP oid ; structural object class SP "MUST" SP oids ; attribute types [ SP "MAY" SP oids ] ; attribute types extensions WSP RPAREN ; extensions
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NameForm.DefaultDefinitionFunction
Parses a name form definition using a char buffer.static class
NameForm.RegexDefinitionFunction
Parses a name form definition using a regular expression.
-
Field Summary
Fields Modifier and Type Field Description private static int
HASH_CODE_SEED
hash code seed.private String
oid
OID.private String[]
optionalAttributes
Optional attributes.private String[]
requiredAttributes
Required attributes.private String
structuralClass
Structural object class.
-
Constructor Summary
Constructors Constructor Description NameForm(String s)
Creates a new name form.NameForm(String oid, String[] names, String description, boolean obsolete, String structuralClass, String[] requiredAttributes, String[] optionalAttributes, Extensions extensions)
Creates a new name form.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
format()
Returns this schema element as formatted string per RFC 4512.String
getOID()
Returns the oid.String[]
getOptionalAttributes()
Returns the optional attributes.String[]
getRequiredAttributes()
Returns the required attributes.String
getStructuralClass()
Returns the structural object class.int
hashCode()
static NameForm
parse(String definition)
Parses the supplied definition string and creates an initialized name form.void
setOptionalAttributes(String[] s)
Sets the optional attributes.void
setRequiredAttributes(String[] s)
Sets the required attributes.void
setStructuralClass(String s)
Sets the structural object class.String
toString()
-
Methods inherited from class org.ldaptive.schema.AbstractNamedSchemaElement
getName, getNames, hasName, isObsolete, setNames, setObsolete
-
Methods inherited from class org.ldaptive.schema.AbstractSchemaElement
containsBooleanExtension, getDescription, getExtensions, setDescription, setExtensions
-
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
oid
private final String oid
OID.
-
structuralClass
private String structuralClass
Structural object class.
-
requiredAttributes
private String[] requiredAttributes
Required attributes.
-
optionalAttributes
private String[] optionalAttributes
Optional attributes.
-
-
Constructor Detail
-
NameForm
public NameForm(String s)
Creates a new name form.- Parameters:
s
- oid
-
NameForm
public NameForm(String oid, String[] names, String description, boolean obsolete, String structuralClass, String[] requiredAttributes, String[] optionalAttributes, Extensions extensions)
Creates a new name form.- Parameters:
oid
- oidnames
- namesdescription
- descriptionobsolete
- obsoletestructuralClass
- structural object classrequiredAttributes
- required attributesoptionalAttributes
- optional attributesextensions
- extensions
-
-
Method Detail
-
getOID
public String getOID()
Returns the oid.- Returns:
- oid
-
getStructuralClass
public String getStructuralClass()
Returns the structural object class.- Returns:
- structural object class
-
setStructuralClass
public void setStructuralClass(String s)
Sets the structural object class.- Parameters:
s
- structural object class
-
getRequiredAttributes
public String[] getRequiredAttributes()
Returns the required attributes.- Returns:
- required attributes
-
setRequiredAttributes
public void setRequiredAttributes(String[] s)
Sets the required attributes.- Parameters:
s
- required attributes
-
getOptionalAttributes
public String[] getOptionalAttributes()
Returns the optional attributes.- Returns:
- optional attributes
-
setOptionalAttributes
public void setOptionalAttributes(String[] s)
Sets the optional attributes.- Parameters:
s
- optional attributes
-
parse
public static NameForm parse(String definition) throws SchemaParseException
Parses the supplied definition string and creates an initialized name form.- Parameters:
definition
- to parse- Returns:
- name form
- Throws:
SchemaParseException
- if the supplied definition is invalid
-
format
public String format()
Description copied from interface:SchemaElement
Returns this schema element as formatted string per RFC 4512.- Returns:
- formatted string
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractSchemaElement
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classAbstractSchemaElement
-
-