com.unboundid.scim.schema
Class AttributeDescriptor

java.lang.Object
  extended by com.unboundid.scim.schema.AttributeDescriptor

public final class AttributeDescriptor
extends Object

This class provides methods that describe the schema for a SCIM attribute. It may be used to help read and write SCIM attributes in their external XML and JSON representation, and to convert SCIM attributes to and from LDAP attributes.


Nested Class Summary
static class AttributeDescriptor.DataType
          Defines the set of well known SCIM supported datatypes.
 
Field Summary
static AttributeValueResolver<AttributeDescriptor> ATTRIBUTE_DESCRIPTOR_RESOLVER
          The AttributeValueResolver that resolves SCIM attribute values to/from AttributeDescriptor instances.
 
Method Summary
static AttributeDescriptor createAttribute(String name, AttributeDescriptor.DataType dataType, String description, String schema, boolean readOnly, boolean required, boolean caseExact, AttributeDescriptor... subAttributes)
          Create a new complex attribute descriptor with the provided information.
static AttributeDescriptor createMultiValuedAttribute(String name, String multiValuedChildName, AttributeDescriptor.DataType dataType, String description, String schema, boolean readOnly, boolean required, boolean caseExact, String[] canonicalValues, AttributeDescriptor... subAttributes)
          Create a new multi-valued attribute descriptor with the provided information.
static AttributeDescriptor createSubAttribute(String name, AttributeDescriptor.DataType dataType, String description, String schema, boolean readOnly, boolean required, boolean caseExact, String... canonicalValues)
          Create a new simple attribute descriptor with the provided information.
 boolean equals(Object obj)
          
 Collection<Entry<String>> getCanonicalValues()
          Retrieves a list of canonical type values.
 AttributeDescriptor.DataType getDataType()
          Retrieve the data type for this attribute.
 String getDescription()
          Retrieves this attribute's human readable description.
 String getMultiValuedChildName()
          The child XML element name for multi-valued attributes; e.g., the 'emails' attribute value is 'email', 'phoneNumbers', is 'phoneNumber'.
 String getName()
          The attribute name to be used in any external representation of the SCIM attribute.
 String getSchema()
          The URI for the schema that defines the SCIM attribute.
 AttributeDescriptor getSubAttribute(String externalName)
          Retrieves the attribute descriptor for a specified subordinate attribute of a complex attribute.
 Collection<AttributeDescriptor> getSubAttributes()
          Retrieves the set of descriptors for subordinate attributes of a complex attribute.
 int hashCode()
          
 boolean isCaseExact()
          Specifies if the string attribute is case sensitive.
 boolean isMultiValued()
          Indicates whether the attribute is a multi-valued attribute.
 boolean isReadOnly()
          Specifies if this attribute is mutable.
 boolean isRequired()
          Specifies if this attribute is required.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_DESCRIPTOR_RESOLVER

public static final AttributeValueResolver<AttributeDescriptor> ATTRIBUTE_DESCRIPTOR_RESOLVER
The AttributeValueResolver that resolves SCIM attribute values to/from AttributeDescriptor instances.

Method Detail

getSchema

public String getSchema()
The URI for the schema that defines the SCIM attribute.

Returns:
The URI for the schema that defines the SCIM attribute. It is never null.

getName

public String getName()
The attribute name to be used in any external representation of the SCIM attribute.

Returns:
The attribute name to be used in any external representation of the SCIM attribute. It is never null.

isMultiValued

public boolean isMultiValued()
Indicates whether the attribute is a multi-valued attribute.

Returns:
true if the attribute is multi-valued.

getMultiValuedChildName

public String getMultiValuedChildName()
The child XML element name for multi-valued attributes; e.g., the 'emails' attribute value is 'email', 'phoneNumbers', is 'phoneNumber'.

Returns:
The child XML element name or null if this attribute is not multi-valued.

getSubAttributes

public Collection<AttributeDescriptor> getSubAttributes()
Retrieves the set of descriptors for subordinate attributes of a complex attribute.

Returns:
The set of descriptors for subordinate attributes of a complex attribute, or null if the attribute is not a complex attribute.

getSubAttribute

public AttributeDescriptor getSubAttribute(String externalName)
                                    throws InvalidResourceException
Retrieves the attribute descriptor for a specified subordinate attribute of a complex attribute.

Parameters:
externalName - The external name of the subordinate attribute for which a descriptor is required.
Returns:
The attribute descriptor for the specified subordinate attribute.
Throws:
InvalidResourceException - if there is no such attribute.

getCanonicalValues

public Collection<Entry<String>> getCanonicalValues()
Retrieves a list of canonical type values.

Returns:
A list of canonical type values or null if the attribute is not a multi-valued attribute or if they are not specified.

getDataType

public AttributeDescriptor.DataType getDataType()
Retrieve the data type for this attribute.

Returns:
The data type for this attribute, or null if the attribute is not a simple attribute.

getDescription

public String getDescription()
Retrieves this attribute's human readable description.

Returns:
This attribute's human redable description.

isReadOnly

public boolean isReadOnly()
Specifies if this attribute is mutable.

Returns:
false if this attribute is mutable or true otherwise.

isRequired

public boolean isRequired()
Specifies if this attribute is required.

Returns:
true if this attribute is required for false otherwise.

isCaseExact

public boolean isCaseExact()
Specifies if the string attribute is case sensitive.

Returns:
true if this attribute is case sensitive or false otherwise.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

createSubAttribute

public static AttributeDescriptor createSubAttribute(String name,
                                                     AttributeDescriptor.DataType dataType,
                                                     String description,
                                                     String schema,
                                                     boolean readOnly,
                                                     boolean required,
                                                     boolean caseExact,
                                                     String... canonicalValues)
Create a new simple attribute descriptor with the provided information.

Parameters:
name - The attribute's name.
dataType - The attribute's data type.
description - The attribute's human readable description.
schema - The attribute's associated schema.
readOnly - Whether the attribute is mutable.
required - Whether the attribute is required.
caseExact - Whether the string attribute is case sensitive.
canonicalValues - A collection of canonical values.
Returns:
A new singular simple attribute descriptor with the provided information.

createAttribute

public static AttributeDescriptor createAttribute(String name,
                                                  AttributeDescriptor.DataType dataType,
                                                  String description,
                                                  String schema,
                                                  boolean readOnly,
                                                  boolean required,
                                                  boolean caseExact,
                                                  AttributeDescriptor... subAttributes)
Create a new complex attribute descriptor with the provided information.

Parameters:
name - The attribute's name.
dataType - The attribute's data type. attribute is multi-valued or null.
description - The attribute's human readable description.
schema - The attribute's associated schema.
readOnly - Whether the attribute is mutable.
required - Whether the attribute is required.
caseExact - Whether the string attribute is case sensitive.
subAttributes - A list specifying the contained attributes.
Returns:
A new singular complex attribute descriptor with the provided information.

createMultiValuedAttribute

public static AttributeDescriptor createMultiValuedAttribute(String name,
                                                             String multiValuedChildName,
                                                             AttributeDescriptor.DataType dataType,
                                                             String description,
                                                             String schema,
                                                             boolean readOnly,
                                                             boolean required,
                                                             boolean caseExact,
                                                             String[] canonicalValues,
                                                             AttributeDescriptor... subAttributes)
Create a new multi-valued attribute descriptor with the provided information. The normative sub-attributes for multi-valued attributes (ie. type, primary, display, operation, value) will be added.

Parameters:
name - The attribute's name.
multiValuedChildName - The attribute's child XML element name if this.
dataType - The attribute's data type. attribute is multi-valued or null.
description - The attribute's human readable description.
schema - The attribute's associated schema.
readOnly - Whether the attribute is mutable.
required - Whether the attribute is required.
caseExact - Whether the string attribute is case sensitive.
canonicalValues - The list of canonical values for the type attribute.
subAttributes - A list specifying the contained attributes.
Returns:
A new singular complex attribute descriptor with the provided information.


Copyright © 2011-2012 UnboundID. All Rights Reserved.