com.puppycrawl.tools.checkstyle
Class ConfigurationLoader

java.lang.Object
  extended by com.puppycrawl.tools.checkstyle.ConfigurationLoader

public final class ConfigurationLoader
extends Object

Loads a configuration from a standard configuration XML file.

Version:
1.0
Author:
Oliver Burn

Method Summary
static Configuration loadConfiguration(InputSource aConfigSource, PropertyResolver aOverridePropsResolver, boolean aOmitIgnoredModules)
          Returns the module configurations from a specified input source.
static Configuration loadConfiguration(InputStream aConfigStream, PropertyResolver aOverridePropsResolver, boolean aOmitIgnoredModules)
          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
static Configuration loadConfiguration(String aConfig, PropertyResolver aOverridePropsResolver)
          Returns the module configurations in a specified file.
static Configuration loadConfiguration(String aConfig, PropertyResolver aOverridePropsResolver, boolean aOmitIgnoredModules)
          Returns the module configurations in a specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadConfiguration

public static Configuration loadConfiguration(String aConfig,
                                              PropertyResolver aOverridePropsResolver)
                                       throws CheckstyleException
Returns the module configurations in a specified file.

Parameters:
aConfig - location of config file, can be either a URL or a filename
aOverridePropsResolver - overriding properties
Returns:
the check configurations
Throws:
CheckstyleException - if an error occurs

loadConfiguration

public static Configuration loadConfiguration(String aConfig,
                                              PropertyResolver aOverridePropsResolver,
                                              boolean aOmitIgnoredModules)
                                       throws CheckstyleException
Returns the module configurations in a specified file.

Parameters:
aConfig - location of config file, can be either a URL or a filename
aOverridePropsResolver - overriding properties
aOmitIgnoredModules - 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(InputStream aConfigStream,
                                                         PropertyResolver aOverridePropsResolver,
                                                         boolean aOmitIgnoredModules)
                                       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:
aConfigStream - the input stream to the Checkstyle configuration
aOverridePropsResolver - overriding properties
aOmitIgnoredModules - true if modules with severity 'ignore' should be omitted, false otherwise
Returns:
the check configurations
Throws:
CheckstyleException - if an error occurs

loadConfiguration

public static Configuration loadConfiguration(InputSource aConfigSource,
                                              PropertyResolver aOverridePropsResolver,
                                              boolean aOmitIgnoredModules)
                                       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:
aConfigSource - the input stream to the Checkstyle configuration
aOverridePropsResolver - overriding properties
aOmitIgnoredModules - true if modules with severity 'ignore' should be omitted, false otherwise
Returns:
the check configurations
Throws:
CheckstyleException - if an error occurs


Copyright © 2001-2012. All Rights Reserved.