Class ParserSettingsMonitor


  • class ParserSettingsMonitor
    extends java.lang.Object
    Keep traces of the usage of a ParserSettings in order to check afterwards that the relevant settings didn't changed.

    A ParserSettingsMonitor provide a ParserSettings that must be used in place of the original one.

    The current implementation consider that a settings changed iff one of the used variable has changed.

    • Field Detail

      • substitutes

        private final java.util.Map<java.lang.String,​java.lang.String> substitutes
    • Constructor Detail

      • ParserSettingsMonitor

        public ParserSettingsMonitor​(ParserSettings settings)
    • Method Detail

      • getMonitoredSettings

        public ParserSettings getMonitoredSettings()
        Returns:
        The parser settings that must be used in place of the original settings The returned object delegates all the call to the original settings.
      • endMonitoring

        public void endMonitoring()
        Free the resource used during the monitoring, keeping only the info required to evaluate hasChanged.
      • hasChanged

        public boolean hasChanged​(ParserSettings newSettings)
        Check if the newSettings is compatible with the original settings that has been monitored. Only the info that was actually used is compared.