org.plovr
Class AbstractJsInput

java.lang.Object
  extended by 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)

Field Summary
protected  List<String> provides
           
protected  List<String> requires
           
 
Method Summary
abstract  String getCode()
           
 String getName()
           
 List<String> getProvides()
           
 List<String> getRequires()
           
 String getTemplateCode()
           
protected  boolean hasInputChanged()
           
 boolean isSoyFile()
           
protected  void processProvidesAndRequires()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

provides

protected List<String> provides

requires

protected List<String> requires
Method Detail

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