public class AnnotationIntrospector extends Object
| Modifier and Type | Field | Description |
|---|---|---|
static List<Class<? extends Annotation>> |
TRANSIENT_INCOMPATIBLE |
Annotations to report exception when used in combination with
JsonbTransient |
| Constructor | Description |
|---|---|
AnnotationIntrospector(JsonbContext jsonbContext) |
Creates annotation introspecting component passing
JsonbContext inside. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
checkTransientIncompatible(JsonbAnnotatedElement<?> target) |
Finds annotations incompatible with
JsonbTransient annotation. |
JsonbAnnotatedElement<Class<?>> |
collectAnnotations(Class<?> clazz) |
Collect annotations of given class, its interfaces and the package.
|
Set<Class<?>> |
collectInterfaces(Class<?> cls) |
Get class interfaces recursively.
|
AdapterBinding |
getAdapterBinding(JsonbAnnotatedElement<Class<?>> clsElement) |
Checks for
JsonbAdapter on a type. |
AdapterBinding |
getAdapterBinding(Property property) |
Checks for
JsonbAdapter on a property. |
JsonbDateFormatter |
getConstructorDateFormatter(JsonbAnnotatedElement<Parameter> param) |
|
JsonbNumberFormatter |
getConstructorNumberFormatter(JsonbAnnotatedElement<Parameter> param) |
|
JsonbCreator |
getCreator(Class<?> clazz) |
Searches for JsonbCreator annotation on constructors and static methods.
|
DeserializerBinding |
getDeserializerBinding(JsonbAnnotatedElement<Class<?>> clsElement) |
Checks for
JsonbDeserializer on a type. |
DeserializerBinding |
getDeserializerBinding(Property property) |
Checks for
JsonbDeserializer on a property. |
Class<?> |
getImplementationClass(Property property) |
|
JsonbDateFormatter |
getJsonbDateFormat(JsonbAnnotatedElement<Class<?>> clazzElement) |
Search for
JsonbDateFormat annotation on java class and construct JsonbDateFormatter. |
Map<AnnotationTarget,JsonbDateFormatter> |
getJsonbDateFormatCategorized(Property property) |
Search
JsonbDateFormat on property, if not found looks at annotations declared on property type class. |
JsonbNumberFormatter |
getJsonbNumberFormat(JsonbAnnotatedElement<Class<?>> clazzElement) |
Search for
JsonbNumberFormat annotation on java class. |
String |
getJsonbPropertyJsonReadName(Property property) |
Gets a name of property for JSON unmarshalling.
|
String |
getJsonbPropertyJsonWriteName(Property property) |
Gets a name of property for JSON marshalling.
|
EnumSet<AnnotationTarget> |
getJsonbTransientCategorized(Property property) |
Checks if property is annotated transient.
|
Map<AnnotationTarget,JsonbNumberFormatter> |
getJsonNumberFormatter(Property property) |
Search
JsonbNumberFormat on property, if not found looks at annotations declared on property type class. |
String[] |
getPropertyOrder(JsonbAnnotatedElement<Class<?>> clazzElement) |
Checks for
JsonbPropertyOrder annotation. |
Optional<javax.json.bind.config.PropertyVisibilityStrategy> |
getPropertyVisibilityStrategy(Class<?> clazz) |
Get a @JsonbVisibility annotation from a class or its package.
|
SerializerBinding |
getSerializerBinding(JsonbAnnotatedElement<Class<?>> clsElement) |
Checks for
JsonbSerializer on a type. |
SerializerBinding |
getSerializerBinding(Property property) |
Checks for
JsonbSerializer on a property. |
ClassCustomization |
introspectCustomization(JsonbAnnotatedElement<Class<?>> clsElement) |
Processes customizations.
|
boolean |
isClassNillable(JsonbAnnotatedElement<Class<?>> clazzElement) |
Checks for JsonbNillable annotation on a class, its superclasses and interfaces.
|
Optional<Boolean> |
isPropertyNillable(Property property) |
Checks if property is nillable.
|
public static final List<Class<? extends Annotation>> TRANSIENT_INCOMPATIBLE
JsonbTransientpublic AnnotationIntrospector(JsonbContext jsonbContext)
JsonbContext inside.jsonbContext - mandatorypublic String getJsonbPropertyJsonWriteName(Property property)
property - property representation - field, getter, setter (not null)public String getJsonbPropertyJsonReadName(Property property)
property - property representation - field, getter, setter (not null)public JsonbCreator getCreator(Class<?> clazz)
clazz - class to searchpublic AdapterBinding getAdapterBinding(Property property)
JsonbAdapter on a property.property - property not nullpublic AdapterBinding getAdapterBinding(JsonbAnnotatedElement<Class<?>> clsElement)
JsonbAdapter on a type.clsElement - type not nullpublic DeserializerBinding getDeserializerBinding(Property property)
JsonbDeserializer on a property.property - property not nullpublic DeserializerBinding getDeserializerBinding(JsonbAnnotatedElement<Class<?>> clsElement)
JsonbDeserializer on a type.clsElement - type not nullpublic SerializerBinding getSerializerBinding(Property property)
JsonbSerializer on a property.property - property not nullpublic SerializerBinding getSerializerBinding(JsonbAnnotatedElement<Class<?>> clsElement)
JsonbSerializer on a type.clsElement - type not nullpublic Optional<Boolean> isPropertyNillable(Property property)
JsonbProperty nillable attribute only.
JsonbNillable is checked only for ClassModels.property - property to search in, not nullpublic boolean isClassNillable(JsonbAnnotatedElement<Class<?>> clazzElement)
clazzElement - class to search JsonbNillable in.public String[] getPropertyOrder(JsonbAnnotatedElement<Class<?>> clazzElement)
JsonbPropertyOrder annotation.clazzElement - class to search onpublic EnumSet<AnnotationTarget> getJsonbTransientCategorized(Property property)
property - The property to inspect if there is any JsonbTransient annotation defined for itAnnotationTargets specifying in which scope the JsonbTransient is appliedpublic Map<AnnotationTarget,JsonbDateFormatter> getJsonbDateFormatCategorized(Property property)
JsonbDateFormat on property, if not found looks at annotations declared on property type class.property - Property to search on.JsonbDateFormatter instances categorized by their scopes (class, property, getter or setter). If there is no date
formatter specified for given property, an empty map would be returnedpublic JsonbDateFormatter getJsonbDateFormat(JsonbAnnotatedElement<Class<?>> clazzElement)
JsonbDateFormat annotation on java class and construct JsonbDateFormatter.
If not found looks at annotations declared on property type class.clazzElement - class to search not nullpublic JsonbNumberFormatter getJsonbNumberFormat(JsonbAnnotatedElement<Class<?>> clazzElement)
JsonbNumberFormat annotation on java class.clazzElement - class to search not nullpublic Map<AnnotationTarget,JsonbNumberFormatter> getJsonNumberFormatter(Property property)
JsonbNumberFormat on property, if not found looks at annotations declared on property type class.property - Property to search on.JsonbNumberFormatter instances categorized by their scopes (class, property, getter or setter). If there is no number
formatter specified for given property, an empty map would be returnedpublic JsonbNumberFormatter getConstructorNumberFormatter(JsonbAnnotatedElement<Parameter> param)
public JsonbDateFormatter getConstructorDateFormatter(JsonbAnnotatedElement<Parameter> param)
public Optional<javax.json.bind.config.PropertyVisibilityStrategy> getPropertyVisibilityStrategy(Class<?> clazz)
clazz - Class to lookup annotationpublic void checkTransientIncompatible(JsonbAnnotatedElement<?> target)
JsonbTransient annotation.target - target to checkjavax.json.bind.JsonbException - If incompatible annotation is found.public Set<Class<?>> collectInterfaces(Class<?> cls)
cls - Class to process.public ClassCustomization introspectCustomization(JsonbAnnotatedElement<Class<?>> clsElement)
clsElement - Element to process.ClassCustomization instance.public JsonbAnnotatedElement<Class<?>> collectAnnotations(Class<?> clazz)
clazz - Class to process.Copyright © 2018 Oracle Corporation. All rights reserved.