Class Reporting
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 Summary
FieldsFields inherited from class de.se_rwth.commons.logging.Log
errorHook, failQuick, findings, isDEBUG, isINFO, isInteractive, isTRACE, log, logHooks -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddReportHook(ReportLogHook reportHook) static voidClears the current report hooks, e.g.static voidInvoking this method causes all AReporter to close their files and all OneTimeReporter to write their content into files.static Stringprotected static List<ReportLogHook> static voidinit(String reportDirectory, ReportManager.ReportManagerFactory factory) static voidinit(String outputDirectory, String reportDirectory, ReportManager.ReportManagerFactory factory) Deprecated.static booleanstatic Stringoff()Disable reporting entirely.static booleanEnable reporting for the given model name.static voidReports the assignment of hook points to a template viaGlobalExtensionManagement.setAfterTemplate(String, List).static voidReports the assignment of hook points to a template viaGlobalExtensionManagement.setAfterTemplate(String, List).static voidreportAddValue(String name, Object value, int size) static voidreportASTSpecificTemplateReplacement(String oldTemplate, ASTNode node, HookPoint newHp) Reports the replacement of a template by an AST hook point via thereplaceTemplatemethod of theGlobalExtensionManagement.static voidreportCallAfterHookPoint(String oldTemplate, Collection<HookPoint> afterHps, ASTNode ast) Reports the execution of hook points via theincludeorincludeArgsmethod of theTemplateController.static voidreportCallBeforeHookPoint(String oldTemplate, Collection<HookPoint> beforeHps, ASTNode ast) Reports the execution of hook points via theincludeorincludeArgsmethod of theTemplateController.static voidreportCallHookPointEnd(String hookName) Reports the end of the execution of a hook point via theGlobalExtensionManagement.bindHookPoint(String, HookPoint)(TemplateController, String, ASTNode) callHookPoint} method.static voidreportCallHookPointStart(String hookName, HookPoint hp, ASTNode ast) Reports the execution of a hook point via the callHookPoint} method.static voidreportCallReplacementHookPoint(String oldTemplate, List<HookPoint> hps, ASTNode ast) Reports the execution of hook points via theincludeorincludeArgsmethod of theTemplateController.static voidreportCallSpecificReplacementHookPoint(String oldTemplate, List<HookPoint> hps, ASTNode ast) Reports the execution of hook points via theincludeorincludeArgsmethod of theTemplateController.static voidreportError(String msg) static voidreportExecuteStandardTemplate(String templateName, ASTNode ast) Reports the execution of a standard template that is wrapped into a template hook point,static voidreportFileCreation(String fileName) Reports a file creationstatic voidreportFileCreation(String templateName, String qualifiedFilename, String fileExtension, ASTNode ast) Reports a template based file creation.static voidreportFileCreation(String templateName, Path path, ASTNode ast) Reports a template based file creation via thewriteArgsmethod of theTemplateController.static voidreportFileCreation(Path parentPath, Path file) Reports a file creationstatic voidreportFileExistenceChecking(List<Path> parentPath, Path file) Reports a checking of file existencestatic voidreportFileFinalization(String templateName, String qualifiedFilename, String fileExtension, ASTNode ast) Reports the end of a file creation (file finalization).static voidreportFileFinalization(String templateName, Path path, ASTNode ast) Reports the end of a file creation (file finalization).static voidreportHWCExistenceCheck(MCPath mcp, Path fileName, Optional<URL> resolvedPath) Reports the check for existence of an artifactstatic voidreportInstantiate(String className, List<Object> params) static voidreportMethodCall(String className, String methodName, List<Object> params) static voidreportModelEnd(String modelName, String fileName) static voidreportModelLoad(String qualifiedName) static voidreportModelStart(ASTNode ast, String modelName, String fileName) static voidreportOpenInputFile(String fileName) This method is called when an input file is opened which is obtained via model resolution.static voidreportOpenInputFile(Optional<Path> parentPath, Path file) This method is called when an input file is opened which is obtained via model resolution.static voidreportParseInputFile(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.static voidReports the addition of hook points to a template viaGlobalExtensionManagement.setAfterTemplate(String, List).static voidreportSetBeforeTemplate(String template, Optional<ASTNode> ast, List<? extends HookPoint> beforeHps) Reports the assignment of hook points to a template viaGlobalExtensionManagement.setBeforeTemplate(String, List).static voidreportSetHookPoint(String hookName, HookPoint hp) Reports the registration of a hook point via theGlobalExtensionManagement.defineHookPoint(TemplateController, String)(String, HookPoint) setHookPoint} method of theGlobalExtensionManagement.static voidreportSetValue(String name, Object value) static voidreportSymbolTableScope(IScope scope) This method is called to report the content of the symbol table.static voidreportTemplateEnd(String templateName, ASTNode ast) Reports the end of a template execution.static voidreportTemplateInclude(String templateName, ASTNode ast) Reports template inclusion.static voidreportTemplateReplacement(String oldTemplate, List<? extends HookPoint> newHps) Reports the replacement of a template by hook points via thereplaceTemplatemethod of theGlobalExtensionManagement.static voidreportTemplateStart(String templateName, ASTNode ast) Reports the execution of templatesstatic voidreportTemplateWrite(String templateName, ASTNode ast) Reports the template write.static voidreportToDetailed(String value) Invoking this method causes a report of value to DetailedReporter.static voidreportTransformationNewValue(String transformationName, boolean value) static voidreportTransformationNewValue(String transformationName, ASTNode ast) static voidreportTransformationNewValue(String transformationName, String value) static voidreportTransformationObjectChange(String transformationName, ASTNode ast, String attributeName) static voidreportTransformationObjectCreation(String transformationName, ASTNode ast) static voidreportTransformationObjectDeletion(String transformationName, ASTNode ast) static voidreportTransformationObjectMatch(String transformationName, ASTNode ast) static voidreportTransformationOldValue(String transformationName, boolean value) static voidreportTransformationOldValue(String transformationName, ASTNode ast) static voidreportTransformationOldValue(String transformationName, String value) static voidreportTransformationStart(String transformationName) static voidreportUseHandwrittenCodeFile(Path parentDir, Path fileName) static voidreportUserSpecificTemplate(Path parentDir, Path fileName) static voidreportWarning(String msg) Methods inherited from class de.se_rwth.commons.logging.Log
addFinding, addLogHook, clearFindings, clearLogHooks, debug, debug, debug, debug, debug, debug, debug, debug, doClearFindings, doDebug, doDebug, doDebug, doDebug, doDebug, doDebug, doDebug, doDebug, doEnableFailQuick, doEnableInteractive, doError, doError, doError, doError, doErrorIfNull, doErrorUser, doErrorUser, doErrorUser, doErrorUser, doErrPrintStackTrace, doGetErrorCount, doGetFindings, doGetFindingsCount, doInfo, doInfo, doInfo, doInfo, doIsDebugEnabled, doIsFailQuickEnabled, doIsInfoEnabled, doIsInteractive, doIsTraceEnabled, doPrint, doPrintln, doPrintStackTrace, doTrace, doTrace, doTrace, doTrace, doWarn, doWarn, doWarn, doWarn, enableFailQuick, enableInteractive, ensureInitialization, error, error, error, error, errorIfNull, errorIfNull, errorInternal, errorInternal, errorInternal, errorInternal, errorUser, errorUser, errorUser, errorUser, getDefaultErrorHook, getErrorCount, getFindings, getFindingsCount, getLog, info, info, info, info, init, initDEBUG, initInteractive, initSlf4j, initTRACE, initWARN, internalRemove, isDebugEnabled, isFailQuickEnabled, isInfoEnabled, isInteractive, isTraceEnabled, print, printFindings, println, removeLogHook, setErrorHook, setLog, terminateIfErrors, trace, trace, trace, trace, warn, warn, warn, warn, warnUser
-
Field Details
-
enabled
protected static boolean enabled -
currentModel
-
-
Constructor Details
-
Reporting
public Reporting()
-
-
Method Details
-
getCurrentModel
-
init
@Deprecated public static void init(String outputDirectory, String reportDirectory, ReportManager.ReportManagerFactory factory) Deprecated. -
init
-
isEnabled
public static boolean isEnabled()- Returns:
- whether reporting is currently enabled
-
on
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
Disable reporting entirely.- Returns:
- the currently active model name for which reporting was active
-
getReportHooks
-
addReportHook
-
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
-
reportTransformationObjectMatch
-
reportTransformationOldValue
-
reportTransformationNewValue
-
reportTransformationOldValue
-
reportTransformationNewValue
-
reportTransformationOldValue
-
reportTransformationNewValue
-
reportTransformationObjectChange
-
reportTransformationObjectCreation
-
reportTransformationObjectDeletion
-
reportModelStart
-
reportTemplateStart
Reports the execution of templates -
reportExecuteStandardTemplate
Reports the execution of a standard template that is wrapped into a template hook point, -
reportFileCreation
Reports a template based file creation via thewriteArgsmethod of theTemplateController. -
reportFileCreation
Reports a file creation -
reportFileCreation
Reports a file creation -
reportFileFinalization
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
Reports a checking of file existence -
reportTemplateEnd
Reports the end of a template execution. -
reportModelEnd
-
reportModelLoad
-
reportSetValue
-
reportInstantiate
-
reportMethodCall
-
reportTemplateInclude
Reports template inclusion. -
reportTemplateWrite
Reports the template write. TemplateWrite does not calculate forwardings, it processes the template instantly. -
reportSetHookPoint
Reports the registration of a hook point via theGlobalExtensionManagement.defineHookPoint(TemplateController, String)(String, HookPoint) setHookPoint} method of theGlobalExtensionManagement. -
reportCallHookPointStart
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
Reports the end of the execution of a hook point via theGlobalExtensionManagement.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 theincludeorincludeArgsmethod of theTemplateController. 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 theincludeorincludeArgsmethod of theTemplateController. 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 theincludeorincludeArgsmethod of theTemplateController. 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 theincludeorincludeArgsmethod of theTemplateController. 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 thereplaceTemplatemethod of theGlobalExtensionManagement. This does not include any other assignment or replacement. -
reportTemplateReplacement
Reports the replacement of a template by hook points via thereplaceTemplatemethod of theGlobalExtensionManagement. 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 viaGlobalExtensionManagement.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 viaGlobalExtensionManagement.setAfterTemplate(String, List). This does not include any other assignment or replacement. -
reportUseHandwrittenCodeFile
-
reportAddAfterTemplate
public static void reportAddAfterTemplate(String template, Optional<ASTNode> ast, List<? extends HookPoint> afterHps) Reports the assignment of hook points to a template viaGlobalExtensionManagement.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 viaGlobalExtensionManagement.setAfterTemplate(String, List). This does not include any other assignment or replacement. -
reportHWCExistenceCheck
Reports the check for existence of an artifact -
reportUserSpecificTemplate
-
reportAddValue
-
reportToDetailed
Invoking this method causes a report of value to DetailedReporter.- Parameters:
value- that will be reported in DetailedReporter
-
reportOpenInputFile
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
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
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 butreportOpenInputFile(Optional, Path)instead. -
reportSymbolTableScope
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
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
-
reportError
-