Package org.simpleframework.xml.core
Enum MethodType
- java.lang.Object
-
- java.lang.Enum<MethodType>
-
- org.simpleframework.xml.core.MethodType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<MethodType>
enum MethodType extends java.lang.Enum<MethodType>
TheMethodType
enumeration is used to specify a set of types that can be used to classify Java Beans methods. This creates three types for the get, is, and set methods. The method types allow theMethodScanner
to determine what function the method has in creating a contact point for the object. This also enables methods to be parsed correctly.- See Also:
MethodScanner
,MethodPart
-
-
Enum Constant Summary
Enum Constants Enum Constant Description GET
This is used to represent a method that acts as a getter.IS
This is used to represent a method that acts as a getter.NONE
This is used to represent a a normal method to be ignored.SET
This is used to represent a method that acts as a setter.
-
Field Summary
Fields Modifier and Type Field Description private int
prefix
This is the length of the prefix the method type uses.
-
Constructor Summary
Constructors Modifier Constructor Description private
MethodType(int prefix)
Constructor for theMethodType
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPrefix()
This is used to acquire the prefix for the method type.static MethodType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static MethodType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GET
public static final MethodType GET
This is used to represent a method that acts as a getter.
-
IS
public static final MethodType IS
This is used to represent a method that acts as a getter.
-
SET
public static final MethodType SET
This is used to represent a method that acts as a setter.
-
NONE
public static final MethodType NONE
This is used to represent a a normal method to be ignored.
-
-
Method Detail
-
values
public static MethodType[] 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 (MethodType c : MethodType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MethodType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getPrefix
public int getPrefix()
This is used to acquire the prefix for the method type. The prefix allows the method name to be extracted easily as it is used to determine the character range that forms the name.- Returns:
- this returns the method name prefix for the type
-
-