Package org.ldaptive.schema
Class AttributeType
- All Implemented Interfaces:
Freezable,NamedElement,SchemaElement<String>
Bean for an attribute type schema element.
AttributeTypeDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
[ SP "SUP" SP oid ] ; supertype
[ SP "EQUALITY" SP oid ] ; equality matching rule
[ SP "ORDERING" SP oid ] ; ordering matching rule
[ SP "SUBSTR" SP oid ] ; substrings matching rule
[ SP "SYNTAX" SP noidlen ] ; value syntax
[ SP "SINGLE-VALUE" ] ; single-value
[ SP "COLLECTIVE" ] ; collective
[ SP "NO-USER-MODIFICATION" ] ; not user modifiable
[ SP "USAGE" SP usage ] ; usage
extensions WSP RPAREN ; extensions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classParses an attribute type definition using a char buffer.static classCreates a string representation of an attribute type.static classParses an attribute type definition using a regular expression. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanCollective.private StringEquality matching rule.private static final inthash code seed.private booleanNo user modification.private final StringOID.private StringOrdering matching rule.private booleanSingle valued.private StringSubstring matching rule.private StringSuperior type.private StringSyntax OID.private AttributeUsageUsage. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new attribute type.AttributeType(String oid, String[] names, String description, boolean obsolete, String superiorType, String equalityMatchingRule, String orderingMatchingRule, String substringMatchingRule, String syntaxOID, boolean singleValued, boolean collective, boolean noUserModification, AttributeUsage usage, Extensions extensions) Creates a new attribute type. -
Method Summary
Modifier and TypeMethodDescriptionbooleanformat()Returns this schema element as formatted string per RFC 4512.format(SchemaElementFormatter<AttributeType> formatter) Returns a string representation of this element.Returns the key for this element.Returns the equality matching rule.getOID()Returns the oid.Returns the ordering matching rule.Returns the substring matching rule.Returns the superior type.Returns the syntax oid.getSyntaxOID(boolean withBoundCount) Returns the syntax oid.intReturns the syntax oid bound count.getUsage()Returns the usage.inthashCode()booleanReturns whether this attribute type is collective.booleanReturns whether this attribute type allows user modification.booleanReturns whether this attribute type is single valued.static AttributeTypeParses the supplied definition string and creates an initialized attribute type.voidsetCollective(boolean b) Sets whether this attribute type is collective.voidSets the equality matching rule.voidsetNoUserModification(boolean b) Sets whether this attribute type allows user modification.voidSets the ordering matching rule.voidsetSingleValued(boolean b) Sets whether this attribute type is single valued.voidSets the substring matching rule.voidSets the superior type.voidSets the syntax oid.voidSets the usage.toString()Methods inherited from class org.ldaptive.schema.AbstractNamedSchemaElement
getName, getNames, hasName, isObsolete, setNames, setObsoleteMethods inherited from class org.ldaptive.schema.AbstractSchemaElement
containsBooleanExtension, freeze, getDescription, getExtensions, setDescription, setExtensionsMethods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
Field Details
-
HASH_CODE_SEED
private static final int HASH_CODE_SEEDhash code seed.- See Also:
-
oid
OID. -
superiorType
Superior type. -
equalityMatchingRule
Equality matching rule. -
orderingMatchingRule
Ordering matching rule. -
substringMatchingRule
Substring matching rule. -
syntaxOID
Syntax OID. -
singleValued
private boolean singleValuedSingle valued. -
collective
private boolean collectiveCollective. -
noUserModification
private boolean noUserModificationNo user modification. -
usage
Usage.
-
-
Constructor Details
-
AttributeType
Creates a new attribute type.- Parameters:
s- oid
-
AttributeType
public AttributeType(String oid, String[] names, String description, boolean obsolete, String superiorType, String equalityMatchingRule, String orderingMatchingRule, String substringMatchingRule, String syntaxOID, boolean singleValued, boolean collective, boolean noUserModification, AttributeUsage usage, Extensions extensions) Creates a new attribute type.- Parameters:
oid- oidnames- namesdescription- descriptionobsolete- obsoletesuperiorType- superior typeequalityMatchingRule- equality matching ruleorderingMatchingRule- ordering matching rulesubstringMatchingRule- substring matching rulesyntaxOID- syntax OIDsingleValued- single valuedcollective- collectivenoUserModification- no user modificationusage- usageextensions- extensions
-
-
Method Details
-
getElementKey
Description copied from interface:SchemaElementReturns the key for this element. Typically, an OID but may also be an integer.- Returns:
- element key
-
getOID
Returns the oid.- Returns:
- oid
-
getSuperiorType
Returns the superior type.- Returns:
- superior type
-
setSuperiorType
Sets the superior type.- Parameters:
s- superior type
-
getEqualityMatchingRule
Returns the equality matching rule.- Returns:
- equality matching rule
-
setEqualityMatchingRule
Sets the equality matching rule.- Parameters:
s- equality matching rule
-
getOrderingMatchingRule
Returns the ordering matching rule.- Returns:
- ordering matching rule
-
setOrderingMatchingRule
Sets the ordering matching rule.- Parameters:
s- ordering matching rule
-
getSubstringMatchingRule
Returns the substring matching rule.- Returns:
- substring matching rule
-
setSubstringMatchingRule
Sets the substring matching rule.- Parameters:
s- substring matching rule
-
getSyntaxOID
Returns the syntax oid.- Returns:
- syntax oid
-
getSyntaxOID
Returns the syntax oid.- Parameters:
withBoundCount- whether the bound count should be included- Returns:
- syntax oid
-
getSyntaxOIDBoundCount
public int getSyntaxOIDBoundCount()Returns the syntax oid bound count.- Returns:
- syntax oid bound count
-
setSyntaxOID
Sets the syntax oid.- Parameters:
s- syntax oid
-
isSingleValued
public boolean isSingleValued()Returns whether this attribute type is single valued.- Returns:
- whether this attribute type is single valued
-
setSingleValued
public void setSingleValued(boolean b) Sets whether this attribute type is single valued.- Parameters:
b- whether this attribute type is single valued
-
isCollective
public boolean isCollective()Returns whether this attribute type is collective.- Returns:
- whether this attribute type is collective
-
setCollective
public void setCollective(boolean b) Sets whether this attribute type is collective.- Parameters:
b- whether this attribute type is collective
-
isNoUserModification
public boolean isNoUserModification()Returns whether this attribute type allows user modification.- Returns:
- whether this attribute type allows user modification
-
setNoUserModification
public void setNoUserModification(boolean b) Sets whether this attribute type allows user modification.- Parameters:
b- whether this attribute type allows user modification
-
getUsage
Returns the usage.- Returns:
- usage
-
setUsage
Sets the usage.- Parameters:
u- attribute usage
-
parse
Parses the supplied definition string and creates an initialized attribute type.- Parameters:
definition- to parse- Returns:
- attribute type
- Throws:
SchemaParseException- if the supplied definition is invalid
-
format
Description copied from interface:SchemaElementReturns this schema element as formatted string per RFC 4512.- Returns:
- formatted string
-
format
Returns a string representation of this element.- Parameters:
formatter- to format this element- Returns:
- formatted schema element
-
equals
- Overrides:
equalsin classAbstractSchemaElement<String>
-
hashCode
public int hashCode()- Specified by:
hashCodein classAbstractSchemaElement<String>
-
toString
-