public final class BeanInfoUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.springframework.roo.model.JavaSymbolName |
getAccessorMethodName(FieldMetadata field)
Returns the accessor name for the given field.
|
static org.springframework.roo.model.JavaSymbolName |
getAccessorMethodName(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType)
Returns the accessor name for the given field name and field type.
|
static FieldMetadata |
getFieldForJavaBeanMethod(MemberDetails memberDetails,
MethodMetadata method)
Attempts to locate the field which is represented by the presented java
bean method.
|
static FieldMetadata |
getFieldForPropertyName(MemberDetails memberDetails,
org.springframework.roo.model.JavaSymbolName propertyName)
Attempts to locate the field which is represented by the presented
property name.
|
static org.springframework.roo.model.JavaSymbolName |
getMutatorMethodName(FieldMetadata field)
Returns the mutator name for the given field.
|
static org.springframework.roo.model.JavaSymbolName |
getMutatorMethodName(org.springframework.roo.model.JavaSymbolName fieldName)
Returns the mutator name for the given field name.
|
static org.springframework.roo.model.JavaSymbolName |
getPropertyNameForJavaBeanMethod(MethodMetadata method)
Obtains the property name for the specified JavaBean accessor or mutator
method.
|
static boolean |
hasAccessorAndMutator(FieldMetadata field,
MemberDetails memberDetails)
Attempts to locate an accessor and a mutator method for a given field.
|
static boolean |
isAccessorMethod(MethodMetadata method)
Indicates if the presented method compiles with the JavaBean conventions
around accessor methods (public, "set" or "is", 0 args etc).
|
static boolean |
isEntityReasonablyNamed(org.springframework.roo.model.JavaType entity)
Determines whether the presented entity is a test class or not.
|
static boolean |
isMutatorMethod(MethodMetadata method)
Indicates if the presented method compiles with the JavaBean conventions
around mutator methods (public, "set", 1 arg etc).
|
public static org.springframework.roo.model.JavaSymbolName getAccessorMethodName(FieldMetadata field)
field - the field to determine the accessor namepublic static org.springframework.roo.model.JavaSymbolName getAccessorMethodName(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType)
fieldName - the field name used to determine the accessor namefieldType - the field typepublic static FieldMetadata getFieldForJavaBeanMethod(MemberDetails memberDetails, MethodMetadata method)
Not every JavaBean getter or setter actually backs to a field with an identical name. In such cases, null will be returned.
memberDetails - the member holders to scan (required)method - the method name (required)public static FieldMetadata getFieldForPropertyName(MemberDetails memberDetails, org.springframework.roo.model.JavaSymbolName propertyName)
Not every JavaBean getter or setter actually backs to a field with an identical name. In such cases, null will be returned.
memberDetails - the member holders to scan (required)propertyName - the property name (required)public static org.springframework.roo.model.JavaSymbolName getMutatorMethodName(FieldMetadata field)
field - the field used to determine the accessor namepublic static org.springframework.roo.model.JavaSymbolName getMutatorMethodName(org.springframework.roo.model.JavaSymbolName fieldName)
fieldName - the field name used to determine the accessor namepublic static org.springframework.roo.model.JavaSymbolName getPropertyNameForJavaBeanMethod(MethodMetadata method)
method - to search (required, and must be a "get", "set" or "is"
method)public static boolean hasAccessorAndMutator(FieldMetadata field, MemberDetails memberDetails)
Not every JavaBean getter or setter actually backs to a field with an identical name. In such cases, false will be returned.
field - the member holders to scan (required)memberDetails - the member details to scanpublic static boolean isAccessorMethod(MethodMetadata method)
method - to evaluate (required)public static boolean isEntityReasonablyNamed(org.springframework.roo.model.JavaType entity)
entity - the type to testpublic static boolean isMutatorMethod(MethodMetadata method)
method - to evaluate (required)Copyright © 2009–2018 Pivotal Software, Inc.. All rights reserved.