public class MetaFieldUtil extends Object
| Constructor and Description |
|---|
MetaFieldUtil() |
| Modifier and Type | Method and Description |
|---|---|
protected static MetaFieldInfo[] |
internalToMetaFieldInfoArray(Class type,
Object obj,
String preFieldName,
String postFieldName,
String stringForNullValues,
boolean ignoreAnnotatedName,
boolean recursive)
Optionally, recursively returns a new MetaFieldInfo array of all Fields
annotated with MetaField in the object.
|
static MetaFieldInfo[] |
toMetaFieldInfoArray(Class type,
Object obj,
String stringForNullValues,
boolean ignoreAnnotatedName,
boolean recursive)
Returns a new MetaFieldInfo array of all Fields annotated with MetaField
in the object type.
|
static MetaFieldInfo[] |
toMetaFieldInfoArray(Object obj)
Returns a new MetaFieldInfo array of all Fields annotated with MetaField
in the runtime object type.
|
static MetaFieldInfo[] |
toMetaFieldInfoArray(Object obj,
String stringForNullValues)
Returns a new MetaFieldInfo array of all Fields annotated with MetaField
in the runtime object type.
|
static MetaFieldInfo[] |
toMetaFieldInfoArray(Object obj,
String stringForNullValues,
boolean ignoreAnnotatedName)
Returns a new MetaFieldInfo array of all Fields annotated with MetaField
in the runtime object type.
|
static String |
toMetaFieldInfoString(Object obj)
Creates a string for an object based on the MetaField annotations.
|
public static String toMetaFieldInfoString(Object obj)
obj - The object to searchpublic static MetaFieldInfo[] toMetaFieldInfoArray(Object obj)
obj - The runtime instance of the object to search. It must be an
instance of the type. If its a subclass of the type, this method
will only return MetaFields of the type passed in.public static MetaFieldInfo[] toMetaFieldInfoArray(Object obj, String stringForNullValues)
obj - The runtime instance of the object to search. It must be an
instance of the type. If its a subclass of the type, this method
will only return MetaFields of the type passed in.stringForNullValues - If a field is null, this is the string to swap
in as the String value vs. "null" showing up.public static MetaFieldInfo[] toMetaFieldInfoArray(Object obj, String stringForNullValues, boolean ignoreAnnotatedName)
obj - The runtime instance of the object to search. It must be an
instance of the type. If its a subclass of the type, this method
will only return MetaFields of the type passed in.stringForNullValues - If a field is null, this is the string to swap
in as the String value vs. "null" showing up.ignoreAnnotatedName - Whether to ignore the name of the MetaField
and always return the field name instead. If false, this method will
use the annotated name if it exists, otherwise it'll use the field name.public static MetaFieldInfo[] toMetaFieldInfoArray(Class type, Object obj, String stringForNullValues, boolean ignoreAnnotatedName, boolean recursive)
type - The class type of the objectobj - The runtime instance of the object to search. It must be an
instance of the type. If its a subclass of the type, this method
will only return MetaFields of the type passed in.stringForNullValues - If a field is null, this is the string to swap
in as the String value vs. "null" showing up.ignoreAnnotatedName - Whether to ignore the name of the MetaField
and always return the field name instead. If false, this method will
use the annotated name if it exists, otherwise it'll use the field name.recursive - If true, this method will recursively search any fields
to see if they also contain MetaField annotations. If they do, this
method will include those in its returned array.protected static MetaFieldInfo[] internalToMetaFieldInfoArray(Class type, Object obj, String preFieldName, String postFieldName, String stringForNullValues, boolean ignoreAnnotatedName, boolean recursive)
type - The class type of the obj (in case obj is null)obj - The object to search. If this is null, will default values for each field to null.appendFieldName - Will append this value to the name of the field (really for subfields)stringForNullValues - If a field is null, this is the string to swap
in as the String value vs. "null" showing up.Copyright © 2012-2015 Cloudhopper by Twitter. All Rights Reserved.