Class SchemaElement

java.lang.Object
com.unboundid.ldap.sdk.schema.SchemaElement
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AttributeSyntaxDefinition, AttributeTypeDefinition, DITContentRuleDefinition, DITStructureRuleDefinition, MatchingRuleDefinition, MatchingRuleUseDefinition, NameFormDefinition, ObjectClassDefinition

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:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Indicates whether to allow schema elements to contain an empty string as the value for the DESC component.
    abstract boolean
    Indicates whether the provided object is equal to this schema element.
    protected static boolean
    Indicates whether the two extension maps are equivalent.
    Retrieves the type of schema element that this object represents.
    abstract int
    Retrieves a hash code for this schema element.
    static void
    setAllowEmptyDescription(boolean allowEmptyDescription)
    Specifies whether to allow schema elements to contain an empty string as the value for the DESC component.
    abstract String
    Retrieves a string representation of this schema element, in the format described in RFC 4512.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • allowEmptyDescription

      public static boolean allowEmptyDescription()
      Indicates whether to allow schema elements to contain an empty string as the value for the DESC component. 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 the setAllowEmptyDescription(boolean) method or by setting the value of the com.unboundid.ldap.sdk.schema.AllowEmptyDescription system property to true before this class is loaded.
      Returns:
      true if the LDAP SDK should allow schema elements with empty descriptions, or false if not.
    • setAllowEmptyDescription

      public static void setAllowEmptyDescription(boolean allowEmptyDescription)
      Specifies whether to allow schema elements to contain an empty string as the value for the DESC component. If specified, this will override the value of the com.unboundid.ldap.sdk.schema.AllowEmptyDescription system property.
      Parameters:
      allowEmptyDescription - Indicates whether to allow schema elements to contain an empty string as the value for the DESC component.
    • 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:
      hashCode in class Object
      Returns:
      A hash code for this schema element.
    • equals

      public abstract boolean equals(@Nullable Object o)
      Indicates whether the provided object is equal to this schema element.
      Overrides:
      equals in class Object
      Parameters:
      o - The object for which to make the determination.
      Returns:
      true if the provided object may be considered equal to this schema element, or false if not.
    • extensionsEqual

      protected static boolean extensionsEqual(@NotNull Map<String,String[]> m1, @NotNull Map<String,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:
      true if the provided extension maps are equivalent, or false if not.
    • toString

      @NotNull public abstract String toString()
      Retrieves a string representation of this schema element, in the format described in RFC 4512.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this schema element, in the format described in RFC 4512.