Class NodeUtils


  • public class NodeUtils
    extends java.lang.Object
    Utilities for dealing with the AST node structure.
    Version:
    $Id: NodeUtils.java 687386 2008-08-20 16:57:07Z nbubna $
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static org.apache.commons.lang3.text.StrBuilder getSpecialText​(Token t)
      Collect all the s that are carried along with a token.
      static java.lang.String interpolate​(java.lang.String argStr, Context vars)
      Deprecated.
      this method isn't called by any class
      static java.lang.String specialText​(Token t)
      Deprecated.
      use getSpecialText(Token t)
      static java.lang.String tokenLiteral​(Token t)
      complete node literal
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NodeUtils

        public NodeUtils()
    • Method Detail

      • specialText

        public static java.lang.String specialText​(Token t)
        Deprecated.
        use getSpecialText(Token t)
      • getSpecialText

        public static org.apache.commons.lang3.text.StrBuilder getSpecialText​(Token t)
        Collect all the s that are carried along with a token. Special tokens do not participate in parsing but can still trigger certain lexical actions. In some cases you may want to retrieve these special tokens, this is simply a way to extract them.
        Parameters:
        t - the Token
        Returns:
        StrBuilder with the special tokens.
      • tokenLiteral

        public static java.lang.String tokenLiteral​(Token t)
        complete node literal
        Parameters:
        t -
        Returns:
        A node literal.
      • interpolate

        public static java.lang.String interpolate​(java.lang.String argStr,
                                                   Context vars)
                                            throws MethodInvocationException
        Deprecated.
        this method isn't called by any class
        Utility method to interpolate context variables into string literals. So that the following will work: #set $name = "candy" $image.getURI("${name}.jpg") And the string literal argument will be transformed into "candy.jpg" before the method is executed.
        Parameters:
        argStr -
        vars -
        Returns:
        Interpoliation result.
        Throws:
        MethodInvocationException