Enum Class MethodFilter
- All Implemented Interfaces:
Serializable
,Comparable<MethodFilter>
,Constable
A filter for annotated methods. Used internally to exclude setters or getters from the list of fields to be processed,
accordingly to the use case: when parsing into beans, only setter methods are to be considered. When writing values
in beans to an output, only the getter methods should be used.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRejects any method that returnsvoid
or has a parameter list.Rejects any method that doesn't accept a single parameter. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests whether a method is not a getter or setter and should be rejected.toDescriptor
(String prefix, Method method) Creates a descriptor for a getter or setter methodstatic MethodFilter
Returns the enum constant of this class with the specified name.static MethodFilter[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ONLY_GETTERS
Rejects any method that returnsvoid
or has a parameter list. -
ONLY_SETTERS
Rejects any method that doesn't accept a single parameter.
-
-
Field Details
-
filter
-
-
Constructor Details
-
MethodFilter
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
reject
Tests whether a method is not a getter or setter and should be rejected.- Parameters:
method
- the method to be tested- Returns:
true
if the given method should be rejected,false
otherwise
-
toDescriptor
Creates a descriptor for a getter or setter method- Parameters:
prefix
- a dot separated string denoting a path of nested object namesmethod
- a actual class method to be associated with this prefix- Returns:
- a descriptor for the given method
-