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>
TheMethodTypeenumeration 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 theMethodScannerto 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 GETThis is used to represent a method that acts as a getter.ISThis is used to represent a method that acts as a getter.NONEThis is used to represent a a normal method to be ignored.SETThis is used to represent a method that acts as a setter.
-
Field Summary
Fields Modifier and Type Field Description private intprefixThis is the length of the prefix the method type uses.
-
Constructor Summary
Constructors Modifier Constructor Description privateMethodType(int prefix)Constructor for theMethodTypeobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPrefix()This is used to acquire the prefix for the method type.static MethodTypevalueOf(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
-
-