org.plovr
Class ResourceJsInput
java.lang.Object
org.plovr.AbstractJsInput
org.plovr.ResourceJsInput
- All Implemented Interfaces:
- SourceFile.Generator, JsInput
public class ResourceJsInput
- extends AbstractJsInput
ResourceJsInput
represents a JavaScript file loaded from a JAR, so
it will never change, so its dependencies must only be read once.
- Author:
- bolinfest@gmail.com (Michael Bolin)
getCodeWithEtag
public JsInput.CodeWithEtag getCodeWithEtag()
- Description copied from interface:
JsInput
- If
JsInput.supportsEtags()
returns true
, then this returns the
value returned by JsInput.getCode()
along with an ETag; otherwise, it
throws an UnsupportedOperationException
.
This is generally used as a performance optimization to prevent plovr from
going to disk twice: once to read the code for JsInput.getCode()
and then
again to read the code and calculate its ETag. This ensures that the code
and ETag are produced atomically.
- Specified by:
getCodeWithEtag
in interface JsInput
- Overrides:
getCodeWithEtag
in class AbstractJsInput
getCode
public String getCode()
- Specified by:
getCode
in interface SourceFile.Generator
- Specified by:
getCode
in interface JsInput
- Specified by:
getCode
in class AbstractJsInput
- Returns:
- JavaScript code
supportsEtags
public boolean supportsEtags()
- Description copied from interface:
JsInput
- Whether this input can calculate a stable ETag value for itself.
- Specified by:
supportsEtags
in interface JsInput
- Overrides:
supportsEtags
in class AbstractJsInput
- See Also:
JsInput.getCodeWithEtag()