Class StreamedVar

java.lang.Object
org.apache.juneau.svl.Var
org.apache.juneau.svl.StreamedVar
Direct Known Subclasses:
SerializedRequestAttrVar

public abstract class StreamedVar extends Var
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 Details

    • StreamedVar

      public StreamedVar(String name)
      Constructor.
      Parameters:
      name - The variable name (e.g. "C" for variables of the form "$C{...}")
  • Method Details

    • resolve

      public String resolve(VarResolverSession session, String arg) throws Exception
      Description copied from class: Var
      The interface that needs to be implemented for subclasses of SimpleVar.
      Specified by:
      resolve in class Var
      Parameters:
      session - The session object used for a single instance of a var resolution.
      arg - The inside argument of the variable.
      Returns:
      The resolved value.
      Throws:
      Exception - Any exception can be thrown.