org.kefirsf.bb.proc
Class ProcText

java.lang.Object
  extended by org.kefirsf.bb.proc.ProcNamedElement
      extended by org.kefirsf.bb.proc.ProcText
All Implemented Interfaces:
ProcPatternElement

public class ProcText
extends ProcNamedElement
implements ProcPatternElement

Класс текста, который подлежит парсингу

Author:
Kefir

Constructor Summary
ProcText(String name, boolean transparent)
          Создает именованный элемент
ProcText(String name, ProcScope scope, boolean transparent)
           
 
Method Summary
 int findIn(Source source)
          Find this element
 boolean isNextIn(Source source)
          Определяет, что дальше в разбираемой строке находится нужная последовательность
 boolean parse(Context context, ProcPatternElement terminator)
          Парсит элемент
 String toString()
           
 
Methods inherited from class org.kefirsf.bb.proc.ProcNamedElement
getName, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcText

public ProcText(String name,
                boolean transparent)
Создает именованный элемент

Parameters:
name - имя переменной
transparent - mark that scope variable must be accessible from parent context

ProcText

public ProcText(String name,
                ProcScope scope,
                boolean transparent)
Method Detail

parse

public boolean parse(Context context,
                     ProcPatternElement terminator)
              throws org.kefirsf.bb.proc.NestingException
Парсит элемент

Specified by:
parse in interface ProcPatternElement
Parameters:
context - контекст
terminator - teminator to stop text process
Returns:
true - если удалось распарсить константу false - если не удалось
Throws:
NestingException - if nesting is too big.

isNextIn

public boolean isNextIn(Source source)
Определяет, что дальше в разбираемой строке находится нужная последовательность

Specified by:
isNextIn in interface ProcPatternElement
Parameters:
source - source text
Returns:
true если следующие символы в строке совпадают с pattern false если не совпадают или строка кончилась

findIn

public int findIn(Source source)
Find this element

Specified by:
findIn in interface ProcPatternElement
Parameters:
source - text source
Returns:
start offset

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.