Interface ApplicationComponent
-
- All Known Subinterfaces:
ASTManager
,NodeSelectionSource
,PersistenceManager
- All Known Implementing Classes:
AbstractController
,ASTManagerImpl
,AstTreeView
,EditPropertyDialogController
,EventLogController
,EventLoggerImpl
,GlobalDiskManagerImpl
,MainDesignerController
,MetricPaneController
,NodeDetailPaneController
,NodeEditionCodeArea
,NodeParentageCrumbBar
,OnDiskPersistenceManager
,PropertyCollectionView
,PropertyMapView
,RuleEditorsController
,ScopesPanelController
,SourceEditorController
,TestCollectionController
,TestExportWizardController
,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 ApplicationComponent
Some 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.
Control
s, should be injected with the designer root at initialization time, eg whatSourceEditorController
does withAstTreeView
.Some more specific cross-cutting structures for the internals of the app are the
SettingsOwner
tree, which is more or less identical to theAbstractController
tree.- Author:
- Clément Fournier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.String
getDebugName()
A debug name for this component, used in developer mode to e.g.DesignerRoot
getDesignerRoot()
default net.sourceforge.pmd.lang.LanguageVersion
getGlobalLanguageVersion()
default LogEntry.Category
getLogCategory()
A default category for exceptions coming from this component.default EventLogger
getLogger()
Gets the logger of the application.default javafx.stage.Stage
getMainStage()
Gets the main stage of the application.default <T> T
getService(AppServiceDescriptor<T> descriptor)
default org.reactfx.value.Val<net.sourceforge.pmd.lang.Language>
globalLanguageProperty()
The language is now global to the app.default boolean
isDeveloperMode()
If true, some more events are pushed to the event log, and console streams are open.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.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.default void
logInternalException(java.lang.Throwable throwable)
Logs an exception that occurred somewhere in the app logic.default void
logUserException(java.lang.Throwable throwable, LogEntry.Category category)
Notify the logger of an exception that somewhere in PMD logic.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.default void
raiseParsableXPathFlag()
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<net.sourceforge.pmd.lang.Language> globalLanguageProperty()
The language is now global to the app.
-
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.
-
-