public final class StableSoyFileSupplier extends Object
CharSource to supply a Reader for
the file content, and also the file path.
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 |
|---|
StableSoyFileSupplier(com.google.common.io.CharSource contentSource,
SoyFileKind soyFileKind,
String filePath)
Creates a new
SoyFileSupplier given a CharSource for the file content, as
well as the desired file path for messages. |
| 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 StableSoyFileSupplier(com.google.common.io.CharSource contentSource,
SoyFileKind soyFileKind,
String filePath)
SoyFileSupplier given a CharSource for the file content, as
well as the desired file path for messages.contentSource - Source for the Soy file content.soyFileKind - The kind of this input Soy file.filePath - The path to the Soy file, used for as a unique map/set key and for messages.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.