org.rythmengine.internal
Class TemplateParser
java.lang.Object
org.rythmengine.internal.TemplateParser
- All Implemented Interfaces:
- IContext
public class TemplateParser
- extends Object
- implements IContext
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TemplateParser
public TemplateParser(CodeBuilder cb)
getTemplateClass
public TemplateClass getTemplateClass()
- Specified by:
getTemplateClass in interface IContext
getCodeBuilder
public CodeBuilder getCodeBuilder()
- Description copied from interface:
IContext
- Return the root source code builder
- Specified by:
getCodeBuilder in interface IContext
- Returns:
- the code builder
getDialect
public IDialect getDialect()
- Specified by:
getDialect in interface IContext
setDialect
public void setDialect(IDialect dialect)
- Specified by:
setDialect in interface IContext
getRemain
public String getRemain()
- Description copied from interface:
IContext
- Return the remaining template string that has not parsed yet
- Specified by:
getRemain in interface IContext
- Returns:
- remaining text to be parsed
cursor
public int cursor()
- Specified by:
cursor in interface IContext
hasRemain
public boolean hasRemain()
- Description copied from interface:
IContext
- Do have have remain template content to be parsed
- Specified by:
hasRemain in interface IContext
- Returns:
- true if there are remaining text to be parsed
peek
public char peek()
- Specified by:
peek in interface IContext
- Returns:
- the first remain character without moving cursor
pop
public char pop()
- Specified by:
pop in interface IContext
- Returns:
- the first remain character and move the cursor one step
step
public void step(int i)
- Description copied from interface:
IContext
- Move the current cursor i steps ahead
- Specified by:
step in interface IContext
getTemplateSource
public String getTemplateSource(int start,
int end)
- Description copied from interface:
IContext
- Return any segment of template source
- Specified by:
getTemplateSource in interface IContext
- Returns:
- template source
openBlock
public void openBlock(IBlockHandler bh)
- Description copied from interface:
IContext
- Notify context to enter a block
- Specified by:
openBlock in interface IContext
- Parameters:
bh - the block handler
currentBlock
public IBlockHandler currentBlock()
- Description copied from interface:
IContext
- Return current block handler
- Specified by:
currentBlock in interface IContext
- Returns:
- current block handler
closeBlock
public String closeBlock()
throws ParseException
- Description copied from interface:
IContext
- Notify context to close current block and return
the block close carets
- Specified by:
closeBlock in interface IContext
- Throws:
ParseException
currentLine
public int currentLine()
- Description copied from interface:
IContext
- Return current line number
- Specified by:
currentLine in interface IContext
- Returns:
- current parsing line
getEngine
public RythmEngine getEngine()
- Specified by:
getEngine in interface IContext
compactMode
public boolean compactMode()
- Specified by:
compactMode in interface IContext
pushCompact
public void pushCompact(Boolean compact)
- Specified by:
pushCompact in interface IContext
peekCompact
public Boolean peekCompact()
- Specified by:
peekCompact in interface IContext
popCompact
public Boolean popCompact()
- Specified by:
popCompact in interface IContext
pushBreak
public void pushBreak(IContext.Break b)
- Specified by:
pushBreak in interface IContext
peekBreak
public IContext.Break peekBreak()
- Specified by:
peekBreak in interface IContext
popBreak
public IContext.Break popBreak()
- Specified by:
popBreak in interface IContext
pushContinue
public void pushContinue(IContext.Continue b)
- Specified by:
pushContinue in interface IContext
peekContinue
public IContext.Continue peekContinue()
- Specified by:
peekContinue in interface IContext
popContinue
public IContext.Continue popContinue()
- Specified by:
popContinue in interface IContext
insideBody
public boolean insideBody()
- Specified by:
insideBody in interface IContext
pushInsideBody
public void pushInsideBody(Boolean b)
- Specified by:
pushInsideBody in interface IContext
peekInsideBody
public Boolean peekInsideBody()
- Specified by:
peekInsideBody in interface IContext
popInsideBody
public Boolean popInsideBody()
- Specified by:
popInsideBody in interface IContext
insideBody2
public boolean insideBody2()
- Specified by:
insideBody2 in interface IContext
pushInsideBody2
public void pushInsideBody2(Boolean b)
- Specified by:
pushInsideBody2 in interface IContext
peekInsideBody2
public Boolean peekInsideBody2()
- Specified by:
peekInsideBody2 in interface IContext
popInsideBody2
public Boolean popInsideBody2()
- Specified by:
popInsideBody2 in interface IContext
insideDirectiveComment
public boolean insideDirectiveComment()
- Specified by:
insideDirectiveComment in interface IContext
enterDirectiveComment
public void enterDirectiveComment()
- Specified by:
enterDirectiveComment in interface IContext
leaveDirectiveComment
public void leaveDirectiveComment()
- Specified by:
leaveDirectiveComment in interface IContext
peekCodeType
public ICodeType peekCodeType()
- Specified by:
peekCodeType in interface IContext
pushCodeType
public void pushCodeType(ICodeType type)
- Specified by:
pushCodeType in interface IContext
popCodeType
public ICodeType popCodeType()
- Specified by:
popCodeType in interface IContext
peekLocale
public Locale peekLocale()
- Specified by:
peekLocale in interface IContext
pushLocale
public void pushLocale(Locale locale)
- Specified by:
pushLocale in interface IContext
popLocale
public Locale popLocale()
- Specified by:
popLocale in interface IContext
shutdown
public void shutdown()
Copyright © 2014. All Rights Reserved.