org.peaseplate.internal.parser
Class Token
java.lang.Object
org.peaseplate.internal.parser.Token
public class Token
- extends java.lang.Object
Constructor Summary |
Token(TokenType type,
Designator designator,
char[] source,
int offset,
int length,
int line,
int column)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Token
public Token(TokenType type,
Designator designator,
char[] source,
int offset,
int length,
int line,
int column)
getType
public TokenType getType()
getDesignator
public Designator getDesignator()
getSource
public char[] getSource()
getOffset
public int getOffset()
getLength
public int getLength()
getLine
public int getLine()
getColumn
public int getColumn()
isSeparator
public boolean isSeparator()
isVisible
public boolean isVisible()
- Returns true if the token is visible.
A content token is not visible if it just contains whitespaces.
Any other token checks the designator if it is visible.
- Returns:
- true if visible
isEssential
public boolean isEssential()
- Returns true if the token is essential for rendering.
A code token is always essential.
A comment token is not essential.
A content token is not essential if it just contains whitespaces.
A line separator token is not essential.
A end of source token is essential
- Returns:
- true if essential
isBlockHead
public boolean isBlockHead()
isBlockTail
public boolean isBlockTail()
isBlockExpansion
public boolean isBlockExpansion()
isExpandableBlock
public boolean isExpandableBlock()
compile
public Chunk compile(TemplateEngine engine,
CompileContext context)
throws TemplateException
- Throws:
TemplateException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- See Also:
Object.toString()
Copyright © 2008. All Rights Reserved.