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 the LDAPObject annotation type. Those methods must not be static and must have a non-void return type, 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 or LDAPGetter annotations in the same class, and it may be referenced by at most one LDAPSetter annotation.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String attribute
      The name of the attribute type in which the associated getter value will be stored in LDAP entries.
      java.lang.Class<? extends ObjectEncoder> encoderClass
      The class that provides the logic for encoding the method return value to an LDAP attribute.
      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.
      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.
      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.
      boolean inRDN
      Indicates whether the value returned from this method should be included in the RDN of entries created from the associated object.
      java.lang.String[] objectClass
      The 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:
        true if 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, or false if 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:
        true if 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, or false if 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 the inAdd() element.

        When generating an entry DN, the persistence framework will construct an RDN using all fields marked with 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.
        Returns:
        true if the value returned from this method should be included in the RDN of entries created from the associated object, or false if not.
        Default:
        false
      • encoderClass

        @NotNull
        java.lang.Class<? extends ObjectEncoderencoderClass
        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 the 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.
        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:
        {}