Top Constructors Methods
org.apache.groovy.util

public Class BeanUtils

extends Object
Class Inheritance
Static Imports
java.lang.Character.isUpperCase

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

the name capitalized, except when we don't
capitalize
(final String
the property name to capitalize
property
)

This is the complement the behavior of the decapitalize(string) method.

public static String

Returns:

the decapitalized string
decapitalize
(final String
a string representing the name of a JavaBean-like property
property
)

Returns a new String which is the same as the original except the first letter will be lowercase except for some special cases as per JavaBean handling.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BeanUtilsback to summary
private BeanUtils()

Method Detail

capitalizeback to summary
public static String capitalize(final String property)

This is the complement the behavior of the decapitalize(string) method. We handle names that begin with an initial lowerCase followed by upperCase with special JavaBean behavior (which is to make no change). See GROOVY-3211.

Parameters
property:String

the property name to capitalize

Returns:String

the name capitalized, except when we don't

decapitalizeback to summary
public static String decapitalize(final String property)

Returns a new String which is the same as the original except the first letter will be lowercase except for some special cases as per JavaBean handling. In particular, if the first two letters are both uppercase, e.g. URL, then no change of case occurs. Originally inspired by the method with the same name in java.lang.Introspector. See also: https://stackoverflow.com/questions/4052840/most-efficient-way-to-make-the-first-character-of-a-string-lower-case/4052914

Parameters
property:String

a string representing the name of a JavaBean-like property

Returns:String

the decapitalized string