org.rythmengine.internal
Interface IContext

All Known Implementing Classes:
TemplateParser

public interface IContext


Nested Class Summary
static class IContext.Break
           
static class IContext.Continue
           
 
Method Summary
 String closeBlock()
          Notify context to close current block and return the block close carets
 boolean compactMode()
           
 IBlockHandler currentBlock()
          Return current block handler
 int currentLine()
          Return current line number
 int cursor()
           
 void enterDirectiveComment()
           
 CodeBuilder getCodeBuilder()
          Return the root source code builder
 IDialect getDialect()
           
 RythmEngine getEngine()
           
 String getRemain()
          Return the remaining template string that has not parsed yet
 org.rythmengine.internal.compiler.TemplateClass getTemplateClass()
           
 String getTemplateSource(int start, int end)
          Return any segment of template source
 boolean hasRemain()
          Do have have remain template content to be parsed
 boolean insideBody()
           
 boolean insideBody2()
           
 boolean insideDirectiveComment()
           
 void leaveDirectiveComment()
           
 void openBlock(IBlockHandler bh)
          Notify context to enter a block
 char peek()
           
 IContext.Break peekBreak()
           
 ICodeType peekCodeType()
           
 Boolean peekCompact()
           
 IContext.Continue peekContinue()
           
 Boolean peekInsideBody()
           
 Boolean peekInsideBody2()
           
 Locale peekLocale()
           
 char pop()
           
 IContext.Break popBreak()
           
 ICodeType popCodeType()
           
 Boolean popCompact()
           
 IContext.Continue popContinue()
           
 Boolean popInsideBody()
           
 Boolean popInsideBody2()
           
 Locale popLocale()
           
 void pushBreak(IContext.Break b)
           
 void pushCodeType(ICodeType type)
           
 void pushCompact(Boolean compact)
           
 void pushContinue(IContext.Continue c)
           
 void pushInsideBody(Boolean b)
           
 void pushInsideBody2(Boolean b)
           
 void pushLocale(Locale locale)
           
 void setDialect(IDialect dialect)
           
 void step(int i)
          Move the current cursor i steps ahead
 

Method Detail

getCodeBuilder

CodeBuilder getCodeBuilder()
Return the root source code builder

Returns:
the code builder

getRemain

String getRemain()
Return the remaining template string that has not parsed yet

Returns:
remaining text to be parsed

hasRemain

boolean hasRemain()
Do have have remain template content to be parsed

Returns:
true if there are remaining text to be parsed

peek

char peek()
Returns:
the first remain character without moving cursor

pop

char pop()
Returns:
the first remain character and move the cursor one step

step

void step(int i)
Move the current cursor i steps ahead

Parameters:
i -

getTemplateSource

String getTemplateSource(int start,
                         int end)
Return any segment of template source

Parameters:
start -
end -
Returns:
template source

openBlock

void openBlock(IBlockHandler bh)
Notify context to enter a block

Parameters:
bh - the block handler

currentBlock

IBlockHandler currentBlock()
Return current block handler

Returns:
current block handler
Throws:
ParseException

closeBlock

String closeBlock()
                  throws ParseException
Notify context to close current block and return the block close carets

Throws:
ParseException

setDialect

void setDialect(IDialect dialect)

getDialect

IDialect getDialect()

currentLine

int currentLine()
Return current line number

Returns:
current parsing line

cursor

int cursor()

getTemplateClass

org.rythmengine.internal.compiler.TemplateClass getTemplateClass()

getEngine

RythmEngine getEngine()

pushBreak

void pushBreak(IContext.Break b)

peekBreak

IContext.Break peekBreak()

popBreak

IContext.Break popBreak()

pushContinue

void pushContinue(IContext.Continue c)

peekContinue

IContext.Continue peekContinue()

popContinue

IContext.Continue popContinue()

compactMode

boolean compactMode()

pushCompact

void pushCompact(Boolean compact)

peekCompact

Boolean peekCompact()

popCompact

Boolean popCompact()

insideBody

boolean insideBody()

peekInsideBody

Boolean peekInsideBody()

pushInsideBody

void pushInsideBody(Boolean b)

popInsideBody

Boolean popInsideBody()

insideBody2

boolean insideBody2()

peekInsideBody2

Boolean peekInsideBody2()

pushInsideBody2

void pushInsideBody2(Boolean b)

popInsideBody2

Boolean popInsideBody2()

insideDirectiveComment

boolean insideDirectiveComment()

enterDirectiveComment

void enterDirectiveComment()

leaveDirectiveComment

void leaveDirectiveComment()

peekCodeType

ICodeType peekCodeType()

pushCodeType

void pushCodeType(ICodeType type)

popCodeType

ICodeType popCodeType()

peekLocale

Locale peekLocale()

pushLocale

void pushLocale(Locale locale)

popLocale

Locale popLocale()


Copyright © 2013. All Rights Reserved.