Class PreprocessorResult

java.lang.Object
processing.mode.java.preproc.PreprocessorResult

public class PreprocessorResult extends Object
Result of sketch Preprocessing.
  • Constructor Details

    • PreprocessorResult

      public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffset, String newClassName, List<ImportStatement> newImportStatements, List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight, String newSketchRenderer)
      Create a new preprocessing result.
      Parameters:
      newProgramType - The type of program that has be preprocessed.
      newHeaderOffset - The offset (in number of chars) from the start of the program at which the header finishes.
      newClassName - The name of the class containing the sketch.
      newImportStatements - The imports required for the sketch including defaults and core imports.
      newEdits - The edits made during preprocessing.
      newSketchWidth - The width of the sketch in pixels or special value like displayWidth;
      newSketchHeight - The height of the sketch in pixels or special value like displayWidth;
      newSketchRenderer - The renderer of the sketch.
    • PreprocessorResult

      public PreprocessorResult(PdePreprocessor.Mode newProgramType, int newHeaderOffset, String newClassName, List<ImportStatement> newImportStatements, List<TextTransform.Edit> newEdits, String newSketchWidth, String newSketchHeight, String newSketchRenderer, List<PdePreprocessIssue> newPreprocessIssues)
      Create a new preprocessing result with errors
      Parameters:
      newProgramType - The type of program that has be preprocessed.
      newHeaderOffset - The offset (in number of chars) from the start of the program at which the header finishes.
      newClassName - The name of the class containing the sketch.
      newImportStatements - The imports required for the sketch including defaults and core imports.
      newEdits - The edits made during preprocessing.
      newSketchWidth - The width of the sketch in pixels or special value like displayWidth;
      newSketchHeight - The height of the sketch in pixels or special value like displayWidth;
      newSketchRenderer - The renderer of the sketch.
  • Method Details

    • reportPreprocessIssues

      public static PreprocessorResult reportPreprocessIssues(List<PdePreprocessIssue> newPreprocessIssues)
      Create a new PreprocessorResult indicating that there were issues in preprocessing.
      Parameters:
      newPreprocessIssues - The list of issues encoutnered.
      Returns:
      New preprocessor result.
    • getPreprocessIssues

      public List<PdePreprocessIssue> getPreprocessIssues()
      Get the list of preprocess issues encountered.
      Returns:
      List of preprocess issues encountered.
    • getHeaderOffset

      public int getHeaderOffset()
      Get the end point of the header.
      Returns:
      The offset (in number of lines) from the start of the program at which the header finishes.
    • getClassName

      public String getClassName()
      Get the name of the Java class containing the sketch after preprocessing.
      Returns:
      The name of the class containing the sketch.
    • getProgramType

      public PdePreprocessor.Mode getProgramType()
      Get the type of program that was parsed.
      Returns:
      Type of program parsed like STATIC (no function) or ACTIVE.
    • getEdits

      public List<TextTransform.Edit> getEdits()
      Get the edits generated during preprocessing.
      Returns:
      List of edits generated during preprocessing.
    • getImportStatements

      public List<ImportStatement> getImportStatements()
      Get the found import statements as {ImportStatement}s.
      Returns:
      The import statements found for the user.
    • getSketchWidth

      public String getSketchWidth()
      Get the user provided width of this sketch.
      Returns:
      The width of the sketch in pixels or special value like displayWidth or null if none given.
    • getSketchHeight

      public String getSketchHeight()
      Get the user provided height of this sketch.
      Returns:
      The height of the sketch in pixels or special value like displayHeight or null if none given.
    • getSketchRenderer

      public String getSketchRenderer()
      Get the user provided renderer of this sketch.
      Returns:
      The renderer of the sketch or null if none given.