Package com.unboundid.ldap.sdk.persist
Class FieldInfo
- java.lang.Object
-
- com.unboundid.ldap.sdk.persist.FieldInfo
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class FieldInfo extends java.lang.Object implements java.io.Serializable
This class provides a data structure that holds information about an annotated field.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
failOnInvalidValue()
Indicates whether attempts to initialize an object should fail if the LDAP attribute has a value that cannot be stored in the associated field.boolean
failOnTooManyValues()
Indicates whether attempts to initialize an object should fail if the LDAP attribute has multiple values but the associated field can only hold a single value.java.lang.String
getAttributeName()
Retrieves the name of the LDAP attribute used to hold values for the associated field.java.lang.Class<?>
getContainingClass()
Retrieves the class that is marked with theLDAPObject
annotation and contains the associated field.java.lang.String[]
getDefaultDecodeValues()
Retrieves the set of default values that should be assigned to the associated field if there are no values for the corresponding attribute in the LDAP entry.java.lang.String[]
getDefaultEncodeValues()
Retrieves the set of default values that should be used when creating an entry for an add operation if the associated field does not itself have any values.ObjectEncoder
getEncoder()
Retrieves the encoder that should be used for the associated field.java.lang.reflect.Field
getField()
Retrieves the field with which this object is associated.FilterUsage
getFilterUsage()
Retrieves the filter usage for the associated field.java.lang.String[]
getObjectClasses()
Retrieves the names of the object classes containing the associated attribute.boolean
includeInAdd()
Indicates whether the associated field should be included in entries generated for add operations.boolean
includeInModify()
Indicates whether the associated field should be considered for inclusion in the set of modifications generated for modify operations.boolean
includeInRDN()
Indicates whether the associated field should be used to generate entry RDNs.boolean
isRequiredForDecode()
Indicates whether the associated field should be considered required for decode operations.boolean
isRequiredForEncode()
Indicates whether the associated field should be considered required for encode operations.boolean
lazilyLoad()
Indicates whether the associated field should be lazily-loaded.boolean
supportsMultipleValues()
Indicates whether the associated field can hold multiple values.
-
-
-
Method Detail
-
getField
public java.lang.reflect.Field getField()
Retrieves the field with which this object is associated.- Returns:
- The field with which this object is associated.
-
getContainingClass
public java.lang.Class<?> getContainingClass()
Retrieves the class that is marked with theLDAPObject
annotation and contains the associated field.- Returns:
- The class that contains the associated field.
-
failOnInvalidValue
public boolean failOnInvalidValue()
Indicates whether attempts to initialize an object should fail if the LDAP attribute has a value that cannot be stored in the associated field.- Returns:
true
if an exception should be thrown if an LDAP attribute has a value that cannot be assigned to the associated field, orfalse
if the field should remain uninitialized.
-
failOnTooManyValues
public boolean failOnTooManyValues()
Indicates whether attempts to initialize an object should fail if the LDAP attribute has multiple values but the associated field can only hold a single value. Note that the value returned from this method may befalse
even when the annotation has a value oftrue
if the associated field supports multiple values.- Returns:
true
if an exception should be thrown if an attribute has too many values to hold in the associated field, orfalse
if the first value returned should be assigned to the field.
-
includeInAdd
public boolean includeInAdd()
Indicates whether the associated field should be included in entries generated for add operations. Note that the value returned from this method may betrue
even when the annotation has a value offalse
if the associated field is to be included in entry RDNs.- Returns:
true
if the associated field should be included in entries generated for add operations, orfalse
if not.
-
includeInModify
public boolean includeInModify()
Indicates whether the associated field should be considered for inclusion in the set of modifications generated for modify operations. Note that the value returned from this method may befalse
even when the annotation has a value oftrue
for theinModify
element if the associated field is to be included in entry RDNs.- Returns:
true
if the associated field should be considered for inclusion in the set of modifications generated for modify operations, orfalse
if not.
-
includeInRDN
public boolean includeInRDN()
Indicates whether the associated field should be used to generate entry RDNs.- Returns:
true
if the associated field should be used to generate entry RDNs, orfalse
if not.
-
getFilterUsage
public FilterUsage getFilterUsage()
Retrieves the filter usage for the associated field.- Returns:
- The filter usage for the associated field.
-
isRequiredForDecode
public boolean isRequiredForDecode()
Indicates whether the associated field should be considered required for decode operations.- Returns:
true
if the associated field should be considered required for decode operations, orfalse
if not.
-
isRequiredForEncode
public boolean isRequiredForEncode()
Indicates whether the associated field should be considered required for encode operations. Note that the value returned from this method may betrue
even when the annotation has a value oftrue
for therequiredForEncode
element if the associated field is to be included in entry RDNs.- Returns:
true
if the associated field should be considered required for encode operations, orfalse
if not.
-
lazilyLoad
public boolean lazilyLoad()
Indicates whether the associated field should be lazily-loaded.- Returns:
true
if the associated field should be lazily-loaded, orfalse
if not.
-
getEncoder
public ObjectEncoder getEncoder()
Retrieves the encoder that should be used for the associated field.- Returns:
- The encoder that should be used for the associated field.
-
getAttributeName
public java.lang.String getAttributeName()
Retrieves the name of the LDAP attribute used to hold values for the associated field.- Returns:
- The name of the LDAP attribute used to hold values for the associated field.
-
getDefaultDecodeValues
public java.lang.String[] getDefaultDecodeValues()
Retrieves the set of default values that should be assigned to the associated field if there are no values for the corresponding attribute in the LDAP entry.- Returns:
- The set of default values for use when instantiating the object, or an empty array if no default values are defined.
-
getDefaultEncodeValues
public java.lang.String[] getDefaultEncodeValues()
Retrieves the set of default values that should be used when creating an entry for an add operation if the associated field does not itself have any values.- Returns:
- The set of default values for use in add operations, or an empty array if no default values are defined.
-
getObjectClasses
public java.lang.String[] getObjectClasses()
Retrieves the names of the object classes containing the associated attribute.- Returns:
- The names of the object classes containing the associated attribute.
-
supportsMultipleValues
public boolean supportsMultipleValues()
Indicates whether the associated field can hold multiple values.- Returns:
true
if the associated field can hold multiple values, orfalse
if not.
-
-