public class MethodType extends java.lang.Object implements java.lang.Comparable, Type
The default order for comparing is: ordinary Java method names, mutator,
accessor/tester. This can be changed via setOrder(java.lang.String)
.
Modifier and Type | Field and Description |
---|---|
static MethodType |
GETTER
Represents a Java Bean accessor.
|
static MethodType |
OTHER
Represents an ordinary Java method.
|
static MethodType |
SETTER
Represents a Java Bean mutator.
|
static MethodType |
TESTER
Represents a Java Bean accessor/tester.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object other)
Compares this object with the specified object for order.
|
static java.lang.String |
getOrder()
Returns a string representation of the current sort order.
|
boolean |
isBean()
Indicates whether this type represents a Java Bean method.
|
static void |
setOrder(java.lang.String str)
Sets the order to use as the natural order.
|
java.lang.String |
toString()
Returns a string representation of this method type.
|
static MethodType |
valueOf(java.lang.String name)
Returns the method type of the given method name.
|
public static final MethodType GETTER
public static final MethodType SETTER
public static final MethodType TESTER
public static final MethodType OTHER
public static void setOrder(java.lang.String str)
str
- a string representing the new order. The string must consist of exactly
four different, comma delimited strings which represents a method type
(e.g. isFoo,getFoo,setFoo,foo
)java.lang.IllegalArgumentException
- if the given string is invalid.public static java.lang.String getOrder()
isFoo,getFoo,setFoo,foo or foo,getFoo,isFoo,setFoo or ...
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
other
- the object to be compared.java.lang.ClassCastException
- if the specified object's type prevents it from being
compared to this object.public java.lang.String toString()
toString
in class java.lang.Object
public static MethodType valueOf(java.lang.String name)
name
- a method name.java.lang.IllegalArgumentException
- if no valid method name is given.public boolean isBean()
true
if this method type adheres to the Java Bean naming
conventions.
Submit a bug or feature.
For further information and documentation, visit the official Jalopy website.
This page generated: March 30 2013