Class ConfigurationLoader


  • public final class ConfigurationLoader
    extends Object
    Loads a configuration from a standard configuration XML file.
    • Method Detail

      • loadConfiguration

        public static Configuration loadConfiguration​(String config,
                                                      PropertyResolver overridePropsResolver)
                                               throws CheckstyleException
        Returns the module configurations in a specified file.
        Parameters:
        config - location of config file, can be either a URL or a filename
        overridePropsResolver - overriding properties
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        public static Configuration loadConfiguration​(String config,
                                                      PropertyResolver overridePropsResolver,
                                                      ThreadModeSettings threadModeSettings)
                                               throws CheckstyleException
        Returns the module configurations in a specified file.
        Parameters:
        config - location of config file, can be either a URL or a filename
        overridePropsResolver - overriding properties
        threadModeSettings - the thread mode configuration
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        @Deprecated
        public static Configuration loadConfiguration​(String config,
                                                      PropertyResolver overridePropsResolver,
                                                      boolean omitIgnoredModules)
                                               throws CheckstyleException
        Deprecated.
        in order to fulfill demands of BooleanParameter IDEA check.
        Returns the module configurations in a specified file.
        Parameters:
        config - location of config file, can be either a URL or a filename
        overridePropsResolver - overriding properties
        omitIgnoredModules - true if modules with severity 'ignore' should be omitted, false otherwise
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        @Deprecated
        public static Configuration loadConfiguration​(String config,
                                                      PropertyResolver overridePropsResolver,
                                                      boolean omitIgnoredModules,
                                                      ThreadModeSettings threadModeSettings)
                                               throws CheckstyleException
        Deprecated.
        in order to fulfill demands of BooleanParameter IDEA check.
        Returns the module configurations in a specified file.
        Parameters:
        config - location of config file, can be either a URL or a filename
        overridePropsResolver - overriding properties
        omitIgnoredModules - true if modules with severity 'ignore' should be omitted, false otherwise
        threadModeSettings - the thread mode configuration
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        @Deprecated
        public static Configuration loadConfiguration​(InputStream configStream,
                                                      PropertyResolver overridePropsResolver,
                                                      boolean omitIgnoredModules)
                                               throws CheckstyleException
        Deprecated.
        As this method does not provide a valid system ID, preventing resolution of external entities, a version using an InputSource should be used instead
        Returns the module configurations from a specified input stream. Note that clients are required to close the given stream by themselves
        Parameters:
        configStream - the input stream to the Checkstyle configuration
        overridePropsResolver - overriding properties
        omitIgnoredModules - true if modules with severity 'ignore' should be omitted, false otherwise
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        @Deprecated
        public static Configuration loadConfiguration​(InputSource configSource,
                                                      PropertyResolver overridePropsResolver,
                                                      boolean omitIgnoredModules)
                                               throws CheckstyleException
        Deprecated.
        in order to fulfill demands of BooleanParameter IDEA check.
        Returns the module configurations from a specified input source. Note that if the source does wrap an open byte or character stream, clients are required to close that stream by themselves
        Parameters:
        configSource - the input stream to the Checkstyle configuration
        overridePropsResolver - overriding properties
        omitIgnoredModules - true if modules with severity 'ignore' should be omitted, false otherwise
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        @Deprecated
        public static Configuration loadConfiguration​(InputSource configSource,
                                                      PropertyResolver overridePropsResolver,
                                                      boolean omitIgnoredModules,
                                                      ThreadModeSettings threadModeSettings)
                                               throws CheckstyleException
        Deprecated.
        in order to fulfill demands of BooleanParameter IDEA check.
        Returns the module configurations from a specified input source. Note that if the source does wrap an open byte or character stream, clients are required to close that stream by themselves
        Parameters:
        configSource - the input stream to the Checkstyle configuration
        overridePropsResolver - overriding properties
        omitIgnoredModules - true if modules with severity 'ignore' should be omitted, false otherwise
        threadModeSettings - the thread mode configuration
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        public static Configuration loadConfiguration​(String config,
                                                      PropertyResolver overridePropsResolver,
                                                      ConfigurationLoader.IgnoredModulesOptions ignoredModulesOptions)
                                               throws CheckstyleException
        Returns the module configurations in a specified file.
        Parameters:
        config - location of config file, can be either a URL or a filename
        overridePropsResolver - overriding properties
        ignoredModulesOptions - OMIT if modules with severity 'ignore' should be omitted, EXECUTE otherwise
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        public static Configuration loadConfiguration​(String config,
                                                      PropertyResolver overridePropsResolver,
                                                      ConfigurationLoader.IgnoredModulesOptions ignoredModulesOptions,
                                                      ThreadModeSettings threadModeSettings)
                                               throws CheckstyleException
        Returns the module configurations in a specified file.
        Parameters:
        config - location of config file, can be either a URL or a filename
        overridePropsResolver - overriding properties
        ignoredModulesOptions - OMIT if modules with severity 'ignore' should be omitted, EXECUTE otherwise
        threadModeSettings - the thread mode configuration
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        public static Configuration loadConfiguration​(InputSource configSource,
                                                      PropertyResolver overridePropsResolver,
                                                      ConfigurationLoader.IgnoredModulesOptions ignoredModulesOptions)
                                               throws CheckstyleException
        Returns the module configurations from a specified input source. Note that if the source does wrap an open byte or character stream, clients are required to close that stream by themselves
        Parameters:
        configSource - the input stream to the Checkstyle configuration
        overridePropsResolver - overriding properties
        ignoredModulesOptions - OMIT if modules with severity 'ignore' should be omitted, EXECUTE otherwise
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs
      • loadConfiguration

        public static Configuration loadConfiguration​(InputSource configSource,
                                                      PropertyResolver overridePropsResolver,
                                                      ConfigurationLoader.IgnoredModulesOptions ignoredModulesOptions,
                                                      ThreadModeSettings threadModeSettings)
                                               throws CheckstyleException
        Returns the module configurations from a specified input source. Note that if the source does wrap an open byte or character stream, clients are required to close that stream by themselves
        Parameters:
        configSource - the input stream to the Checkstyle configuration
        overridePropsResolver - overriding properties
        ignoredModulesOptions - OMIT if modules with severity 'ignore' should be omitted, EXECUTE otherwise
        threadModeSettings - the thread mode configuration
        Returns:
        the check configurations
        Throws:
        CheckstyleException - if an error occurs