Package org.ldaptive.schema
Class AttributeType
- java.lang.Object
-
- org.ldaptive.schema.AbstractSchemaElement
-
- org.ldaptive.schema.AbstractNamedSchemaElement
-
- org.ldaptive.schema.AttributeType
-
- All Implemented Interfaces:
SchemaElement
public class AttributeType extends AbstractNamedSchemaElement
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- Author:
- Middleware Services
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAttributeType.DefaultDefinitionFunctionParses an attribute type definition using a char buffer.static classAttributeType.RegexDefinitionFunctionParses an attribute type definition using a regular expression.
-
Constructor Summary
Constructors Constructor Description AttributeType(java.lang.String s)Creates a new attribute type.AttributeType(java.lang.String oid, java.lang.String[] names, java.lang.String description, boolean obsolete, java.lang.String superiorType, java.lang.String equalityMatchingRule, java.lang.String orderingMatchingRule, java.lang.String substringMatchingRule, java.lang.String syntaxOID, boolean singleValued, boolean collective, boolean noUserModification, AttributeUsage usage, Extensions extensions)Creates a new attribute type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.Stringformat()Returns this schema element as formatted string per RFC 4512.java.lang.StringgetEqualityMatchingRule()Returns the equality matching rule.java.lang.StringgetOID()Returns the oid.java.lang.StringgetOrderingMatchingRule()Returns the ordering matching rule.java.lang.StringgetSubstringMatchingRule()Returns the substring matching rule.java.lang.StringgetSuperiorType()Returns the superior type.java.lang.StringgetSyntaxOID()Returns the syntax oid.java.lang.StringgetSyntaxOID(boolean withBoundCount)Returns the syntax oid.intgetSyntaxOIDBoundCount()Returns the syntax oid bound count.AttributeUsagegetUsage()Returns the usage.inthashCode()booleanisCollective()Returns whether this attribute type is collective.booleanisNoUserModification()Returns whether this attribute type allows user modification.booleanisSingleValued()Returns whether this attribute type is single valued.static AttributeTypeparse(java.lang.String definition)Parses the supplied definition string and creates an initialized attribute type.voidsetCollective(boolean b)Sets whether this attribute type is collective.voidsetEqualityMatchingRule(java.lang.String s)Sets the equality matching rule.voidsetNoUserModification(boolean b)Sets whether this attribute type allows user modification.voidsetOrderingMatchingRule(java.lang.String s)Sets the ordering matching rule.voidsetSingleValued(boolean b)Sets whether this attribute type is single valued.voidsetSubstringMatchingRule(java.lang.String s)Sets the substring matching rule.voidsetSuperiorType(java.lang.String s)Sets the superior type.voidsetSyntaxOID(java.lang.String s)Sets the syntax oid.voidsetUsage(AttributeUsage u)Sets the usage.java.lang.StringtoString()-
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
-
-
-
-
Constructor Detail
-
AttributeType
public AttributeType(java.lang.String s)
Creates a new attribute type.- Parameters:
s- oid
-
AttributeType
public AttributeType(java.lang.String oid, java.lang.String[] names, java.lang.String description, boolean obsolete, java.lang.String superiorType, java.lang.String equalityMatchingRule, java.lang.String orderingMatchingRule, java.lang.String substringMatchingRule, java.lang.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 Detail
-
getOID
public java.lang.String getOID()
Returns the oid.- Returns:
- oid
-
getSuperiorType
public java.lang.String getSuperiorType()
Returns the superior type.- Returns:
- superior type
-
setSuperiorType
public void setSuperiorType(java.lang.String s)
Sets the superior type.- Parameters:
s- superior type
-
getEqualityMatchingRule
public java.lang.String getEqualityMatchingRule()
Returns the equality matching rule.- Returns:
- equality matching rule
-
setEqualityMatchingRule
public void setEqualityMatchingRule(java.lang.String s)
Sets the equality matching rule.- Parameters:
s- equality matching rule
-
getOrderingMatchingRule
public java.lang.String getOrderingMatchingRule()
Returns the ordering matching rule.- Returns:
- ordering matching rule
-
setOrderingMatchingRule
public void setOrderingMatchingRule(java.lang.String s)
Sets the ordering matching rule.- Parameters:
s- ordering matching rule
-
getSubstringMatchingRule
public java.lang.String getSubstringMatchingRule()
Returns the substring matching rule.- Returns:
- substring matching rule
-
setSubstringMatchingRule
public void setSubstringMatchingRule(java.lang.String s)
Sets the substring matching rule.- Parameters:
s- substring matching rule
-
getSyntaxOID
public java.lang.String getSyntaxOID()
Returns the syntax oid.- Returns:
- syntax oid
-
getSyntaxOID
public java.lang.String getSyntaxOID(boolean withBoundCount)
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
public void setSyntaxOID(java.lang.String s)
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
public AttributeUsage getUsage()
Returns the usage.- Returns:
- usage
-
setUsage
public void setUsage(AttributeUsage u)
Sets the usage.- Parameters:
u- attribute usage
-
parse
public static AttributeType parse(java.lang.String definition) throws SchemaParseException
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
public java.lang.String format()
Description copied from interface:SchemaElementReturns this schema element as formatted string per RFC 4512.- Returns:
- formatted string
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classAbstractSchemaElement
-
hashCode
public int hashCode()
- Specified by:
hashCodein classAbstractSchemaElement
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-