|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.types.CommonSchemaElements
org.opends.server.types.AttributeType
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=false, mayExtend=false, mayInvoke=true) public final class AttributeType
This class defines a data structure for storing and interacting with an attribute type, which contains information about the format of an attribute and the syntax and matching rules that should be used when interacting with it.
Any methods which accesses the set of names associated with this
attribute type, will retrieve the primary name as the first name,
regardless of whether or not it was contained in the original set
of names
passed to the constructor.
Where ordered sets of names, or extra properties are provided, the
ordering will be preserved when the associated fields are accessed
via their getters or via the CommonSchemaElements.toString()
methods.
Constructor Summary | |
---|---|
AttributeType(java.lang.String definition,
java.lang.String primaryName,
java.util.Collection<java.lang.String> typeNames,
java.lang.String oid,
java.lang.String description,
AttributeType superiorType,
AttributeSyntax syntax,
ApproximateMatchingRule approximateMatchingRule,
EqualityMatchingRule equalityMatchingRule,
OrderingMatchingRule orderingMatchingRule,
SubstringMatchingRule substringMatchingRule,
AttributeUsage attributeUsage,
boolean isCollective,
boolean isNoUserModification,
boolean isObsolete,
boolean isSingleValue,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> extraProperties)
Creates a new attribute type with the provided information. |
|
AttributeType(java.lang.String definition,
java.lang.String primaryName,
java.util.Collection<java.lang.String> typeNames,
java.lang.String oid,
java.lang.String description,
AttributeType superiorType,
AttributeSyntax syntax,
AttributeUsage attributeUsage,
boolean isCollective,
boolean isNoUserModification,
boolean isObsolete,
boolean isSingleValue)
Creates a new attribute type with the provided information. |
Method Summary | |
---|---|
int |
generateHashCode(AttributeValue value)
Generates a hash code for the specified attribute value. |
ApproximateMatchingRule |
getApproximateMatchingRule()
Retrieves the matching rule that should be used for approximate matching with this attribute type. |
java.lang.String |
getDefinition()
Retrieves the definition string used to create this attribute type. |
java.lang.String |
getDefinitionWithFileName()
Retrieves the definition string used to create this attribute type and including the X-SCHEMA-FILE extension. |
EqualityMatchingRule |
getEqualityMatchingRule()
Retrieves the matching rule that should be used for equality matching with this attribute type. |
OrderingMatchingRule |
getOrderingMatchingRule()
Retrieves the matching rule that should be used for ordering with this attribute type. |
SubstringMatchingRule |
getSubstringMatchingRule()
Retrieves the matching rule that should be used for substring matching with this attribute type. |
AttributeType |
getSuperiorType()
Retrieves the superior type for this attribute type. |
AttributeSyntax |
getSyntax()
Retrieves the syntax for this attribute type. |
java.lang.String |
getSyntaxOID()
Retrieves the OID for this syntax associated with this attribute type. |
AttributeUsage |
getUsage()
Retrieves the usage indicator for this attribute type. |
boolean |
isCollective()
Indicates whether this attribute type is declared "collective". |
boolean |
isNoUserModification()
Indicates whether this attribute type is declared "no-user-modification". |
boolean |
isObjectClassType()
Indicates whether this attribute type represents the "objectclass" attribute. |
boolean |
isOperational()
Indicates whether this is an operational attribute. |
boolean |
isSingleValue()
Indicates whether this attribute type is declared "single-value". |
ByteString |
normalize(ByteString value)
Attempts to normalize the provided value using the equality matching rule associated with this attribute type. |
AttributeType |
recreateFromDefinition()
Creates a new instance of this attribute type based on the definition string. |
protected void |
toStringContent(java.lang.StringBuilder buffer)
Appends a string representation of this schema definition's non-generic properties to the provided buffer. |
Methods inherited from class org.opends.server.types.CommonSchemaElements |
---|
equals, getDescription, getExtraProperty, getExtraPropertyNames, getNameOrOID, getNormalizedNames, getNormalizedPrimaryName, getOID, getPrimaryName, getSchemaFile, getUserDefinedNames, hashCode, hasName, hasNameOrOID, isObsolete, setExtraProperty, setExtraProperty, setSchemaFile, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opends.server.types.SchemaFileElement |
---|
getSchemaFile, setSchemaFile |
Constructor Detail |
---|
public AttributeType(java.lang.String definition, java.lang.String primaryName, java.util.Collection<java.lang.String> typeNames, java.lang.String oid, java.lang.String description, AttributeType superiorType, AttributeSyntax syntax, AttributeUsage attributeUsage, boolean isCollective, boolean isNoUserModification, boolean isObsolete, boolean isSingleValue)
If no primaryName
is specified, but a set of
names
is specified, then the first name retrieved
from the set of names
will be used as the primary
name.
definition
- The definition string used to create this attribute
type. It must not be null
.primaryName
- The primary name for this attribute type, or
null
if there is no primary name.typeNames
- The full set of names for this attribute type, or
null
if there are no names.oid
- The OID for this attribute type. It must not be
null
.description
- The description for the attribute type, or
null
if there is no description.superiorType
- The reference to the superior type for this attribute
type, or null
if there is no superior
type.syntax
- The syntax for this attribute type, or null
if there is no syntax.attributeUsage
- The attribute usage for this attribute type, or
null
to default to user applications.isCollective
- Indicates whether this attribute type is declared
"collective".isNoUserModification
- Indicates whether this attribute type is declared
"no-user-modification".isObsolete
- Indicates whether this attribute type is declared
"obsolete".isSingleValue
- Indicates whether this attribute type is declared
"single-value".public AttributeType(java.lang.String definition, java.lang.String primaryName, java.util.Collection<java.lang.String> typeNames, java.lang.String oid, java.lang.String description, AttributeType superiorType, AttributeSyntax syntax, ApproximateMatchingRule approximateMatchingRule, EqualityMatchingRule equalityMatchingRule, OrderingMatchingRule orderingMatchingRule, SubstringMatchingRule substringMatchingRule, AttributeUsage attributeUsage, boolean isCollective, boolean isNoUserModification, boolean isObsolete, boolean isSingleValue, java.util.Map<java.lang.String,java.util.List<java.lang.String>> extraProperties)
If no primaryName
is specified, but a set of
names
is specified, then the first name retrieved
from the set of names
will be used as the primary
name.
definition
- The definition string used to create this attribute
type. It must not be null
.primaryName
- The primary name for this attribute type, or
null
if there is no primary name.typeNames
- The full set of names for this attribute type, or
null
if there are no names.oid
- The OID for this attribute type. It must not be
null
.description
- The description for the attribute type, or
null
if there is no description.superiorType
- The reference to the superior type for this attribute
type, or null
if there is no superior
type.syntax
- The syntax for this attribute type, or null
if there is no syntax.approximateMatchingRule
- The approximate matching rule for this attribute type,
or null
if there is no rule.equalityMatchingRule
- The equality matching rule for this attribute type, or
null
if there is no rule.orderingMatchingRule
- The ordering matching rule for this attribute type, or
null
if there is no rule.substringMatchingRule
- The substring matching rule for this attribute type, or
null
if there is no rule.attributeUsage
- The attribute usage for this attribute type, or
null
to default to user applications.isCollective
- Indicates whether this attribute type is declared
"collective".isNoUserModification
- Indicates whether this attribute type is declared
"no-user-modification".isObsolete
- Indicates whether this attribute type is declared
"obsolete".isSingleValue
- Indicates whether this attribute type is declared
"single-value".extraProperties
- A set of extra properties for this attribute type, or
null
if there are no extra properties.Method Detail |
---|
public java.lang.String getDefinition()
getDefinition
in interface SchemaFileElement
public java.lang.String getDefinitionWithFileName()
public AttributeType recreateFromDefinition() throws DirectoryException
recreateFromDefinition
in interface SchemaFileElement
DirectoryException
- If a problem occurs while attempting
to create a new attribute type
instance from the definition string.public AttributeType getSuperiorType()
null
if it does not have one.public AttributeSyntax getSyntax()
public java.lang.String getSyntaxOID()
public ApproximateMatchingRule getApproximateMatchingRule()
public EqualityMatchingRule getEqualityMatchingRule()
public OrderingMatchingRule getOrderingMatchingRule()
public SubstringMatchingRule getSubstringMatchingRule()
public AttributeUsage getUsage()
public boolean isOperational()
true
if this is an operational attribute,
or false
if not.public boolean isCollective()
true
if this attribute type is declared
"collective", or false
if not.public boolean isNoUserModification()
true
if this attribute type is declared
"no-user-modification", or false
if not.public boolean isSingleValue()
true
if this attribute type is declared
"single-value", or false
if not.public boolean isObjectClassType()
true
if this attribute type is the
objectclass type, or false
if not.public ByteString normalize(ByteString value) throws DirectoryException
value
- The value to be normalized.
DirectoryException
- If this attribute type does not have
an equality matching rule, or if the
provided value could not be
normalized.public int generateHashCode(AttributeValue value)
value
- The attribute value for which to generate the hash
code.
protected void toStringContent(java.lang.StringBuilder buffer)
toStringContent
in class CommonSchemaElements
buffer
- The buffer to which the information should be
appended.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |