java.lang.Object
de.se_rwth.commons.logging.Log
de.monticore.generating.templateengine.reporting.Reporting

public class Reporting extends de.se_rwth.commons.logging.Log
Facade for all reporting activities. Invoking a report method causes all AReporter implementing this method to execute it.
  • Field Details

    • enabled

      protected static boolean enabled
    • currentModel

      protected static String currentModel
  • Constructor Details

    • Reporting

      public Reporting()
  • Method Details

    • getCurrentModel

      public static String getCurrentModel()
    • init

      @Deprecated public static void init(String outputDirectory, String reportDirectory, ReportManager.ReportManagerFactory factory)
      Deprecated.
    • init

      public static void init(String reportDirectory, ReportManager.ReportManagerFactory factory)
    • isEnabled

      public static boolean isEnabled()
      Returns:
      whether reporting is currently enabled
    • on

      public static boolean on(String modelName)
      Enable reporting for the given model name.
      Parameters:
      modelName - for which to enable reporting
      Returns:
      whether reporting is enabled or not (reporting will not be enabled if reporting was not previously initialized)
    • off

      public static String off()
      Disable reporting entirely.
      Returns:
      the currently active model name for which reporting was active
    • getReportHooks

      protected static List<ReportLogHook> getReportHooks()
    • addReportHook

      public static void addReportHook(ReportLogHook reportHook)
    • clearReportHooks

      public static void clearReportHooks()
      Clears the current report hooks, e.g. at the end of a tool call Note: This does not report the clearing of the hooks!
    • reportTransformationStart

      public static void reportTransformationStart(String transformationName)
    • reportTransformationObjectMatch

      public static void reportTransformationObjectMatch(String transformationName, ASTNode ast)
    • reportTransformationOldValue

      public static void reportTransformationOldValue(String transformationName, ASTNode ast)
    • reportTransformationNewValue

      public static void reportTransformationNewValue(String transformationName, ASTNode ast)
    • reportTransformationOldValue

      public static void reportTransformationOldValue(String transformationName, String value)
    • reportTransformationNewValue

      public static void reportTransformationNewValue(String transformationName, String value)
    • reportTransformationOldValue

      public static void reportTransformationOldValue(String transformationName, boolean value)
    • reportTransformationNewValue

      public static void reportTransformationNewValue(String transformationName, boolean value)
    • reportTransformationObjectChange

      public static void reportTransformationObjectChange(String transformationName, ASTNode ast, String attributeName)
    • reportTransformationObjectCreation

      public static void reportTransformationObjectCreation(String transformationName, ASTNode ast)
    • reportTransformationObjectDeletion

      public static void reportTransformationObjectDeletion(String transformationName, ASTNode ast)
    • reportModelStart

      public static void reportModelStart(ASTNode ast, String modelName, String fileName)
    • reportTemplateStart

      public static void reportTemplateStart(String templateName, ASTNode ast)
      Reports the execution of templates
    • reportExecuteStandardTemplate

      public static void reportExecuteStandardTemplate(String templateName, ASTNode ast)
      Reports the execution of a standard template that is wrapped into a template hook point,
    • reportFileCreation

      public static void reportFileCreation(String templateName, Path path, ASTNode ast)
      Reports a template based file creation via the writeArgs method of the TemplateController.
    • reportFileCreation

      public static void reportFileCreation(Path parentPath, Path file)
      Reports a file creation
    • reportFileCreation

      public static void reportFileCreation(String fileName)
      Reports a file creation
    • reportFileFinalization

      public static void reportFileFinalization(String templateName, Path path, ASTNode ast)
      Reports the end of a file creation (file finalization).
    • reportFileCreation

      public static void reportFileCreation(String templateName, String qualifiedFilename, String fileExtension, ASTNode ast)
      Reports a template based file creation.
    • reportFileFinalization

      public static void reportFileFinalization(String templateName, String qualifiedFilename, String fileExtension, ASTNode ast)
      Reports the end of a file creation (file finalization).
    • reportFileExistenceChecking

      public static void reportFileExistenceChecking(List<Path> parentPath, Path file)
      Reports a checking of file existence
    • reportTemplateEnd

      public static void reportTemplateEnd(String templateName, ASTNode ast)
      Reports the end of a template execution.
    • reportModelEnd

      public static void reportModelEnd(String modelName, String fileName)
    • reportModelLoad

      public static void reportModelLoad(String qualifiedName)
    • reportSetValue

      public static void reportSetValue(String name, Object value)
    • reportInstantiate

      public static void reportInstantiate(String className, List<Object> params)
    • reportMethodCall

      public static void reportMethodCall(String className, String methodName, List<Object> params)
    • reportTemplateInclude

      public static void reportTemplateInclude(String templateName, ASTNode ast)
      Reports template inclusion.
    • reportTemplateWrite

      public static void reportTemplateWrite(String templateName, ASTNode ast)
      Reports the template write. TemplateWrite does not calculate forwardings, it processes the template instantly.
    • reportSetHookPoint

      public static void reportSetHookPoint(String hookName, HookPoint hp)
      Reports the registration of a hook point via the GlobalExtensionManagement.defineHookPoint(TemplateController, String) (String, HookPoint) setHookPoint} method of the GlobalExtensionManagement.
    • reportCallHookPointStart

      public static void reportCallHookPointStart(String hookName, HookPoint hp, ASTNode ast)
      Reports the execution of a hook point via the callHookPoint} method. This does not include the execution of hook points registered by the setBefore, setAfter or replaceTemplate Methods, nor the execution of AST specific hook points.
    • reportCallHookPointEnd

      public static void reportCallHookPointEnd(String hookName)
      Reports the end of the execution of a hook point via the GlobalExtensionManagement.bindHookPoint(String, HookPoint) (TemplateController, String, ASTNode) callHookPoint} method.
    • reportCallAfterHookPoint

      public static void reportCallAfterHookPoint(String oldTemplate, Collection<HookPoint> afterHps, ASTNode ast)
      Reports the execution of hook points via the include or includeArgs method of the TemplateController. This includes the execution of all hook points registered by setAfter.
    • reportCallBeforeHookPoint

      public static void reportCallBeforeHookPoint(String oldTemplate, Collection<HookPoint> beforeHps, ASTNode ast)
      Reports the execution of hook points via the include or includeArgs method of the TemplateController. This includes the execution of all hook points registered by setBefore.
    • reportCallReplacementHookPoint

      public static void reportCallReplacementHookPoint(String oldTemplate, List<HookPoint> hps, ASTNode ast)
      Reports the execution of hook points via the include or includeArgs method of the TemplateController. This includes the execution of all hook points registered by setReplace. These hook points replace a template.
    • reportCallSpecificReplacementHookPoint

      public static void reportCallSpecificReplacementHookPoint(String oldTemplate, List<HookPoint> hps, ASTNode ast)
      Reports the execution of hook points via the include or includeArgs method of the TemplateController. This includes the execution of all hook points registered by setASTSpecificReplacement.
    • reportASTSpecificTemplateReplacement

      public static void reportASTSpecificTemplateReplacement(String oldTemplate, ASTNode node, HookPoint newHp)
      Reports the replacement of a template by an AST hook point via the replaceTemplate method of the GlobalExtensionManagement. This does not include any other assignment or replacement.
    • reportTemplateReplacement

      public static void reportTemplateReplacement(String oldTemplate, List<? extends HookPoint> newHps)
      Reports the replacement of a template by hook points via the replaceTemplate method of the GlobalExtensionManagement. This does not include any other assignment or replacement.
    • reportSetBeforeTemplate

      public static void reportSetBeforeTemplate(String template, Optional<ASTNode> ast, List<? extends HookPoint> beforeHps)
      Reports the assignment of hook points to a template via GlobalExtensionManagement.setBeforeTemplate(String, List). This does not include any other assignment or replacement.
    • reportSetAfterTemplate

      public static void reportSetAfterTemplate(String template, Optional<ASTNode> ast, List<? extends HookPoint> afterHps)
      Reports the addition of hook points to a template via GlobalExtensionManagement.setAfterTemplate(String, List). This does not include any other assignment or replacement.
    • reportUseHandwrittenCodeFile

      public static void reportUseHandwrittenCodeFile(Path parentDir, Path fileName)
    • reportAddAfterTemplate

      public static void reportAddAfterTemplate(String template, Optional<ASTNode> ast, List<? extends HookPoint> afterHps)
      Reports the assignment of hook points to a template via GlobalExtensionManagement.setAfterTemplate(String, List). This does not include any other assignment or replacement.
    • reportAddBeforeTemplate

      public static void reportAddBeforeTemplate(String template, Optional<ASTNode> ast, List<? extends HookPoint> afterHps)
      Reports the assignment of hook points to a template via GlobalExtensionManagement.setAfterTemplate(String, List). This does not include any other assignment or replacement.
    • reportHWCExistenceCheck

      public static void reportHWCExistenceCheck(MCPath mcp, Path fileName, Optional<URL> resolvedPath)
      Reports the check for existence of an artifact
    • reportUserSpecificTemplate

      public static void reportUserSpecificTemplate(Path parentDir, Path fileName)
    • reportAddValue

      public static void reportAddValue(String name, Object value, int size)
    • reportToDetailed

      public static void reportToDetailed(String value)
      Invoking this method causes a report of value to DetailedReporter.
      Parameters:
      value - that will be reported in DetailedReporter
    • reportOpenInputFile

      public static void reportOpenInputFile(Optional<Path> parentPath, Path file)
      This method is called when an input file is opened which is obtained via model resolution. Such files typically are dependency models (e.g., super grammars, super CDs, ...).
    • reportOpenInputFile

      public static void reportOpenInputFile(String fileName)
      This method is called when an input file is opened which is obtained via model resolution. Such files typically are dependency models (e.g., super grammars, super CDs, ...).
    • reportParseInputFile

      public static void reportParseInputFile(Path inputFilePath, String modelName)
      This method is called when an input file is parsed; i.e., this report hook point is designed for the main input artifacts only. E.g., files that are loaded on demand during further processing should not report using this method but reportOpenInputFile(Optional, Path) instead.
    • reportSymbolTableScope

      public static void reportSymbolTableScope(IScope scope)
      This method is called to report the content of the symbol table. The method should only be called once during the execution of the generator.
    • flush

      public static void flush(ASTNode ast)
      Invoking this method causes all AReporter to close their files and all OneTimeReporter to write their content into files.
      Parameters:
      ast - the root node of the reported ast, may be null on error
    • reportWarning

      public static void reportWarning(String msg)
    • reportError

      public static void reportError(String msg)