|
|||||||||
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.ObjectClass
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=false, mayExtend=false, mayInvoke=true) public final class ObjectClass
This class defines a data structure for storing and interacting with an objectclass, which contains a collection of attributes that must and/or may be present in an entry with that objectclass.
Any methods which accesses the set of names associated with this
object class, 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, attribute types, 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 | |
---|---|
ObjectClass(java.lang.String definition,
java.lang.String primaryName,
java.util.Collection<java.lang.String> names,
java.lang.String oid,
java.lang.String description,
ObjectClass superiorClass,
java.util.Set<AttributeType> requiredAttributes,
java.util.Set<AttributeType> optionalAttributes,
ObjectClassType objectClassType,
boolean isObsolete,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> extraProperties)
Creates a new objectclass definition with the provided information. |
Method Summary | |
---|---|
java.lang.String |
getDefinition()
Retrieves the definition string used to create this objectclass. |
java.lang.String |
getDefinitionWithFileName()
Retrieves the definition string used to create this objectclass including the X-SCHEMA-FILE extension. |
ObjectClassType |
getObjectClassType()
Retrieves the objectclass type for this objectclass. |
java.util.Set<AttributeType> |
getOptionalAttributeChain()
Retrieves an unmodifiable view of the set of optional attributes for this objectclass and any superior objectclasses that it might have. |
java.util.Set<AttributeType> |
getOptionalAttributes()
Retrieves an unmodifiable view of the set of optional attributes for this objectclass. |
java.util.Set<AttributeType> |
getRequiredAttributeChain()
Retrieves an unmodifiable view of the set of all required attributes for this objectclass and any superior objectclasses that it might have. |
java.util.Set<AttributeType> |
getRequiredAttributes()
Retrieves an unmodifiable view of the set of required attributes for this objectclass. |
ObjectClass |
getSuperiorClass()
Retrieves the reference to the superior class for this objectclass. |
boolean |
isDescendantOf(ObjectClass objectClass)
Indicates whether this objectclass is a descendant of the provided class. |
boolean |
isExtensibleObject()
Indicates whether this objectclass is the extensibleObject objectclass. |
boolean |
isOptional(AttributeType attributeType)
Indicates whether the provided attribute type is included in the optional attribute list for this or any of its superior objectclasses. |
boolean |
isRequired(AttributeType attributeType)
Indicates whether the provided attribute type is included in the required attribute list for this or any of its superior objectclasses. |
boolean |
isRequiredOrOptional(AttributeType attributeType)
Indicates whether the provided attribute type is in the list of required or optional attributes for this objectclass or any of its superior classes. |
ObjectClass |
recreateFromDefinition()
Creates a new instance of this objectclass 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 ObjectClass(java.lang.String definition, java.lang.String primaryName, java.util.Collection<java.lang.String> names, java.lang.String oid, java.lang.String description, ObjectClass superiorClass, java.util.Set<AttributeType> requiredAttributes, java.util.Set<AttributeType> optionalAttributes, ObjectClassType objectClassType, boolean isObsolete, 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 objectclass.
It must not be null
.primaryName
- The primary name for this objectclass, or
null
if there is no primary name.names
- The set of names that may be used to reference this
objectclass.oid
- The OID for this objectclass. It must not be
null
.description
- The description for this objectclass, or null
if
there is no description.superiorClass
- The superior class for this objectclass, or null
if there is no superior object class.requiredAttributes
- The set of required attribute types for this
objectclass.optionalAttributes
- The set of optional attribute types for this
objectclass.objectClassType
- The objectclass type for this objectclass, or
null
to default to structural.isObsolete
- Indicates whether this objectclass is declared
"obsolete".extraProperties
- A set of extra properties for this objectclass.Method Detail |
---|
public java.lang.String getDefinition()
getDefinition
in interface SchemaFileElement
public java.lang.String getDefinitionWithFileName()
public ObjectClass recreateFromDefinition() throws DirectoryException
recreateFromDefinition
in interface SchemaFileElement
DirectoryException
- If a problem occurs while attempting
to create a new objectclass instance
from the definition string.public ObjectClass getSuperiorClass()
null
if there is none.public boolean isDescendantOf(ObjectClass objectClass)
objectClass
- The objectClass for which to make the determination.
true
if this objectclass is a descendant
of the provided class, or false
if not.public java.util.Set<AttributeType> getRequiredAttributes()
public java.util.Set<AttributeType> getRequiredAttributeChain()
public boolean isRequired(AttributeType attributeType)
attributeType
- The attribute type for which to make the determination.
true
if the provided attribute type is
required by this objectclass or any of its superior
classes, or false
if not.public java.util.Set<AttributeType> getOptionalAttributes()
public java.util.Set<AttributeType> getOptionalAttributeChain()
public boolean isOptional(AttributeType attributeType)
attributeType
- The attribute type for which to make the determination.
true
if the provided attribute type is
optional for this objectclass or any of its superior
classes, or false
if not.public boolean isRequiredOrOptional(AttributeType attributeType)
attributeType
- The attribute type for which to make the determination.
true
if the provided attribute type is
required or allowed for this objectclass or any of its
superior classes, or false
if it is not.public ObjectClassType getObjectClassType()
public boolean isExtensibleObject()
true
if this objectclass is the
extensibleObject objectclass, or false
if
it is not.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 |