org.plovr
Class Config

java.lang.Object
  extended by org.plovr.Config
All Implemented Interfaces:
java.lang.Comparable<Config>

public final class Config
extends java.lang.Object
implements java.lang.Comparable<Config>


Nested Class Summary
static class Config.Builder
           
 
Field Summary
static java.lang.String GLOBAL_SCOPE_NAME
          This is the name of the scope that all global variables will be put into if the global-scope-name argument is supplied in the plovr config.
 
Method Summary
static Config.Builder builder(Config config)
           
static Config.Builder builder(java.io.File relativePathBase, java.io.File configFile, java.lang.String rootConfigFileContent)
           
static Config.Builder builderForTesting()
          Create a builder that can be used for testing.
 int compareTo(Config otherConfig)
          Configs are compared by their id so they can be sorted alphabetically.
 java.util.List<java.lang.String> getAllowedNonStandardCssFunctions()
           
 java.util.List<java.lang.String> getAllowedUnrecognizedProperties()
           
 CompilationMode getCompilationMode()
           
 PlovrCompilerOptions getCompilerOptions(PlovrClosureCompiler compiler)
           
 java.io.File getConfigFile()
          Gets the file that was loaded by plovr to create this config.
 java.util.Set<java.lang.String> getCssDefines()
           
 java.util.List<java.io.File> getCssInputs()
           
 java.io.File getCssOutputFile()
           
 java.io.File getDocumentationOutputDirectory()
           
 java.lang.String getGlobalScopeName()
           
 java.lang.String getGssFunctionMapProviderClassName()
           
 java.lang.String getId()
           
 java.lang.String getJsContentType()
          The value of the Content-Type header to use when writing JavaScript content in response to an HTTP request.
 Manifest getManifest()
           
 ModuleConfig getModuleConfig()
           
 java.nio.charset.Charset getOutputCharset()
           
 java.io.File getOutputFile()
           
 java.lang.String getOutputWrapper()
           
 java.lang.String getOutputWrapperMarker()
           
 java.io.File getPropertyMapInputFile()
           
 java.io.File getPropertyMapOutputFile()
           
 java.lang.String getRootConfigFileContent()
           
 ImmutableList<java.lang.String> getSoyFunctionPlugins()
           
 java.util.Set<java.io.File> getTestExcludePaths()
           
 java.io.File getTestFile(java.lang.String path)
           
 java.io.File getTestTemplate()
           
 boolean getTreatWarningsAsErrors()
           
 java.io.File getVariableMapInputFile()
           
 java.io.File getVariableMapOutputFile()
           
 com.google.javascript.jscomp.WarningLevel getWarningLevel()
           
 java.util.List<WebDriverFactory> getWebDriverFactories()
           
 boolean hasModules()
           
 boolean hasSoyFunctionPlugins()
           
 boolean isOutOfDate()
           
 boolean shouldFingerprintJsFiles()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GLOBAL_SCOPE_NAME

public static final java.lang.String GLOBAL_SCOPE_NAME
This is the name of the scope that all global variables will be put into if the global-scope-name argument is supplied in the plovr config. This scope name is never externally visible, but it does have the effect of shadowing access to any page-scope globals of that name. For example, if "$" were chosen, then that would shadow the global jQuery object, which would be problematic for developers who were using the Compiler with jQuery. As "a" is unlikely to be supplied as an extern, it is a good choice for the GLOBAL_SCOPE_NAME.

See Also:
Constant Field Values
Method Detail

builder

public static Config.Builder builder(java.io.File relativePathBase,
                                     java.io.File configFile,
                                     java.lang.String rootConfigFileContent)

builder

public static Config.Builder builder(Config config)

builderForTesting

public static Config.Builder builderForTesting()
Create a builder that can be used for testing. Paths will be resolved against the root folder of the system.


getId

public java.lang.String getId()

getRootConfigFileContent

public java.lang.String getRootConfigFileContent()

getManifest

public Manifest getManifest()

getModuleConfig

public ModuleConfig getModuleConfig()

hasModules

public boolean hasModules()

getSoyFunctionPlugins

public ImmutableList<java.lang.String> getSoyFunctionPlugins()

hasSoyFunctionPlugins

public boolean hasSoyFunctionPlugins()

getCompilationMode

public CompilationMode getCompilationMode()

getWarningLevel

public com.google.javascript.jscomp.WarningLevel getWarningLevel()

getOutputFile

public java.io.File getOutputFile()

getOutputWrapper

public java.lang.String getOutputWrapper()
Returns:
null if no output wrapper has been set

getOutputCharset

public java.nio.charset.Charset getOutputCharset()

getJsContentType

public java.lang.String getJsContentType()
The value of the Content-Type header to use when writing JavaScript content in response to an HTTP request.


getOutputWrapperMarker

public java.lang.String getOutputWrapperMarker()
Returns:
null if no output wrapper has been set

shouldFingerprintJsFiles

public boolean shouldFingerprintJsFiles()

getTreatWarningsAsErrors

public boolean getTreatWarningsAsErrors()

getDocumentationOutputDirectory

public java.io.File getDocumentationOutputDirectory()

getConfigFile

public java.io.File getConfigFile()
Gets the file that was loaded by plovr to create this config. Note that there may be other files that were loaded as part of the config inheritance change in order to create this config.


isOutOfDate

public boolean isOutOfDate()
Returns:
true if the last modified time for the underlying config file (or any of the config files that it inherited) has changed since this config was originally created

getGlobalScopeName

public java.lang.String getGlobalScopeName()

getVariableMapInputFile

public java.io.File getVariableMapInputFile()

getVariableMapOutputFile

public java.io.File getVariableMapOutputFile()

getPropertyMapInputFile

public java.io.File getPropertyMapInputFile()

getPropertyMapOutputFile

public java.io.File getPropertyMapOutputFile()

getTestTemplate

public java.io.File getTestTemplate()

getTestExcludePaths

public java.util.Set<java.io.File> getTestExcludePaths()

getCssInputs

public java.util.List<java.io.File> getCssInputs()

getCssDefines

public java.util.Set<java.lang.String> getCssDefines()

getAllowedUnrecognizedProperties

public java.util.List<java.lang.String> getAllowedUnrecognizedProperties()

getAllowedNonStandardCssFunctions

public java.util.List<java.lang.String> getAllowedNonStandardCssFunctions()

getGssFunctionMapProviderClassName

public java.lang.String getGssFunctionMapProviderClassName()

getCssOutputFile

public java.io.File getCssOutputFile()

getWebDriverFactories

public java.util.List<WebDriverFactory> getWebDriverFactories()

getTestFile

@Nullable
public java.io.File getTestFile(java.lang.String path)
Parameters:
path - a relative path, such as "foo/bar_test.js" or "foo/bar_test.html".
Returns:
the file under a test directory, if it exists, or null

getCompilerOptions

public PlovrCompilerOptions getCompilerOptions(PlovrClosureCompiler compiler)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(Config otherConfig)
Configs are compared by their id so they can be sorted alphabetically.

Specified by:
compareTo in interface java.lang.Comparable<Config>