Class AnnotationsMapper
java.lang.Object
io.github.besi97.graphql.codegen.mapper.AnnotationsMapper
- Direct Known Subclasses:
JavaAnnotationsMapper,KotlinAnnotationsMapper
Mapper for annotations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanWhether to add model validation annotation to a typegetAdditionalAnnotations(MappingContext mappingContext, String typeName) getAnnotations(MappingContext mappingContext, graphql.language.Type<?> type, graphql.language.NamedNode<?> def, String parentTypeName, boolean mandatory) Get annotations for a given GraphQL typegetAnnotations(MappingContext mappingContext, ExtendedDefinition<?, ?> extendedDefinition) getAnnotations(MappingContext mappingContext, String name) getAnnotations(MappingContext mappingContext, String graphQLTypeName, String name, String parentTypeName, List<graphql.language.Directive> directives, boolean mandatory, graphql.language.NamedNode<?> def) Get annotations for a given GraphQL typegetAnnotationsForDirective(MappingContext mappingContext, List<String> directiveAnnotations, graphql.language.Directive directive) Get a list of annotations for a given directive based on mapping configabstract StringgetJacksonResolverTypeIdAnnotation(String modelPackageName) Get language specific Jackson type id resolver annotationgetJacksonTypeIdAnnotations(MappingContext mappingContext, graphql.language.NamedNode<?> def) Get Jackson type id resolver annotationsabstract ValueMapper
-
Constructor Details
-
AnnotationsMapper
public AnnotationsMapper()
-
-
Method Details
-
getAnnotations
public List<String> getAnnotations(MappingContext mappingContext, graphql.language.Type<?> type, graphql.language.NamedNode<?> def, String parentTypeName, boolean mandatory) Get annotations for a given GraphQL type- Parameters:
mappingContext- Global mapping contexttype- GraphQL typedef- GraphQL definitionparentTypeName- Name of the parent typemandatory- Type is mandatory- Returns:
- list of Java annotations for a given GraphQL type
-
getAnnotations
public List<String> getAnnotations(MappingContext mappingContext, ExtendedDefinition<?, ?> extendedDefinition) -
getAnnotations
-
getAnnotations
public List<String> getAnnotations(MappingContext mappingContext, String graphQLTypeName, String name, String parentTypeName, List<graphql.language.Directive> directives, boolean mandatory, graphql.language.NamedNode<?> def) Get annotations for a given GraphQL type- Parameters:
mappingContext- Global mapping contextgraphQLTypeName- GraphQL typename- Name of the GraphQL typeparentTypeName- Name of the parent typedirectives- List of GraphQL directivemandatory- Type is mandatorydef- GraphQL definition- Returns:
- list of Java annotations for a given GraphQL type
-
getAnnotationsForDirective
public List<String> getAnnotationsForDirective(MappingContext mappingContext, List<String> directiveAnnotations, graphql.language.Directive directive) Get a list of annotations for a given directive based on mapping config- Parameters:
mappingContext- Global mapping contextdirectiveAnnotations- List of directive annotationsdirective- GraphQL Directive- Returns:
- a list of annotations to be added for all types that have given directive
-
getJacksonTypeIdAnnotations
public List<String> getJacksonTypeIdAnnotations(MappingContext mappingContext, graphql.language.NamedNode<?> def) Get Jackson type id resolver annotations- Parameters:
mappingContext- Global mapping contextdef- GraphQL definition- Returns:
- list of Jackson type id resolver annotations
-
getJacksonResolverTypeIdAnnotation
Get language specific Jackson type id resolver annotation- Parameters:
modelPackageName- Model package name property- Returns:
- language specific Jackson type id resolver annotation
-
getAdditionalAnnotations
protected abstract List<String> getAdditionalAnnotations(MappingContext mappingContext, String typeName) -
addModelValidationAnnotationForType
Whether to add model validation annotation to a type- Parameters:
type- GraphQL type name- Returns:
- true if model validation annotation should be added to a type
-
getValueMapper
-