public final class ParserUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.base.Predicate<java.lang.reflect.Field> |
FILTER_FINAL_FIELDS
A filter (for the get attribute methods) that selects only the attributes that are final.
|
static com.google.common.base.Predicate<java.lang.reflect.Field> |
FILTER_HAS_DEFAULT_ATTRIBUTES
A filter (for the get attribute methods) that selects only the attributes that are NOT required and excludes all of
those that are considered required.
|
static com.google.common.base.Predicate<java.lang.reflect.Field> |
FILTER_NON_FINAL_FIELDS
A filter (for the get attribute methods) that selects only the attributes that are non final.
|
static com.google.common.base.Predicate<java.lang.reflect.Field> |
FILTER_ONLY_REQUIRED_ATTRIBUTES
A filter (for the get attribute methods) that selects only the attributes that are required and excludes all of
those with defaults, and therefore are considered optional.
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.Set<java.lang.String> |
getAllAttributeNames(java.lang.Class<?> classToInspect)
Converts all non-final properties in
getAllAttributes(Class) to a set of the attribute names. |
static java.util.Collection<java.lang.reflect.Field> |
getAllAttributes(java.lang.Class<?> classToInspect)
Inspects the object and all superclasses for public, non-final, accessible methods and returns a collection containing all the
attributes found.
|
static java.util.Set<java.lang.String> |
getAttributeNames(java.lang.Class<?> classToInspect,
com.google.common.base.Predicate<java.lang.reflect.Field> filter)
Converts all properties in
getAllAttributes(Class) to a set of the attribute names. |
static java.util.Collection<java.lang.reflect.Field> |
getAttributes(java.lang.Class<?> classToInspect,
com.google.common.base.Predicate<java.lang.reflect.Field> filter)
Get a subset of the attributes of the provided class.
|
public static final com.google.common.base.Predicate<java.lang.reflect.Field> FILTER_ONLY_REQUIRED_ATTRIBUTES
public static final com.google.common.base.Predicate<java.lang.reflect.Field> FILTER_HAS_DEFAULT_ATTRIBUTES
public static final com.google.common.base.Predicate<java.lang.reflect.Field> FILTER_NON_FINAL_FIELDS
public static final com.google.common.base.Predicate<java.lang.reflect.Field> FILTER_FINAL_FIELDS
public static java.util.Collection<java.lang.reflect.Field> getAllAttributes(java.lang.Class<?> classToInspect)
classToInspect - the class under inspection.public static java.util.Collection<java.lang.reflect.Field> getAttributes(java.lang.Class<?> classToInspect,
com.google.common.base.Predicate<java.lang.reflect.Field> filter)
classToInspect - the class to inspectfilter - a predicate that returns true when a attribute should be kept in resulting collection.public static java.util.Set<java.lang.String> getAllAttributeNames(java.lang.Class<?> classToInspect)
getAllAttributes(Class) to a set of the attribute names.classToInspect - the class to inspectpublic static java.util.Set<java.lang.String> getAttributeNames(java.lang.Class<?> classToInspect,
com.google.common.base.Predicate<java.lang.reflect.Field> filter)
getAllAttributes(Class) to a set of the attribute names.classToInspect - the class to inspectfilter - a predicate that returns true when a attribute should be kept in resulting collection.