Interface ApplicationComponent
-
- All Known Subinterfaces:
ASTManager,NodeSelectionSource,PersistenceManager
- All Known Implementing Classes:
AbstractController,ASTManagerImpl,ASTTreeCell,ASTTreeItem,AstTreeView,EditPropertyDialogController,EventLogController,EventLoggerImpl,GlobalDiskManagerImpl,LiveTreeRenderer,MainDesignerController,MetricPaneController,NodeDetailPaneController,NodeEditionCodeArea,NodeParentageCrumbBar,OnDiskPersistenceManager,PropertyCollectionView,PropertyMapView,RuleEditorsController,ScopesPanelController,SourceEditorController,TestCollectionController,TestExportWizardController,TreeExportWizardController,TreeRendererRegistry,ViolationCollectionView,XPathRuleEditorController,XPathUpdateSubscriber,XpathViolationListCell
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ApplicationComponentSome part of the application, e.g. a controller. Components in an instance of the app are all linked to the sameDesignerRoot, which hosts utilities globally available to the app, e.g. the logger.Components that are not controllers, e.g.
Controls, should be injected with the designer root at initialization time, eg whatSourceEditorControllerdoes withAstTreeView.Some more specific cross-cutting structures for the internals of the app are the
SettingsOwnertree, which is more or less identical to theAbstractControllertree.- Author:
- Clément Fournier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.StringgetDebugName()A debug name for this component, used in developer mode to e.g.DesignerRootgetDesignerRoot()default net.sourceforge.pmd.lang.LanguageVersiongetGlobalLanguageVersion()default LogEntry.CategorygetLogCategory()A default category for exceptions coming from this component.default EventLoggergetLogger()Gets the logger of the application.default javafx.stage.StagegetMainStage()Gets the main stage of the application.default <T> TgetService(AppServiceDescriptor<T> descriptor)default org.reactfx.value.Val<@NonNull net.sourceforge.pmd.lang.Language>globalLanguageProperty()The language is now global to the app.default booleanisDeveloperMode()If true, some more events are pushed to the event log, and console streams are open.default org.reactfx.value.Val<net.sourceforge.pmd.util.designerbindings.DesignerBindings>languageBindingsProperty()default voidlogInternalDebugInfo(java.util.function.Supplier<java.lang.String> shortMessage, java.util.function.Supplier<java.lang.String> details)Logs an exception that occurred somewhere in the app logic.default voidlogInternalDebugInfo(java.util.function.Supplier<java.lang.String> shortMessage, java.util.function.Supplier<java.lang.String> details, boolean trace)Logs an exception that occurred somewhere in the app logic.default voidlogInternalException(java.lang.Throwable throwable)Logs an exception that occurred somewhere in the app logic.default voidlogUserException(java.lang.Throwable throwable, LogEntry.Category category)Notify the logger of an exception that somewhere in PMD logic.default voidraiseParsableSourceFlag(java.util.function.Supplier<java.lang.String> details)Notify the logger that source code parsing succeeded and that the last recent failure may be thrown away.default voidraiseParsableXPathFlag()Notify the logger that XPath parsing succeeded and that the last recent failure may be thrown away.
-
-
-
Method Detail
-
getDesignerRoot
DesignerRoot getDesignerRoot()
-
getService
default <T> T getService(AppServiceDescriptor<T> descriptor)
-
getGlobalLanguageVersion
default net.sourceforge.pmd.lang.LanguageVersion getGlobalLanguageVersion()
-
globalLanguageProperty
default org.reactfx.value.Val<@NonNull net.sourceforge.pmd.lang.Language> globalLanguageProperty()
The language is now global to the app.
-
languageBindingsProperty
default org.reactfx.value.Val<net.sourceforge.pmd.util.designerbindings.DesignerBindings> languageBindingsProperty()
-
getLogger
default EventLogger getLogger()
Gets the logger of the application. Events pushed to the logger are filtered then forwarded to the Event Log control.- Returns:
- The logger
-
getDebugName
default java.lang.String getDebugName()
A debug name for this component, used in developer mode to e.g. trace events handling paths.
-
getLogCategory
default LogEntry.Category getLogCategory()
A default category for exceptions coming from this component.
-
getMainStage
default javafx.stage.Stage getMainStage()
Gets the main stage of the application.
-
isDeveloperMode
default boolean isDeveloperMode()
If true, some more events are pushed to the event log, and console streams are open. This is enabled by the -v or --verbose option on command line for now.
-
logUserException
default void logUserException(java.lang.Throwable throwable, LogEntry.Category category)Notify the logger of an exception that somewhere in PMD logic. Exceptions raised by the app logic are considered internal and should be forwarded to the logger usinglogInternalException(Throwable). If we're not in developer mode they will be ignored.
-
raiseParsableXPathFlag
default void raiseParsableXPathFlag()
Notify the logger that XPath parsing succeeded and that the last recent failure may be thrown away. Only logged in developer mode.
-
raiseParsableSourceFlag
default void raiseParsableSourceFlag(java.util.function.Supplier<java.lang.String> details)
Notify the logger that source code parsing succeeded and that the last recent failure may be thrown away. Only logged in developer mode.
-
logInternalException
default void logInternalException(java.lang.Throwable throwable)
Logs an exception that occurred somewhere in the app logic.
-
logInternalDebugInfo
default void logInternalDebugInfo(java.util.function.Supplier<java.lang.String> shortMessage, java.util.function.Supplier<java.lang.String> details)Logs an exception that occurred somewhere in the app logic.
-
logInternalDebugInfo
default void logInternalDebugInfo(java.util.function.Supplier<java.lang.String> shortMessage, java.util.function.Supplier<java.lang.String> details, boolean trace)Logs an exception that occurred somewhere in the app logic.
-
-