Class SchemaProcessor
- java.lang.Object
-
- org.apache.johnzon.jsonschema.generator.SchemaProcessor
-
public class SchemaProcessor extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSchemaProcessor.Cachestatic classSchemaProcessor.InMemoryCachestatic classSchemaProcessor.Instanceprivate static classSchemaProcessor.ParameterizedTypeImplstatic classSchemaProcessor.ReflectionValueExtractor
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<?>persistenceCapableprivate booleansetClassAsTitleprivate booleanuseReflectionForDefaults
-
Constructor Summary
Constructors Constructor Description SchemaProcessor()SchemaProcessor(boolean setClassAsTitle, boolean useReflectionForDefaults)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.function.BiPredicate<java.lang.reflect.Type,java.lang.String>createIgnorePredicate(java.lang.Class<?> from)private java.lang.Stringdecapitalize(java.lang.String name)private SchemadoMapSchemaFromClass(java.lang.reflect.Type model, SchemaProcessor.Cache cache, SchemaProcessor.ReflectionValueExtractor reflectionValueExtractor, SchemaProcessor.Instance instance)private java.lang.reflect.TypeextractRealType(java.lang.Class<?> root, java.lang.reflect.Type type)protected voidfillMeta(java.lang.reflect.Field f, Schema schema)voidfillSchema(java.lang.reflect.Type rawModel, Schema schema, SchemaProcessor.Cache cache, SchemaProcessor.ReflectionValueExtractor reflectionValueExtractor, SchemaProcessor.Instance instance)private java.util.Optional<java.lang.String>find(java.lang.String method, java.lang.annotation.Annotation doc)protected java.util.Optional<java.lang.annotation.Annotation>findDocAnnotation(java.lang.reflect.Field f)private java.lang.StringfindFieldName(java.lang.reflect.Field f)private java.lang.StringfindMethodName(java.lang.reflect.Method m)private voidgetOrCreateReusableObjectComponent(java.lang.Class<?> from, Schema schema, SchemaProcessor.Cache cache, SchemaProcessor.ReflectionValueExtractor reflectionValueExtractor, SchemaProcessor.Instance instance)private voidhandleRequired(Schema schema, java.util.function.Supplier<java.lang.String> nameSupplier)private booleanisStringable(java.lang.reflect.Type model)private booleanisVisible(java.lang.reflect.AnnotatedElement elt, int modifiers)SchemamapSchemaFromClass(java.lang.reflect.Type model)SchemamapSchemaFromClass(java.lang.reflect.Type model, SchemaProcessor.Cache cache)protected voidonIgnored(Schema schema, java.lang.reflect.Field f, SchemaProcessor.Cache cache)private java.lang.reflect.TyperesolveParameterizedType(java.lang.reflect.Type type, java.lang.Class<?> declaringClass)private java.lang.reflect.TyperesolveType(java.lang.reflect.Type type, java.lang.Class<?> declaringClass)private java.util.Map<java.lang.reflect.Type,java.lang.reflect.Type>toResolvedTypes(java.lang.reflect.Type clazz, int maxIt)private java.lang.reflect.TypeunwrapType(java.lang.reflect.Type rawModel)
-
-
-
Method Detail
-
mapSchemaFromClass
public Schema mapSchemaFromClass(java.lang.reflect.Type model)
-
mapSchemaFromClass
public Schema mapSchemaFromClass(java.lang.reflect.Type model, SchemaProcessor.Cache cache)
-
doMapSchemaFromClass
private Schema doMapSchemaFromClass(java.lang.reflect.Type model, SchemaProcessor.Cache cache, SchemaProcessor.ReflectionValueExtractor reflectionValueExtractor, SchemaProcessor.Instance instance)
-
fillSchema
public void fillSchema(java.lang.reflect.Type rawModel, Schema schema, SchemaProcessor.Cache cache, SchemaProcessor.ReflectionValueExtractor reflectionValueExtractor, SchemaProcessor.Instance instance)
-
getOrCreateReusableObjectComponent
private void getOrCreateReusableObjectComponent(java.lang.Class<?> from, Schema schema, SchemaProcessor.Cache cache, SchemaProcessor.ReflectionValueExtractor reflectionValueExtractor, SchemaProcessor.Instance instance)
-
fillMeta
protected void fillMeta(java.lang.reflect.Field f, Schema schema)
-
findDocAnnotation
protected java.util.Optional<java.lang.annotation.Annotation> findDocAnnotation(java.lang.reflect.Field f)
-
find
private java.util.Optional<java.lang.String> find(java.lang.String method, java.lang.annotation.Annotation doc)
-
onIgnored
protected void onIgnored(Schema schema, java.lang.reflect.Field f, SchemaProcessor.Cache cache)
-
createIgnorePredicate
protected java.util.function.BiPredicate<java.lang.reflect.Type,java.lang.String> createIgnorePredicate(java.lang.Class<?> from)
-
isVisible
private boolean isVisible(java.lang.reflect.AnnotatedElement elt, int modifiers)
-
unwrapType
private java.lang.reflect.Type unwrapType(java.lang.reflect.Type rawModel)
-
isStringable
private boolean isStringable(java.lang.reflect.Type model)
-
handleRequired
private void handleRequired(Schema schema, java.util.function.Supplier<java.lang.String> nameSupplier)
-
findFieldName
private java.lang.String findFieldName(java.lang.reflect.Field f)
-
findMethodName
private java.lang.String findMethodName(java.lang.reflect.Method m)
-
decapitalize
private java.lang.String decapitalize(java.lang.String name)
-
resolveType
private java.lang.reflect.Type resolveType(java.lang.reflect.Type type, java.lang.Class<?> declaringClass)
-
resolveParameterizedType
private java.lang.reflect.Type resolveParameterizedType(java.lang.reflect.Type type, java.lang.Class<?> declaringClass)
-
toResolvedTypes
private java.util.Map<java.lang.reflect.Type,java.lang.reflect.Type> toResolvedTypes(java.lang.reflect.Type clazz, int maxIt)
-
extractRealType
private java.lang.reflect.Type extractRealType(java.lang.Class<?> root, java.lang.reflect.Type type)
-
-