org.peaseplate.internal.parser
Class TemplateScanner

java.lang.Object
  extended by org.peaseplate.internal.parser.TemplateScanner

public class TemplateScanner
extends java.lang.Object


Constructor Summary
TemplateScanner(TemplateEngine engine, TemplateLocator locator)
           
 
Method Summary
 Token current()
           
protected  void ensureQueue(int level)
           
 TemplateEngine getEngine()
           
 TemplateLocator getLocator()
           
 char[] getSource()
           
protected  boolean isTrimable()
          Returns true if the current line in the queue is trimable.
 Token next(int level)
           
protected  void nextChar()
           
protected  Token nextToken(int skipInitialTabs)
           
protected  void nextVisibleChar()
           
protected  void trim()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateScanner

public TemplateScanner(TemplateEngine engine,
                       TemplateLocator locator)
                throws TemplateException
Throws:
TemplateException
Method Detail

getEngine

public TemplateEngine getEngine()

getLocator

public TemplateLocator getLocator()

getSource

public char[] getSource()

next

public Token next(int level)
           throws TemplateException
Throws:
TemplateException

current

public Token current()

ensureQueue

protected void ensureQueue(int level)
                    throws TemplateException
Throws:
TemplateException

trim

protected void trim()

isTrimable

protected boolean isTrimable()
Returns true if the current line in the queue is trimable. A line is trimable if does not contain at lease one visible token. If there is a visible token, it is not trimable. An empty line should not be cut, only if it contains at lease one essential chunk.

Returns:
true if trimable

nextToken

protected Token nextToken(int skipInitialTabs)
                   throws TemplateScannerException
Throws:
TemplateScannerException

nextVisibleChar

protected void nextVisibleChar()

nextChar

protected void nextChar()


Copyright © 2008. All Rights Reserved.