org.plovr
Class AbstractJsInput
java.lang.Object
org.plovr.AbstractJsInput
- All Implemented Interfaces:
- SourceFile.Generator, JsInput
- Direct Known Subclasses:
- LocalFileJsInput, ResourceJsInput
public abstract class AbstractJsInput
- extends Object
- implements JsInput
AbstractJsInput
provides the default logic for extracting
goog.provide()
and goog.require()
information.
- Author:
- bolinfest@gmail.com (Michael Bolin)
provides
protected List<String> provides
requires
protected List<String> requires
getCode
public abstract String getCode()
- Specified by:
getCode
in interface SourceFile.Generator
- Specified by:
getCode
in interface JsInput
- Returns:
- JavaScript code
getName
public String getName()
- Specified by:
getName
in interface JsInput
- Returns:
- name of a
JsInput
must be unique among the other inputs
included in a compilation so that warnings and errors can be reported
appropriately.
getProvides
public List<String> getProvides()
- Specified by:
getProvides
in interface JsInput
- Returns:
- a list of the values passed to goog.provide() in this input
getRequires
public List<String> getRequires()
- Specified by:
getRequires
in interface JsInput
- Returns:
- a list of the values passed to goog.require() in this input
hasInputChanged
protected boolean hasInputChanged()
isSoyFile
public boolean isSoyFile()
- Specified by:
isSoyFile
in interface JsInput
- Returns:
- a boolean indicating whether this is a Soy file. If true, then
JsInput.getTemplateCode()
must return the original Soy content.
getTemplateCode
public String getTemplateCode()
- Specified by:
getTemplateCode
in interface JsInput
- Returns:
- the underlying template code if this is a Soy file
processProvidesAndRequires
protected void processProvidesAndRequires()
toString
public String toString()
- Overrides:
toString
in class Object