Skip to content

Package io.github.qishr.cascara.schema.util

Class SchemaGenerator

java.lang.Object
        io.github.qishr.cascara.schema.util.SchemaGenerator


public final class SchemaGenerator

Field Summary

Modifier and Type Field Description
public static final String DESCRIPTION_KEY
public static final String ENUM_KEY
public static final String TITLE_KEY

Constructor Summary

Constructor Description
SchemaGenerator()

Method Summary

Modifier and Type Method Description
public void registerTypeAnalyzer(TypeAnalyzer ta)
public void registerTypeDescriptor(TypeDescriptor<?> typeDescriptor)
public GenericAstMap generate(Object template)
public GenericAstMap generate(Class<?> clazz) Generates a schema for a class.
public GenericAstMap generate(GenericAstMap parentDoc, Class<?> clazz)
public GenericAstMap generate(MapAstNode parentDoc, String fragment, Class<?> clazz)
public GenericAstMap generate(MapAstNode parentDoc, String fragment, Class<?> clazz, Object template)
public Set<Class<?>> getReferencedClasses(Class<?> clazz)

Field Details

DESCRIPTION_KEY

public static final String DESCRIPTION_KEY

See Also:

Constant Field Values


ENUM_KEY

public static final String ENUM_KEY

See Also:

Constant Field Values


TITLE_KEY

public static final String TITLE_KEY

See Also:

Constant Field Values


Method Details

registerTypeAnalyzer

public void registerTypeAnalyzer(TypeAnalyzer ta)


registerTypeDescriptor

public void registerTypeDescriptor(TypeDescriptor<?> typeDescriptor)


generate

public GenericAstMap generate(Object template)


generate

public GenericAstMap generate(Class<?> clazz)

Generates a schema for a class.If the class is annotated with @SchemaDefinition, the name and description specified there is used in the generated schema. Fields must be annotated with @SchemaProperty to be included in the generated schema.


generate

public GenericAstMap generate(GenericAstMap parentDoc, Class<?> clazz)


generate

public GenericAstMap generate(MapAstNode parentDoc, String fragment, Class<?> clazz)


generate

public GenericAstMap generate(MapAstNode parentDoc, String fragment, Class<?> clazz, Object template)


getReferencedClasses

public Set<Class<?>> getReferencedClasses(Class<?> clazz)