java.lang.Object
org.apache.johnzon.mapper.util.BeanUtil
Some simple bean introspection methods.
To avoid a dependency on the awt java.beans.introspector which is a desktop level class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringcapitalize(String fieldName) capitalize according to java beans specificationstatic Stringdecapitalize(String name) decapitalize according to java beans specification.static StringgetterName(String fieldName, Class<?> type) Calculate the name of a getter based on the name of it's field and the typestatic StringsetterName(String fieldName) Calculate the name of a setter based on the name of it's field
-
Constructor Details
-
BeanUtil
private BeanUtil()
-
-
Method Details
-
getterName
Calculate the name of a getter based on the name of it's field and the type- Parameters:
fieldName- of the fieldtype- of the field- Returns:
- "get" or "is" method name for the field
-
setterName
Calculate the name of a setter based on the name of it's field- Parameters:
fieldName- of the field- Returns:
- "set" method name for the field
-
capitalize
capitalize according to java beans specification -
decapitalize
decapitalize according to java beans specification. That is start the given field with a lower case, but only if the 2nd char is not also an uppercase character. eg; "Enabled" will become "enabled", but "URL" will remain "URL".
-