Package org.apache.juneau.commons.svl
Class StreamedVar
java.lang.Object
org.apache.juneau.commons.svl.Var
org.apache.juneau.commons.svl.StreamedVar
- Direct Known Subclasses:
SerializedRequestAttrVar
Abstract superclass of all Simple Var Language variables that write their values directly to a writer.
Note the difference between this class and SimpleVar that returns simple string values.
Unlike the SimpleVar class, the output from this class cannot contain nested variables.
However, this class can be more efficient for variables that produce large amounts of output so that the creation
of large in-memory strings is avoided.
Subclasses must implement the following method:
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolve(VarResolverSession session, String arg) The interface that needs to be implemented for subclasses ofSimpleVar.protected ObjectresolveValue(VarResolverSession session, String arg) Resolves this var to a typed value for use inside#{...} expressions.Methods inherited from class org.apache.juneau.commons.svl.Var
allowNested, allowRecurse, canResolve, doResolve, getName, isStable, resolveTo
-
Constructor Details
-
StreamedVar
Constructor.- Parameters:
name- The variable name (e.g."C" for variables of the form"${C:...}" ). Must not benull .
-
-
Method Details
-
resolveValue
Description copied from class:VarResolves this var to a typed value for use inside#{...} expressions.The default delegates to
Var.resolve(VarResolverSession, String)(or, for a streamed var, buffersVar.resolveTo(VarResolverSession, java.io.Writer, String)). Anull return means "absent", which is what the:default and?: operators test for.- Overrides:
resolveValuein classVar- Parameters:
session- The session.arg- The var body.- Returns:
- The value, or
null if absent. - Throws:
Exception- Var-specific failure.
-
resolve
Description copied from class:VarThe interface that needs to be implemented for subclasses ofSimpleVar.
-