Top Description Inners Fields Constructors Methods
com.univocity.parsers.annotations.helpers

public final Enum MethodFilter

extends Enum<MethodFilter>
Class Inheritance
Imports
java.lang.reflect.*

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.
Author
Univocity Software Pty Ltd - [email protected]

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface

Field Summary

Modifier and TypeField and Description
private MethodFilter.Filter
public static final MethodFilter
ONLY_GETTERS

Rejects any method that returns void or has a parameter list.

public static final MethodFilter
ONLY_SETTERS

Rejects any method that doesn't accept a single parameter.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the given method should be rejected, false otherwise
reject
(Method
the method to be tested
method
)

Tests whether a method is not a getter or setter and should be rejected.

public MethodDescriptor

Returns:

a descriptor for the given method
toDescriptor
(String
a dot separated string denoting a path of nested object names
prefix
,
Method
a actual class method to be associated with this prefix
method
)

Creates a descriptor for a getter or setter method

public static MethodFilter
public static MethodFilter[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

filterback to summary
private MethodFilter.Filter filter
ONLY_GETTERSback to summary
public static final MethodFilter ONLY_GETTERS

Rejects any method that returns void or has a parameter list.

ONLY_SETTERSback to summary
public static final MethodFilter ONLY_SETTERS

Rejects any method that doesn't accept a single parameter.

Constructor Detail

MethodFilterback to summary
private MethodFilter(MethodFilter.Filter filter)

Method Detail

rejectback to summary
public boolean reject(Method method)

Tests whether a method is not a getter or setter and should be rejected.

Parameters
method:Method

the method to be tested

Returns:boolean

true if the given method should be rejected, false otherwise

toDescriptorback to summary
public MethodDescriptor toDescriptor(String prefix, Method method)

Creates a descriptor for a getter or setter method

Parameters
prefix:String

a dot separated string denoting a path of nested object names

method:Method

a actual class method to be associated with this prefix

Returns:MethodDescriptor

a descriptor for the given method

valueOfback to summary
public static MethodFilter valueOf(String name)
valuesback to summary
public static MethodFilter[] values()
com.univocity.parsers.annotations.helpers back to summary

private Interface MethodFilter.Filter


Method Summary

Modifier and TypeMethod and Description
public boolean
reject(Method method)

Method Detail

rejectback to summary
public boolean reject(Method method)