Top Description Fields Constructors Methods
ch.qos.logback.core.joran.util.beans

public Class BeanUtil

extends Object
Class Inheritance
Imports
java.lang.reflect.Method

Encapsulates utility methods associated with standard java beans.
Author
urechm

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int
public static String

Returns:

The property name of the associated property if the given method matches a standard java beans getter or setter.
getPropertyName
(Method
to get the associated property name for.
method
)

private static String
public static boolean

Returns:

true if the given method is an 'adder' method.
isAdder
(Method
to check if it is an 'adder' method.
method
)

public static boolean

Returns:

true if the given method is a standard java beans getter.
isGetter
(Method
to check if it is a standard java beans getter.
method
)

public static boolean

Returns:

true if the given method is a standard java beans setter.
isSetter
(Method
to check if it is a standard java beans setter.
method
)

public static String

Returns:

null if the given String is null. Empty string if the given string is empty. The given string if the first two consecutive letters are in upper case. The given string with the first letter in lower case otherwise, which might be the given string.
toLowerCamelCase
(String
to decapitalize.
string
)

Converts the given String into lower camel case form.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PREFIX_ADDERback to summary
public static final String PREFIX_ADDER
PREFIX_GETTER_GETback to summary
public static final String PREFIX_GETTER_GET
PREFIX_GETTER_ISback to summary
public static final String PREFIX_GETTER_IS
PREFIX_SETTERback to summary
public static final String PREFIX_SETTER

Constructor Detail

BeanUtilback to summary
public BeanUtil()

Method Detail

getParameterCountback to summary
private static int getParameterCount(Method method)
getPropertyNameback to summary
public static String getPropertyName(Method method)
Parameters
method:Method

to get the associated property name for.

Returns:String

The property name of the associated property if the given method matches a standard java beans getter or setter.

getSubstringIfPrefixMatchesback to summary
private static String getSubstringIfPrefixMatches(String wholeString, String prefix)
isAdderback to summary
public static boolean isAdder(Method method)
Parameters
method:Method

to check if it is an 'adder' method.

Returns:boolean

true if the given method is an 'adder' method.

isGetterback to summary
public static boolean isGetter(Method method)
Parameters
method:Method

to check if it is a standard java beans getter.

Returns:boolean

true if the given method is a standard java beans getter.

isSetterback to summary
public static boolean isSetter(Method method)
Parameters
method:Method

to check if it is a standard java beans setter.

Returns:boolean

true if the given method is a standard java beans setter.

toLowerCamelCaseback to summary
public static String toLowerCamelCase(String string)

Converts the given String into lower camel case form.

Parameters
string:String

to decapitalize.

Returns:String

null if the given String is null. Empty string if the given string is empty. The given string if the first two consecutive letters are in upper case. The given string with the first letter in lower case otherwise, which might be the given string.