public final class VolatileSoyFileSupplier extends Object
Important: Do not use outside of Soy code (treat as superpackage-private).
SoyFileSupplier.Factory, SoyFileSupplier.Version| Modifier and Type | Field and Description |
|---|---|
protected String |
filePath
Returns the file path (used for messages only).
|
protected SoyFileKind |
soyFileKind
Whether this input file is only included because it's a dependency.
|
| Constructor and Description |
|---|
VolatileSoyFileSupplier(File file,
SoyFileKind soyFileKind)
Creates a Soy file supplier whose content is backed by the given file which is prone to change
without warning.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Tests equality based on the file path.
|
String |
getFilePath()
Returns the path to the Soy file, used for as a unique map/set key and for messages.
|
SoyFileKind |
getSoyFileKind()
Returns the kind of this input Soy file.
|
SoyFileSupplier.Version |
getVersion()
Returns the version of the Soy file read.
|
boolean |
hasChangedSince(SoyFileSupplier.Version version)
True if the underlying resource has changed since the given version.
|
int |
hashCode()
Hashes based on the file path.
|
Reader |
open()
Returns a
Reader for the Soy file content. |
protected final SoyFileKind soyFileKind
protected final String filePath
public VolatileSoyFileSupplier(File file, SoyFileKind soyFileKind)
file - The underlying file to read.soyFileKind - The kind of this input Soy file.public boolean hasChangedSince(SoyFileSupplier.Version version)
SoyFileSupplierpublic Reader open() throws IOException
SoyFileSupplierReader for the Soy file content.IOException - If there is an error opening the input.public SoyFileSupplier.Version getVersion()
SoyFileSupplierpublic SoyFileKind getSoyFileKind()
SoyFileSuppliergetSoyFileKind in interface SoyFileSupplierpublic String getFilePath()
SoyFileSuppliergetFilePath in interface SoyFileSupplierpublic boolean equals(Object other)
NOTE: This will consider different file supplier implementations and different file kinds as distinct since they behave differently. The caller may want to explicitly check for filename collisions afterwards in case the same file is used with different supplier subclasses or file kinds.