Class MapperContext

java.lang.Object
no.sikt.graphitron.generators.context.MapperContext

public class MapperContext extends Object
  • Method Details

    • getTargetType

      public RecordObjectDefinition<?,?> getTargetType()
    • getSchema

      public ProcessedSchema getSchema()
    • hasRecordReference

      public boolean hasRecordReference()
    • hasJavaRecordReference

      public boolean hasJavaRecordReference()
    • hasTable

      public boolean hasTable()
    • getTarget

      public GenerationField getTarget()
    • getPreviousContext

      public MapperContext getPreviousContext()
    • isIterable

      public boolean isIterable()
    • wasIterable

      public boolean wasIterable()
    • isTopLevelContext

      public boolean isTopLevelContext()
    • targetIsType

      public boolean targetIsType()
    • getPath

      public String getPath()
    • getIndexPath

      public String getIndexPath()
    • getSourceName

      public String getSourceName()
    • hasSourceName

      public boolean hasSourceName()
    • getTargetName

      public String getTargetName()
    • targetCanNotBeMapped

      public boolean targetCanNotBeMapped()
    • variableNotAlreadyDeclared

      public boolean variableNotAlreadyDeclared()
    • shouldUseStandardRecordFetch

      public boolean shouldUseStandardRecordFetch()
    • shouldUseException

      public boolean shouldUseException()
    • getSourceGetCallBlock

      public CodeBlock getSourceGetCallBlock()
    • iterateContext

      public MapperContext iterateContext(GenerationField field)
    • getInputVariableName

      public String getInputVariableName()
    • getOutputName

      public String getOutputName()
    • getHelperVariableName

      public String getHelperVariableName()
    • getReturnType

      public ClassName getReturnType()
    • wrapFields

      public CodeBlock wrapFields(CodeBlock fieldCode)
    • getSetMappingBlock

      public CodeBlock getSetMappingBlock(CodeBlock valueToSet)
    • getSetMappingBlock

      public CodeBlock getSetMappingBlock(String valueToSet)
    • getFieldSetMappingBlock

      public CodeBlock getFieldSetMappingBlock()
    • getResolverKeySetMappingBlock

      public CodeBlock getResolverKeySetMappingBlock()
    • getRecordSetMappingBlock

      public CodeBlock getRecordSetMappingBlock()
    • getRecordSetMappingBlock

      public CodeBlock getRecordSetMappingBlock(String variableName)
    • transformOutputRecord

      public CodeBlock transformOutputRecord(String variableName)
    • applyEnumConversion

      public CodeBlock applyEnumConversion(String typeName, CodeBlock getCall)
    • getReturnBlock

      public CodeBlock getReturnBlock()
    • transformInputRecord

      public CodeBlock 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

      public static MapperContext createValidationContext(GenerationField target, ProcessedSchema schema)