public class MappedField extends Object
Constructor and Description |
---|
MappedField(Type type,
Mapper mapper) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(Class<? extends Annotation> clazz)
Adds the annotation, if it exists on the field.
|
void |
addAnnotation(Class<? extends Annotation> clazz,
Annotation ann)
Adds the annotation, if it exists on the field.
|
static void |
addInterestingAnnotation(Class<? extends Annotation> annotation) |
<T extends Annotation> |
getAnnotation(Class<T> clazz)
returns the annotation instance if it exists on this field
|
Map<Class<? extends Annotation>,Annotation> |
getAnnotations() |
Class |
getConcreteType() |
Constructor |
getCTor()
returns a constructor for the type represented by the field
|
Object |
getDbObjectValue(com.mongodb.DBObject dbObj) |
Class |
getDeclaringClass()
returns the declaring class of the java field
|
Field |
getField()
returned the underlying java field
|
Object |
getFieldValue(Object classInst)
Returns the value stored in the java field
|
String |
getFirstFieldName(com.mongodb.DBObject dbObj) |
String |
getFullName()
returns the full name of the class plus java field name
|
String |
getJavaFieldName()
Returns the name of the java field, as declared on the class
|
List<String> |
getLoadNames()
Returns the name of the field's (key)name for mongodb, in order of loading.
|
Class |
getMapKeyClass()
If the underlying java type is a map then it returns T from Map
|
Mapper |
getMapper() |
String |
getNameToStore()
Returns the name of the field's (key)name for mongodb
|
Class |
getSubClass()
If the java field is a list/array/map then the sub-type T is returned (ex.
|
Type |
getSubType() |
Class |
getType()
returns the type of the underlying java field
|
List<MappedField> |
getTypeParameters() |
boolean |
hasAnnotation(Class ann)
Indicates whether the annotation is present in the mapping (does not check the java field annotations, just the ones discovered)
|
boolean |
isArray() |
boolean |
isMap() |
boolean |
isMultipleValues() |
boolean |
isReference() |
boolean |
isSet() |
boolean |
isSingleValue() |
boolean |
isTypeMongoCompatible() |
Annotation |
putAnnotation(Annotation ann)
Adds the annotation even if not on the declared class/field.
|
void |
setFieldValue(Object classInst,
Object value)
Sets the value for the java field
|
String |
toString() |
public static void addInterestingAnnotation(Class<? extends Annotation> annotation)
public String getNameToStore()
public List<String> getLoadNames()
public String getFirstFieldName(com.mongodb.DBObject dbObj)
public Object getDbObjectValue(com.mongodb.DBObject dbObj)
public String getJavaFieldName()
public <T extends Annotation> T getAnnotation(Class<T> clazz)
public Map<Class<? extends Annotation>,Annotation> getAnnotations()
public boolean hasAnnotation(Class ann)
public void addAnnotation(Class<? extends Annotation> clazz)
public void addAnnotation(Class<? extends Annotation> clazz, Annotation ann)
public boolean isReference()
public Annotation putAnnotation(Annotation ann)
public String getFullName()
public Class getType()
public Class getDeclaringClass()
public Class getSubClass()
public Type getSubType()
public List<MappedField> getTypeParameters()
public boolean isArray()
public boolean isSingleValue()
public boolean isMultipleValues()
public boolean isTypeMongoCompatible()
public boolean isMap()
public boolean isSet()
public Class getMapKeyClass()
public Constructor getCTor()
public Object getFieldValue(Object classInst)
public void setFieldValue(Object classInst, Object value)
public Field getField()
public Class getConcreteType()
public Mapper getMapper()
Copyright © 2016. All rights reserved.