com.google.template.soy.base
Class VolatileSoyFileSupplier

java.lang.Object
  extended by com.google.template.soy.base.VolatileSoyFileSupplier
All Implemented Interfaces:
SoyFileSupplier

public class VolatileSoyFileSupplier
extends Object

Record for one input Soy file whose content should be considered prone to change without warning.

Important: Do not use outside of Soy code (treat as superpackage-private).


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.google.template.soy.base.SoyFileSupplier
SoyFileSupplier.Factory, SoyFileSupplier.Version
 
Field Summary
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 Summary
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.
 
Method Summary
 String getFilePath()
          Returns the file path (used for messages only).
 SoyFileKind getSoyFileKind()
          Returns the kind of this input Soy file.
 boolean hasChangedSince(SoyFileSupplier.Version version)
          True if the underlying resource has changed since the given version.
 Pair<Reader,SoyFileSupplier.Version> open()
          Returns a Reader for the Soy file content and the version of the file read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

soyFileKind

protected final SoyFileKind soyFileKind
Whether this input file is only included because it's a dependency.


filePath

protected final String filePath
Returns the file path (used for messages only).

Constructor Detail

VolatileSoyFileSupplier

public 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.

Parameters:
file - The underlying file to read.
soyFileKind - The kind of this input Soy file.
Method Detail

hasChangedSince

public boolean hasChangedSince(SoyFileSupplier.Version version)
Description copied from interface: SoyFileSupplier
True if the underlying resource has changed since the given version.


open

public Pair<Reader,SoyFileSupplier.Version> open()
                                          throws IOException
Description copied from interface: SoyFileSupplier
Returns a Reader for the Soy file content and the version of the file read.

Throws:
IOException - If there is an error opening the input.

getSoyFileKind

public SoyFileKind getSoyFileKind()
Description copied from interface: SoyFileSupplier
Returns the kind of this input Soy file.

Specified by:
getSoyFileKind in interface SoyFileSupplier

getFilePath

public String getFilePath()
Description copied from interface: SoyFileSupplier
Returns the file path (used for messages only).

Specified by:
getFilePath in interface SoyFileSupplier