Package com.unboundid.ldap.sdk.schema
Class SchemaElement
- java.lang.Object
-
- com.unboundid.ldap.sdk.schema.SchemaElement
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AttributeSyntaxDefinition,AttributeTypeDefinition,DITContentRuleDefinition,DITStructureRuleDefinition,MatchingRuleDefinition,MatchingRuleUseDefinition,NameFormDefinition,ObjectClassDefinition
@NotExtensible @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class SchemaElement extends java.lang.Object implements java.io.Serializable
This class provides a superclass for all schema element types, and defines a number of utility methods that may be used when parsing schema element strings.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SchemaElement()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static booleanallowEmptyDescription()Indicates whether to allow schema elements to contain an empty string as the value for theDESCcomponent.abstract booleanequals(java.lang.Object o)Indicates whether the provided object is equal to this schema element.protected static booleanextensionsEqual(java.util.Map<java.lang.String,java.lang.String[]> m1, java.util.Map<java.lang.String,java.lang.String[]> m2)Indicates whether the two extension maps are equivalent.abstract SchemaElementTypegetSchemaElementType()Retrieves the type of schema element that this object represents.abstract inthashCode()Retrieves a hash code for this schema element.static voidsetAllowEmptyDescription(boolean allowEmptyDescription)Specifies whether to allow schema elements to contain an empty string as the value for theDESCcomponent.abstract java.lang.StringtoString()Retrieves a string representation of this schema element, in the format described in RFC 4512.
-
-
-
Constructor Detail
-
SchemaElement
public SchemaElement()
-
-
Method Detail
-
allowEmptyDescription
public static boolean allowEmptyDescription()
Indicates whether to allow schema elements to contain an empty string as the value for theDESCcomponent. Although quoted strings are not allowed in schema elements as per RFC 4512 section 4.1, some directory servers allow it, and it may be necessary to support schema definitions used in conjunction with those servers.
The LDAP SDK does not allow empty schema element descriptions by default, but it may be updated to allow it using either thesetAllowEmptyDescription(boolean)method or by setting the value of thecom.unboundid.ldap.sdk.schema.AllowEmptyDescriptionsystem property totruebefore this class is loaded.- Returns:
trueif the LDAP SDK should allow schema elements with empty descriptions, orfalseif not.
-
setAllowEmptyDescription
public static void setAllowEmptyDescription(boolean allowEmptyDescription)
Specifies whether to allow schema elements to contain an empty string as the value for theDESCcomponent. If specified, this will override the value of thecom.unboundid.ldap.sdk.schema.AllowEmptyDescriptionsystem property.- Parameters:
allowEmptyDescription- Indicates whether to allow schema elements to contain an empty string as the value for theDESCcomponent.
-
getSchemaElementType
@NotNull public abstract SchemaElementType getSchemaElementType()
Retrieves the type of schema element that this object represents.- Returns:
- The type of schema element that this object represents.
-
hashCode
public abstract int hashCode()
Retrieves a hash code for this schema element.- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code for this schema element.
-
equals
public abstract boolean equals(@Nullable java.lang.Object o)
Indicates whether the provided object is equal to this schema element.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- The object for which to make the determination.- Returns:
trueif the provided object may be considered equal to this schema element, orfalseif not.
-
extensionsEqual
protected static boolean extensionsEqual(@NotNull java.util.Map<java.lang.String,java.lang.String[]> m1, @NotNull java.util.Map<java.lang.String,java.lang.String[]> m2)
Indicates whether the two extension maps are equivalent.- Parameters:
m1- The first schema element to examine.m2- The second schema element to examine.- Returns:
trueif the provided extension maps are equivalent, orfalseif not.
-
-