public abstract class Conventions extends Object
Constructor and Description |
---|
Conventions() |
Modifier and Type | Method and Description |
---|---|
static String |
getQualifiedAttributeName(Class<?> enclosingClass,
String attributeName)
Return an attribute name qualified by the supplied enclosing
Class . |
static String |
getVariableName(Object value)
Determine the conventional variable name for the supplied
Object based on its concrete type. |
public static String getVariableName(Object value)
Object
based on its concrete type. The convention
used is to return the uncapitalized short name of the Class
,
according to JavaBeans property naming rules: So,
com.myapp.Product
becomes product
;
com.myapp.MyProduct
becomes myProduct
;
com.myapp.UKProduct
becomes UKProduct
.
For arrays, we use the pluralized version of the array component type.
For Collection
s we attempt to 'peek ahead' in the
Collection
to determine the component type and
return the pluralized version of that component type.
value
- the value to generate a variable name forCopyright © 2006–2018 TinyGroup. All rights reserved.