Package com.unboundid.ldap.sdk.persist
Annotation Type LDAPGetter
-
@Documented @Retention(RUNTIME) @Target(METHOD) public @interface LDAPGetter
This annotation type may be used to mark methods whose return values should be persisted in an LDAP directory server. It should only be used for methods in classes that contain theLDAPObjectannotation type. Those methods must not be static and must have a non-voidreturn type, but they may have any access modifier (includingpublic,protected,private, or no access modifier at all indicating package-level access). The associated attribute must not be referenced by any otherLDAPFieldorLDAPGetterannotations in the same class, and it may be referenced by at most oneLDAPSetterannotation.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringattributeThe name of the attribute type in which the associated getter value will be stored in LDAP entries.java.lang.Class<? extends ObjectEncoder>encoderClassThe class that provides the logic for encoding the method return value to an LDAP attribute.FilterUsagefilterUsageIndicates whether and under what circumstances the value returned from this method may be included in a search filter generated to search for entries that match the object.booleaninAddIndicates whether the value returned from this method should be included in the LDAP entry that is generated when adding a new instance of the associated object to the directory.booleaninModifyIndicates whether the value returned from this method should be included in the set of LDAP modifications if it has been changed when modifying an existing instance of the associated object in the directory.booleaninRDNIndicates whether the value returned from this method should be included in the RDN of entries created from the associated object.java.lang.String[]objectClassThe names of the object classes in which the associated attribute may be used.
-
-
-
Element Detail
-
inAdd
boolean inAdd
Indicates whether the value returned from this method should be included in the LDAP entry that is generated when adding a new instance of the associated object to the directory. Note that any getter value which is to be included in entry RDNs will always be included in add operations regardless of the value of this element.- Returns:
trueif the value returned from this method should be included in the LDAP entry that is generated when adding a new instance of the associated object to the directory, orfalseif not.
- Default:
- true
-
-
-
inModify
boolean inModify
Indicates whether the value returned from this method should be included in the set of LDAP modifications if it has been changed when modifying an existing instance of the associated object in the directory. Note that any getter value which is to be included in entry RDNs will never be included in modify operations regardless of the value of this element.- Returns:
trueif the value returned from this method should be included in the set of LDAP modifications if it has been changed when modifying an existing instance of the associated object in the directory, orfalseif not.
- Default:
- true
-
-
-
inRDN
boolean inRDN
Indicates whether the value returned from this method should be included in the RDN of entries created from the associated object. Any getter value which is to be included entry RDNs will always be included in add operations regardless of the value of theinAdd()element.
When generating an entry DN, the persistence framework will construct an RDN using all fields marked withLDAPFieldthat haveinRDN=trueand all getter methods marked withLDAPGetterthat haveinRDN=true. A class marked withLDAPObjectmust either have at least oneLDAPFieldorLDAPGetterwithinRDN=true, or it must be a direct subclass of another class marked withLDAPObject. If a class has one or more fields and/or getters withinRDN=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 withLDAPObject.- Returns:
trueif the value returned from this method should be included in the RDN of entries created from the associated object, orfalseif not.
- Default:
- false
-
-
-
encoderClass
@NotNull java.lang.Class<? extends ObjectEncoder> encoderClass
The class that provides the logic for encoding the method return value to an LDAP attribute.- Returns:
- The encoder class for this getter.
- Default:
- com.unboundid.ldap.sdk.persist.DefaultObjectEncoder.class
-
-
-
filterUsage
@NotNull FilterUsage filterUsage
Indicates whether and under what circumstances the value returned from this method may be included in a search filter generated to search for entries that match the object.- Returns:
- The filter usage value for this getter.
- Default:
- com.unboundid.ldap.sdk.persist.FilterUsage.CONDITIONALLY_ALLOWED
-
-
-
attribute
@NotNull java.lang.String attribute
The name of the attribute type in which the associated getter value will be stored in LDAP entries. If this is not provided, then the method name must start with "get" and it will be assumed that the attribute name is the remainder of the method name.- Returns:
- The name of the attribute type in which the associated getter value will be stored in LDAP entries, or an empty string if it will be assumed that the attribute name matches the getter method name without the initial "get".
- Default:
- ""
-
-
-
objectClass
@NotNull java.lang.String[] objectClass
The names of the object classes in which the associated attribute may be used. This is primarily intended for use in generating LDAP schema from Java object types.
Values may include any combination of the structural and/or auxiliary object classes named in theLDAPObjectannotation type for the associated class. If no values are provided, then it will be assumed to be only included in the structural object class.- Returns:
- The names of the object classes in which the associated attribute may be used, or an empty array if it will be assumed to only be included in the structural object class.
- Default:
- {}
-
-