Class PatternPrinter

java.lang.Object
spoon.pattern.internal.DefaultGenerator
spoon.pattern.internal.PatternPrinter
All Implemented Interfaces:
Generator

public class PatternPrinter extends DefaultGenerator
Generates the source code corresponding to a Pattern's RootNode
  • Constructor Details

    • PatternPrinter

      public PatternPrinter()
  • Method Details

    • printNode

      public String printNode(RootNode node)
    • generateTargets

      public <T> void generateTargets(RootNode node, ResultHolder<T> result, ImmutableMap parameters)
      Description copied from class: DefaultGenerator
      Generates zero, one or more target depending on kind of this RootNode, expected `result` and input `parameters`
      Overrides:
      generateTargets in class DefaultGenerator
      Parameters:
      node - to be generated node
      result - the holder which receives the generated node
      parameters - the input parameters
    • getValueAs

      public <T> void getValueAs(ParameterInfo parameterInfo, ResultHolder<T> result, ImmutableMap parameters)
      Description copied from class: DefaultGenerator
      Returns zero, one or more values into `result`. The value comes from `parameters` from the location defined by `parameterInfo`
      Overrides:
      getValueAs in class DefaultGenerator
      Parameters:
      parameterInfo - the ParameterInfo, which describes exact parameter from `parameters`
      result - the holder which receives the generated node
      parameters - the input parameters
    • setPrintParametersAsComments

      public PatternPrinter setPrintParametersAsComments(boolean printParametersAsComments)
    • isPrintParametersAsComments

      public boolean isPrintParametersAsComments()