org.plovr
Class Config

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

public final class Config
extends Object
implements Comparable<Config>


Nested Class Summary
static class Config.Builder
           
 
Field Summary
static 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(File relativePathBase, File configFile, 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.
 CompilationMode getCompilationMode()
           
 CompilerOptions getCompilerOptions(PlovrClosureCompiler compiler)
           
 File getConfigFile()
           
 File getDocumentationOutputDirectory()
           
 String getGlobalScopeName()
           
 String getId()
           
 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()
           
 Charset getOutputCharset()
           
 File getOutputFile()
           
 String getOutputWrapper()
           
 String getOutputWrapperMarker()
           
 File getPropertyMapInputFile()
           
 File getPropertyMapOutputFile()
           
 String getRootConfigFileContent()
           
 ImmutableList<String> getSoyFunctionPlugins()
           
 Set<File> getTestExcludePaths()
           
 File getTestFile(String path)
           
 File getTestTemplate()
           
 boolean getTreatWarningsAsErrors()
           
 File getVariableMapInputFile()
           
 File getVariableMapOutputFile()
           
 WarningLevel getWarningLevel()
           
 boolean hasModules()
           
 boolean hasSoyFunctionPlugins()
           
 boolean isOutOfDate()
           
 boolean shouldFingerprintJsFiles()
           
 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 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(File relativePathBase,
                                     File configFile,
                                     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 String getId()

getRootConfigFileContent

public String getRootConfigFileContent()

getManifest

public Manifest getManifest()

getModuleConfig

public ModuleConfig getModuleConfig()

hasModules

public boolean hasModules()

getSoyFunctionPlugins

public ImmutableList<String> getSoyFunctionPlugins()

hasSoyFunctionPlugins

public boolean hasSoyFunctionPlugins()

getCompilationMode

public CompilationMode getCompilationMode()

getWarningLevel

public WarningLevel getWarningLevel()

getOutputFile

public File getOutputFile()

getOutputWrapper

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

getOutputCharset

public Charset getOutputCharset()

getJsContentType

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


getOutputWrapperMarker

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

shouldFingerprintJsFiles

public boolean shouldFingerprintJsFiles()

getTreatWarningsAsErrors

public boolean getTreatWarningsAsErrors()

getDocumentationOutputDirectory

public File getDocumentationOutputDirectory()

getConfigFile

public File getConfigFile()

isOutOfDate

public boolean isOutOfDate()

getGlobalScopeName

public String getGlobalScopeName()

getVariableMapInputFile

public File getVariableMapInputFile()

getVariableMapOutputFile

public File getVariableMapOutputFile()

getPropertyMapInputFile

public File getPropertyMapInputFile()

getPropertyMapOutputFile

public File getPropertyMapOutputFile()

getTestTemplate

public File getTestTemplate()

getTestExcludePaths

public Set<File> getTestExcludePaths()

getTestFile

@Nullable
public File getTestFile(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 CompilerOptions getCompilerOptions(PlovrClosureCompiler compiler)

toString

public String toString()
Overrides:
toString in class Object

compareTo

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

Specified by:
compareTo in interface Comparable<Config>