|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.jemos.podam.utils.PodamUtils
public class PodamUtils
PODAM Utility class.
Constructor Summary | |
---|---|
private |
PodamUtils()
Non instantiable constructor |
Method Summary | |
---|---|
static String |
extractClassNameFromParameterisedTypeInField(Type type)
Given a Type object, it extracts and returns the class name |
static String |
extractFieldNameFromSetterMethod(Method method)
Given a setter Method , it extracts the field name, according to
JavaBean standards |
static ClassInfo |
getClassInfo(Class<?> clazz)
It returns a ClassInfo object for the given class |
static Set<String> |
getDeclaredInstanceFields(Class<?> clazz)
Given a class, it returns a Set of its declared instance field names. |
static Set<Method> |
getPojoSetters(Class<?> clazz,
Set<String> classFields)
Given a class and a set of class declared fields it returns a Set of setters matching the declared fields |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private PodamUtils()
Method Detail |
---|
public static ClassInfo getClassInfo(Class<?> clazz)
ClassInfo
object for the given class
clazz
- The class to retrieve info from
ClassInfo
object for the given classpublic static Set<String> getDeclaredInstanceFields(Class<?> clazz)
clazz
- The class to analyse to retrieve declared fields
public static Set<Method> getPojoSetters(Class<?> clazz, Set<String> classFields)
If present, a setter method is considered if and only if the
classFields
argument contains an attribute whose name matches the
setter, according to JavaBean standards.
clazz
- The class to analyse for settersclassFields
- A Set of field names for which setters are to be found
public static String extractFieldNameFromSetterMethod(Method method)
Method
, it extracts the field name, according to
JavaBean standards
This method, given a setter method, it returns the corresponding attribute name. For example: given setIntField the method would return intField. The correctness of the return value depends on the adherence to JavaBean standards.
method
- The setter method from which the field name is required
public static String extractClassNameFromParameterisedTypeInField(Type type)
Type
object, it extracts and returns the class name
If a Type
was extracted from a Field
object, it has the
form: class <classname>
, e.g. class java.lang.String
.
This method returns the java.lang.String
part of the Type
type
- The type from which the class name must be extracted
|
Jemos 2002 - 2011: All Rights Reserved. Podam runs under the MIT license | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |