Package org.apache.velocity.runtime.parser

Examples of org.apache.velocity.runtime.parser.Token


         * so strict mode doesn't balk at things like #E0E0E0 in a template.
         * compare with ")" is a simple #foo() style macro, comparing to
         * "#end" is a block style macro. We use starts with because the token
         * may end with '\n'
         */
        Token t = node.getLastToken();
        if (t.image.startsWith(")") || t.image.startsWith("#end"))
        {
            strictRef = rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false);
        }
               
View Full Code Here


    private String getLiteral()
    {
        if (literal == null)
        {
            StrBuilder buffer = new StrBuilder();
            Token t = node.getFirstToken();

            while (t != null && t != node.getLastToken())
            {
                buffer.append(t.image);
                t = t.next;
View Full Code Here

     * @see org.apache.velocity.runtime.parser.node.SimpleNode#init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)
     */
    public Object init( InternalContextAdapter context, Object data)
    throws TemplateInitException
    {
        Token t = getFirstToken();

        String text = NodeUtils.tokenLiteral( t );

        ctext = text.toCharArray();

View Full Code Here

     * @see org.apache.velocity.runtime.parser.node.SimpleNode#init(org.apache.velocity.context.InternalContextAdapter, java.lang.Object)
     */
    public Object init( InternalContextAdapter context, Object data)
    throws TemplateInitException
    {
        Token t = getFirstToken();
       
        String text = t.image;
       
        // t.image is in format: #% <string> %#
        // we must strip away the hash tags
View Full Code Here

     * @param data
     * @return The data object.
     */
    public Object init(InternalContextAdapter context, Object data)
    {
        Token t = getFirstToken();

        int loc1 = t.image.indexOf("##");
        int loc2 = t.image.indexOf("#*");

        if (loc1 == -1 && loc2 == -1)
View Full Code Here

        return true;
    }

    private String getRoot()
    {
        Token t = getFirstToken();

        /*
         *  we have a special case where something like
         *  $(\\)*!, where the user want's to see something
         *  like $!blargh in the output, but the ! prevents it from showing.
View Full Code Here

     * within the template and not just relative to the error position within
     * the string literal.
     */
    public void adjTokenLineNums(Node node)
    {
        Token tok = node.getFirstToken();
        // Test against null is probably not neccessary, but just being safe
        while(tok != null && tok != node.getLastToken())
        {
            // If tok is on the first line, then the actual column is
            // offset by the template column.
View Full Code Here

        /*
         *  eat the args
         */
        int i = 0;
        Token t = null;
        Token tLast = null;
   
        while( i <  numArgs )
        {
            args[i] = "";
            /*
 
View Full Code Here

     * @param data
     * @return The data object.
     */
    public Object init(InternalContextAdapter context, Object data)
    {
        Token t = getFirstToken();

        int loc1 = t.image.indexOf("##");
        int loc2 = t.image.indexOf("#*");

        if (loc1 == -1 && loc2 == -1)
View Full Code Here

            expected.append(eol).append("    ");
        }

        StringBuffer retval = new StringBuffer("Encountered \"");
        Token tok = currentToken.next;

        for (int i = 0; i < maxSize; i++)
        {
            if (i != 0)
            {
View Full Code Here

TOP

Related Classes of org.apache.velocity.runtime.parser.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.