org.codehaus.jackson.annotate
Enum JsonMethod

java.lang.Object
  extended by java.lang.Enum<JsonMethod>
      extended by org.codehaus.jackson.annotate.JsonMethod
All Implemented Interfaces:
Serializable, Comparable<JsonMethod>

public enum JsonMethod
extends Enum<JsonMethod>

Enumeration used to define kinds of methods that annotations like JsonAutoDetect apply to.

In addition to actual method types (GETTER, SETTER, CREATOR; and sort-of-method, FIELD), 2 pseudo-types are defined for convenience: ALWAYS and NONE. These can be used to indicate, all or none of available method types (respectively), for use by annotations that takes JsonMethod argument.


Enum Constant Summary
ALL
          This pseudo-type indicates that all of real types are included
CREATOR
          Creators are constructors and (static) factory methods used to construct POJO instances for deserialization
FIELD
          Field refers to fields of regular Java objects.
GETTER
          Getters are methods used to get a POJO field value for serialization, or, under certain conditions also for de-serialization.
IS_GETTER
          "Is getters" are getter-like methods that are named "isXxx" (instead of "getXxx" for getters) and return boolean value (either primitive, or Boolean).
NONE
          This pseudo-type indicates that none of real types is included
SETTER
          Setters are methods used to set a POJO value for deserialization.
 
Method Summary
 boolean creatorEnabled()
           
 boolean fieldEnabled()
           
 boolean getterEnabled()
           
 boolean isGetterEnabled()
           
 boolean setterEnabled()
           
static JsonMethod valueOf(String name)
          Returns the enum constant of this type with the specified name.
static JsonMethod[] 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

GETTER

public static final JsonMethod GETTER
Getters are methods used to get a POJO field value for serialization, or, under certain conditions also for de-serialization. Latter can be used for effectively setting Collection or Map values in absence of setters, iff returned value is not a copy but actual value of the logical property.

Since version 1.3, this does NOT include "is getters" (methods that return boolean and named 'isXxx' for property 'xxx'); instead, IS_GETTER is used}.


SETTER

public static final JsonMethod SETTER
Setters are methods used to set a POJO value for deserialization.


CREATOR

public static final JsonMethod CREATOR
Creators are constructors and (static) factory methods used to construct POJO instances for deserialization


FIELD

public static final JsonMethod FIELD
Field refers to fields of regular Java objects. Although they are not really methods, addition of optional field-discovery in version 1.1 meant that there was need to enable/disable their auto-detection, and this is the place to add it in.

Since:
1.1

IS_GETTER

public static final JsonMethod IS_GETTER
"Is getters" are getter-like methods that are named "isXxx" (instead of "getXxx" for getters) and return boolean value (either primitive, or Boolean).

Since:
1.3

NONE

public static final JsonMethod NONE
This pseudo-type indicates that none of real types is included


ALL

public static final JsonMethod ALL
This pseudo-type indicates that all of real types are included

Method Detail

values

public static JsonMethod[] 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 (JsonMethod c : JsonMethod.values())
    System.out.println(c);

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

valueOf

public static JsonMethod 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

creatorEnabled

public boolean creatorEnabled()

getterEnabled

public boolean getterEnabled()

isGetterEnabled

public boolean isGetterEnabled()

setterEnabled

public boolean setterEnabled()

fieldEnabled

public boolean fieldEnabled()