@Documented @Retention(value=RUNTIME) @Target(value=FIELD) public @interface LDAPField
LDAPObject
annotation type. Fields marked
with this annotation type must be non-final and non-static, but they may have
any access modifier (including public
, protected
,
private
, or no access modifier at all indicating package-level
access). The associated attribute must not be referenced by any other
LDAPField
annotation types.Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
attribute
The name of the attribute type in which the associated field will be stored
in LDAP entries.
|
java.lang.String[] |
defaultDecodeValue
The string representations of the default values to assign to this
field if there are no values for the associated attribute in the
corresponding LDAP entry being used to initialize the object.
|
java.lang.String[] |
defaultEncodeValue
The string representations of the default values to use when adding an
entry to the directory if this field has a
null value. |
java.lang.Class<? extends ObjectEncoder> |
encoderClass
The class that provides the logic for encoding a field to an LDAP
attribute, and for initializing a field from an LDAP attribute.
|
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.
|
FilterUsage |
filterUsage
Indicates whether and under what circumstances the value of this field may
be included in a search filter generated to search for entries that match
the object.
|
boolean |
inAdd
Indicates whether this field should be included in the LDAP entry that is
generated when adding a new instance of the associated object to the
directory.
|
boolean |
inModify
Indicates whether this field should be examined and included in the set of
LDAP modifications if it has been changed when modifying an existing
instance of the associated object in the directory.
|
boolean |
inRDN
Indicates whether the value of this field should be included in the RDN of
entries created from the associated object.
|
boolean |
lazilyLoad
Indicates whether this field should be lazily loaded, which means that the
associated attribute will not be retrieved by default so this field will
be uninitialized.
|
java.lang.String[] |
objectClass
The names of the object classes in which the associated attribute may be
used.
|
boolean |
requiredForDecode
Indicates whether this field is required to be assigned a value in decode
processing.
|
boolean |
requiredForEncode
Indicates whether this field is required to have a value for encode
processing.
|
public abstract boolean failOnInvalidValue
true
, then an exception will be thrown in such instances.
If this is false
, then the field will remain uninitialized, and
attempts to modify the corresponding entry in the directory may cause the
existing values to be lost.true
if attempts to initialize an object should fail if
the LDAP attribute has a value that cannot be stored in the
associated field, or false
if not.public abstract boolean failOnTooManyValues
true
, then an exception will be thrown in
such instances. If this is false
, then only the first value
returned will be used, and attempts to modify the corresponding entry in
the directory may cause those additional values to be lost.true
if attempts to initialize an object should fail if
the LDAP attribute has multiple values but the associated field
can only hold a single value, or false
if not.public abstract boolean inAdd
true
if this field should be included in the LDAP entry
that is generated when adding a new instance of the associated
object to the directory, or false
if not.public abstract boolean inModify
true
if this field should be examined and included in the
set of LDAP modifications if it has been changed, or false
if not.public abstract boolean inRDN
requiredForEncode()
element of this
annotation type, and will be included in add operations regardless of the
value of the inAdd()
element.
LDAPField
that have
inRDN=true
and all getter methods marked with LDAPGetter
that have inRDN=true
. A class marked with LDAPObject
must
either have at least one LDAPField
or LDAPGetter
with
inRDN=true
, or it must be a direct subclass of another class marked
with LDAPObject
. If a class has one or more fields and/or getters
with inRDN=true
, then only those fields/getters will be used to
construct the RDN, even if that class is a direct subclass of another class
marked with LDAPObject
.true
if the value of this field should be included in the
RDN of entries created from the associated object, or
false
if not.public abstract boolean lazilyLoad
true
if this field should be lazily loaded, or
false
if not.public abstract boolean requiredForDecode
true
, then attempts to initialize a Java
object from an LDAP entry which does not contain a value for the associated
attribute will result in an exception.true
if this field is required to be assigned a value in
decode processing, or false
if not.public abstract boolean requiredForEncode
true
, then attempts to construct an entry
or set of modifications for an object that does not have a value for this
field will result in an exception.true
if this field is required to have a value for encode
processing, or false
if not.@NotNull public abstract java.lang.Class<? extends ObjectEncoder> encoderClass
@NotNull public abstract FilterUsage filterUsage
@NotNull public abstract java.lang.String attribute
@NotNull public abstract java.lang.String[] defaultDecodeValue
requiredForEncode()
, or the field will be set to null
if
it is not required.@NotNull public abstract java.lang.String[] defaultEncodeValue
null
value.null
value, or an empty array if there should not be any default
values.@NotNull public abstract java.lang.String[] objectClass
LDAPObject
annotation type for the
associated class. If no values are provided, then it will be assumed to
be only included in the structural object class.