Class Literal

  • All Implemented Interfaces:
    java.lang.Cloneable, DirectiveConstants

    public class Literal
    extends Directive
    Deprecated.
    Use the #[[unparsed content]]# syntax instead.
    A very simple directive that leverages the Node.literal() to grab the literal rendition of a node. We basically grab the literal value on init(), then repeatedly use that during render(). This is deprecated and will be removed in Velocity 2.0; please use #[[unparsed content]]# instead.
    Version:
    $Id: Literal.java 746438 2009-02-21 05:41:24Z nbubna $
    • Field Detail

      • literalText

        java.lang.String literalText
        Deprecated.
    • Constructor Detail

      • Literal

        public Literal()
        Deprecated.
    • Method Detail

      • getName

        public java.lang.String getName()
        Deprecated.
        Return name of this directive.
        Specified by:
        getName in class Directive
        Returns:
        The name of this directive.
      • getType

        public int getType()
        Deprecated.
        Return type of this directive.
        Specified by:
        getType in class Directive
        Returns:
        The type of this directive.
      • isScopeProvided

        public boolean isScopeProvided()
        Deprecated.
        Since there is no processing of content, there is never a need for an internal scope.
        Overrides:
        isScopeProvided in class Directive
        Returns:
        true if there will be a scope control injected into the context when rendering this directive.
      • render

        public boolean render​(InternalContextAdapter context,
                              java.io.Writer writer,
                              Node node)
                       throws java.io.IOException
        Deprecated.
        Throw the literal rendition of the block between #literal()/#end into the writer.
        Specified by:
        render in class Directive
        Parameters:
        context -
        writer -
        node -
        Returns:
        True if the directive rendered successfully.
        Throws:
        java.io.IOException