com.univocity.parsers.annotations.helpers
Enum MethodFilter

java.lang.Object
  extended by java.lang.Enum<MethodFilter>
      extended by com.univocity.parsers.annotations.helpers.MethodFilter
All Implemented Interfaces:
Serializable, Comparable<MethodFilter>

public enum MethodFilter
extends Enum<MethodFilter>

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 - dev@univocity.com

Enum Constant Summary
ONLY_GETTERS
          Rejects any method that returns void or has a parameter list.
ONLY_SETTERS
          Rejects any method that doesn't accept a single parameter.
 
Method Summary
 boolean reject(Method method)
          Tests whether a method is not a getter or setter and should be rejected.
static MethodFilter valueOf(String name)
          Returns the enum constant of this type with the specified name.
static MethodFilter[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ONLY_GETTERS

public static final MethodFilter ONLY_GETTERS
Rejects any method that returns void or has a parameter list.


ONLY_SETTERS

public static final MethodFilter ONLY_SETTERS
Rejects any method that doesn't accept a single parameter.

Method Detail

values

public static MethodFilter[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MethodFilter c : MethodFilter.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MethodFilter valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
NullPointerException - if the argument is null

reject

public boolean reject(Method method)
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


Copyright © 2018 uniVocity Software Pty Ltd. All rights reserved.