Package org.mvel2.templates.res
Class CompiledIncludeNode
- java.lang.Object
-
- org.mvel2.templates.res.Node
-
- org.mvel2.templates.res.CompiledIncludeNode
-
- All Implemented Interfaces:
java.io.Serializable
public class CompiledIncludeNode extends Node
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private CompiledTemplatecFileCacheprivate java.io.SerializablecIncludeExpressionprivate ParserContextcontextprivate java.io.SerializablecPreExpressionprivate longfileDateStamp
-
Constructor Summary
Constructors Constructor Description CompiledIncludeNode(int begin, java.lang.String name, char[] template, int start, int end, ParserContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandemarcate(Node terminatingNode, char[] template)java.lang.Objecteval(TemplateRuntime runtime, TemplateOutputStream appender, java.lang.Object ctx, VariableResolverFactory factory)private static java.io.FileInputStreamopenInputStream(java.io.File file)Opens aFileInputStreamfor the specified file, else providing a detail error message than simply callingnew FileInputStream(file).private java.lang.StringreadFile(TemplateRuntime runtime, java.lang.String fileName, java.lang.Object ctx, VariableResolverFactory factory)static java.lang.StringreadInFile(TemplateRuntime runtime, java.io.File file)-
Methods inherited from class org.mvel2.templates.res.Node
calculateContents, getBegin, getCEnd, getContents, getCStart, getEnd, getLength, getName, getNext, getTerminus, isOpenNode, setBegin, setCEnd, setContents, setCStart, setEnd, setName, setNext, setTerminus
-
-
-
-
Field Detail
-
cIncludeExpression
private java.io.Serializable cIncludeExpression
-
cPreExpression
private java.io.Serializable cPreExpression
-
fileDateStamp
private long fileDateStamp
-
cFileCache
private CompiledTemplate cFileCache
-
context
private ParserContext context
-
-
Constructor Detail
-
CompiledIncludeNode
public CompiledIncludeNode(int begin, java.lang.String name, char[] template, int start, int end, ParserContext context)
-
-
Method Detail
-
eval
public java.lang.Object eval(TemplateRuntime runtime, TemplateOutputStream appender, java.lang.Object ctx, VariableResolverFactory factory)
-
readFile
private java.lang.String readFile(TemplateRuntime runtime, java.lang.String fileName, java.lang.Object ctx, VariableResolverFactory factory)
-
demarcate
public boolean demarcate(Node terminatingNode, char[] template)
-
readInFile
public static java.lang.String readInFile(TemplateRuntime runtime, java.io.File file)
-
openInputStream
private static java.io.FileInputStream openInputStream(java.io.File file) throws java.io.IOExceptionOpens aFileInputStreamfor the specified file, else providing a detail error message than simply callingnew FileInputStream(file).An exception is thrown if
- the file parameter is null,
- the file does not exist,
- the file object exists but is a directory,
- the file exists but cannot be read.
- Parameters:
file- the file to open for input, can benull- Returns:
- a new
FileInputStreamfor the specified file - Throws:
java.io.FileNotFoundException- if the file is null or does not existjava.io.IOException- if the file object is a directory or cannot be read
-
-