Class ExtensionField


  • public class ExtensionField
    extends Object
    Represents the metadata of an attribute that belongs to a SCIM resource extension.

    Attributes part of extensions, aka "extended attributes" or "custom attributes" have implicit characteristics equal to the defaults shown in section 2.2 of RFC 7643. In other words, all custom attributes have:

    • canonicalValues: none assigned
    • required: false
    • caseExact: false
    • mutability: readWrite
    • returned: default
    • uniqueness: none
    • referenceTypes: none

    The only "configurable" characteristics supported are:

    • multivalued: true/false
    • type: reference, string, datetime, decimal, and boolean (only).

    These can be tweaked via oxTrust admin web console.

    See also: Extension class.

    • Constructor Detail

      • ExtensionField

        public ExtensionField()
    • Method Detail

      • valueOf

        public static Object valueOf​(ExtensionField field,
                                     Object val)
        Tries parsing the value passed according to the data type associated to the field
        Parameters:
        field - An ExtensionField instance that determines the data type expected to be received
        val - A non-null object that represents a (hopefully valid) value for this field
        Returns:
        Null if the value is not consistent with the data type expected. Otherwise, the same value received is returned
      • valueFromString

        public static Object valueFromString​(ExtensionField field,
                                             String val)
        Equivalent to valueOf, however, a String is supplied as value. Here no validations on data type consistence takes place (it is expected that value passed reflects the type of the field). If the field is a DATE, a conversion from ISO format is done, nonetheless, DATE fields still remain being represented as Java strings
        Parameters:
        field - An ExtensionField
        val - A non-null String value
        Returns:
        A value
      • stringValueOf

        public static String stringValueOf​(ExtensionField field,
                                           Object val)
        Deprecated.
        Takes an object and a ExtensionField, and returns a String (suitable for storing in LDAP). For a field data type NUMERIC, BOOLEAN or STRING, a straight string representation is returned. When it's DATE, it is converted from ISO to generalized date time format.
        Parameters:
        field - An instance of ExtensionField
        val - A value
        Returns:
        String formated properly
      • getAttributeDefinitionType

        public AttributeDefinition.Type getAttributeDefinitionType()

        Maps the org.gluu.model.AttributeDataType associated to this ExtensionField (see getType) to a member of the enum AttributeDefinition.Type.

        The mapping is straightforward. Special case is org.gluu.model.AttributeDataType.NUMERIC mapped to Type.DECIMAL.

        Returns:
        An enum value of AttributeDefinition.Type
      • getName

        public String getName()
      • setName

        public void setName​(String name)
      • isMultiValued

        public boolean isMultiValued()
      • getType

        public org.gluu.model.attribute.AttributeDataType getType()
      • setMultiValued

        public void setMultiValued​(boolean multiValued)
      • setType

        public void setType​(org.gluu.model.attribute.AttributeDataType type)
      • getDescription

        public String getDescription()
      • setDescription

        public void setDescription​(String description)