Package jodd.json.meta
Class JsonAnnotationManager
- java.lang.Object
-
- jodd.json.meta.JsonAnnotationManager
-
public class JsonAnnotationManager extends java.lang.ObjectCached includes and excludes annotation data per type.
-
-
Constructor Summary
Constructors Constructor Description JsonAnnotationManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TypeData_lookupTypeData(java.lang.Class type)Lookups type data and creates one if missing.protected TypeDatafindSubclassTypeData(java.lang.Class type)Finds type data of first annotated superclass or interface.static JsonAnnotationManagerget()Returns instance of this class.TypeDatalookupTypeData(java.lang.Class type)Returns all includes for given type.voidreset()java.lang.StringresolveJsonName(java.lang.Class type, java.lang.String name)Returns different name of a property if set by annotation.java.lang.StringresolveRealName(java.lang.Class type, java.lang.String jsonName)Returns real property name for given JSON property.JsonAnnotationManagersetJsonAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> jsonAnnotation)Sets different annotation.JsonAnnotationManagersetSerializationSubclassAware(boolean serializationSubclassAware)When set searches for first annotated class or interface and use it's data.
-
-
-
Method Detail
-
get
public static JsonAnnotationManager get()
Returns instance of this class.
-
lookupTypeData
public TypeData lookupTypeData(java.lang.Class type)
Returns all includes for given type. Returns an empty array when no includes are defined.
-
_lookupTypeData
protected TypeData _lookupTypeData(java.lang.Class type)
Lookups type data and creates one if missing.
-
findSubclassTypeData
protected TypeData findSubclassTypeData(java.lang.Class type)
Finds type data of first annotated superclass or interface.
-
resolveJsonName
public java.lang.String resolveJsonName(java.lang.Class type, java.lang.String name)Returns different name of a property if set by annotation.
-
resolveRealName
public java.lang.String resolveRealName(java.lang.Class type, java.lang.String jsonName)Returns real property name for given JSON property.
-
setSerializationSubclassAware
public JsonAnnotationManager setSerializationSubclassAware(boolean serializationSubclassAware)
When set searches for first annotated class or interface and use it's data.
-
setJsonAnnotation
public JsonAnnotationManager setJsonAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> jsonAnnotation)
Sets different annotation.
-
reset
public void reset()
-
-