org.rythmengine.internal
Class Token

java.lang.Object
  extended by org.rythmengine.utils.TextBuilder
      extended by org.rythmengine.internal.Token
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Token.StringToken

public class Token
extends TextBuilder


Nested Class Summary
static class Token.StringToken
           
 
Nested classes/interfaces inherited from class org.rythmengine.utils.TextBuilder
TextBuilder.StrBuf
 
Field Summary
protected  IContext ctx
           
protected  boolean disableCompactMode
           
protected  boolean dynamicExp
           
static Token EMPTY_TOKEN
           
static Token EMPTY_TOKEN2
           
protected  int line
           
protected static ILogger logger
           
 boolean removeNextLineBreak
           
protected  String s
           
 
Fields inherited from class org.rythmengine.utils.TextBuilder
__buffer, __caller
 
Constructor Summary
  Token(String s, IContext context)
           
  Token(String s, IContext context, boolean disableCompactMode)
           
protected Token(String s, TextBuilder caller)
           
protected Token(String s, TextBuilder caller, boolean disableCompactMode)
           
 
Method Summary
 TextBuilder build()
          Sub class could implement this method to append the generated source code to the buffer
 void compact()
           
protected  String compact(String s)
           
protected  boolean compactMode()
           
protected  void fail()
           
 boolean isOk()
           
protected  void output()
           
protected  void outputExpression()
           
protected  void outputExpression(boolean needsPrint)
           
protected  void outputExpression(List<String> nullValueTester)
           
 Token p2tline(String msg, Object... args)
           
 Token p3tline(String msg, Object... args)
           
 Token p4tline(String msg, Object... args)
           
 Token p5tline(String msg, Object... args)
           
 Token pline()
           
 Token pline(String msg, Object... args)
           
protected  void pp(String s)
           
static String processRythmExpression(String s, IContext ctx)
           
 Token ptline(String msg, Object... args)
           
 boolean removeLeadingLineBreak()
           
static String stripJavaExtension(String s, IContext ctx)
           
 boolean test(String line)
           
 
Methods inherited from class org.rythmengine.utils.TextBuilder
__append, __append, __append, __append, __append, __append, __append, __append, __append, __getBuffer, __setBuffer, buffer, caller, clone, getSelfOut, np, p, p, p, p, p, p, p, p, p, p2t, p2tn, p3t, p3tn, p4t, p4tn, pn, pn, pt, ptn, setSelfOut, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_TOKEN

public static Token EMPTY_TOKEN

EMPTY_TOKEN2

public static Token EMPTY_TOKEN2

logger

protected static final ILogger logger

s

protected String s

ctx

protected IContext ctx

line

protected int line

disableCompactMode

protected boolean disableCompactMode

removeNextLineBreak

public boolean removeNextLineBreak

dynamicExp

protected boolean dynamicExp
Constructor Detail

Token

protected Token(String s,
                TextBuilder caller)

Token

protected Token(String s,
                TextBuilder caller,
                boolean disableCompactMode)

Token

public Token(String s,
             IContext context)

Token

public Token(String s,
             IContext context,
             boolean disableCompactMode)
Method Detail

removeLeadingLineBreak

public boolean removeLeadingLineBreak()

compactMode

protected boolean compactMode()

fail

protected final void fail()

test

public boolean test(String line)

isOk

public boolean isOk()

build

public final TextBuilder build()
Description copied from class: TextBuilder
Sub class could implement this method to append the generated source code to the buffer

Overrides:
build in class TextBuilder
Returns:
this builder

output

protected void output()

outputExpression

protected final void outputExpression(List<String> nullValueTester)

outputExpression

protected final void outputExpression()

outputExpression

protected final void outputExpression(boolean needsPrint)

ptline

public Token ptline(String msg,
                    Object... args)

p2tline

public Token p2tline(String msg,
                     Object... args)

p3tline

public Token p3tline(String msg,
                     Object... args)

p4tline

public Token p4tline(String msg,
                     Object... args)

p5tline

public Token p5tline(String msg,
                     Object... args)

pline

public Token pline(String msg,
                   Object... args)

pline

public Token pline()

pp

protected void pp(String s)

compact

public void compact()

compact

protected String compact(String s)

processRythmExpression

public static String processRythmExpression(String s,
                                            IContext ctx)

stripJavaExtension

public static String stripJavaExtension(String s,
                                        IContext ctx)


Copyright © 2013. All Rights Reserved.