Class MapperContext
java.lang.Object
no.sikt.graphitron.generators.context.MapperContext
-
Method Summary
Modifier and TypeMethodDescriptionapplyEnumConversion(String typeName, CodeBlock getCall) static MapperContextcreateContext(GenerationField target, boolean toRecord, boolean mapsJavaRecord, ProcessedSchema schema) static MapperContextcreateResolverContext(GenerationField target, boolean toRecord, ProcessedSchema schema) static MapperContextcreateValidationContext(GenerationField target, ProcessedSchema schema) getPath()getRecordSetMappingBlock(String variableName) getSetMappingBlock(String valueToSet) getSetMappingBlock(CodeBlock valueToSet) booleanbooleanbooleanbooleanhasTable()booleanbooleaniterateContext(GenerationField field) protected <O> Oselect(O obj0, O obj1) booleanbooleanbooleanbooleantransformOutputRecord(String variableName) booleanbooleanwrapFields(CodeBlock fieldCode)
-
Method Details
-
getTargetType
-
getSchema
-
hasRecordReference
public boolean hasRecordReference() -
hasJavaRecordReference
public boolean hasJavaRecordReference() -
hasTable
public boolean hasTable() -
getTarget
-
getPreviousContext
-
isIterable
public boolean isIterable() -
wasIterable
public boolean wasIterable() -
isTopLevelContext
public boolean isTopLevelContext() -
targetIsType
public boolean targetIsType() -
getPath
-
getIndexPath
-
getSourceName
-
hasSourceName
public boolean hasSourceName() -
getTargetName
-
targetCanNotBeMapped
public boolean targetCanNotBeMapped() -
variableNotAlreadyDeclared
public boolean variableNotAlreadyDeclared() -
shouldUseStandardRecordFetch
public boolean shouldUseStandardRecordFetch() -
shouldUseException
public boolean shouldUseException() -
getSourceGetCallBlock
-
iterateContext
-
getInputVariableName
-
getOutputName
-
getHelperVariableName
-
getReturnType
-
wrapFields
-
getSetMappingBlock
-
getSetMappingBlock
-
getFieldSetMappingBlock
-
getResolverKeySetMappingBlock
-
getRecordSetMappingBlock
-
getRecordSetMappingBlock
-
transformOutputRecord
-
applyEnumConversion
-
getReturnBlock
-
transformInputRecord
- Returns:
- CodeBlock for the mapping of a record. Includes path for validation.
-
select
protected <O> O select(O obj0, O obj1) - Returns:
- The object that should be used based on whether this mapper maps to or from a record.
-
createContext
public static MapperContext createContext(GenerationField target, boolean toRecord, boolean mapsJavaRecord, ProcessedSchema schema) -
createResolverContext
public static MapperContext createResolverContext(GenerationField target, boolean toRecord, ProcessedSchema schema) -
createValidationContext
-