Class AbstractSchemaMethodGenerator<T extends GenerationTarget,U extends GenerationTarget>
java.lang.Object
no.sikt.graphitron.generators.abstractions.AbstractSchemaMethodGenerator<T,U>
- All Implemented Interfaces:
MethodGenerator
- Direct Known Subclasses:
AbstractMapperMethodGenerator,DBMethodGenerator,ResolverMethodGenerator,TransformerMethodGenerator,TypeNameMethodGenerator,TypeResolverMethodGenerator
public abstract class AbstractSchemaMethodGenerator<T extends GenerationTarget,U extends GenerationTarget>
extends Object
implements MethodGenerator
An abstract generator that contains methods that are common between both DB-method generators and resolver generators.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,List<Dependency>> protected final Uprotected final ProcessedSchema -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSchemaMethodGenerator(U localObject, ProcessedSchema processedSchema) -
Method Summary
Modifier and TypeMethodDescriptionabstract MethodSpecgetDefaultSpecBuilder(String methodName, TypeName returnType) protected JOOQMappingprotected TypeNameinferFieldTypeName(GenerationField field, boolean checkRecordReferences) protected TypeNameiterableWrapType(GenerationField field) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface no.sikt.graphitron.generators.abstractions.MethodGenerator
generateAll
-
Field Details
-
localObject
-
processedSchema
-
dependencyMap
-
-
Constructor Details
-
AbstractSchemaMethodGenerator
-
-
Method Details
-
getLocalObject
- Returns:
- The object that this generator is attempting to build methods for.
-
getLocalTable
-
getDefaultSpecBuilder
- Parameters:
methodName- The name of the method.returnType- The return type of the method, as a javapoetTypeName.- Returns:
- The default builder for this class' methods, with any common settings applied.
-
getDependencyMap
- Specified by:
getDependencyMapin interfaceMethodGenerator- Returns:
- A set containing all dependencies necessary for these generated methods. Key is the method name where the dependency is needed.
-
iterableWrapType
- Returns:
- Get the javapoet TypeName for this field's type, and wrap it in a list ParameterizedTypeName if it is iterable.
-
inferFieldTypeName
- Returns:
- Get the javapoet TypeName for this field's type.
-
getDataFetcherWiring
- Returns:
- Any DataFetcher wiring this generator produces.
-
getTypeResolverWiring
- Returns:
- Any TypeRespolver wiring this generator produces.
-
generate
- Returns:
- The complete javapoet
MethodSpecbased on the provided target.
-