org.sonar.colorizer
Class CodeReader

java.lang.Object
  extended by org.sonar.colorizer.CodeReader

public class CodeReader
extends Object


Constructor Summary
CodeReader(Reader reader)
           
CodeReader(String code)
           
 
Method Summary
 void close()
           
 Object getVariable(Object key)
          Get a stateful variable.
 Object getVariable(Object key, Object defaultValue)
          Get a stateful variable.
 Map getVariables()
          All stateful variables
 int lastChar()
           
 int lastChar(int index)
           
 void mark(int readAheadLimit)
           
 int peek()
           
 char[] peek(int index)
           
 String peekTo(EndTokenMatcher matcher)
           
protected  String peekTo(EndTokenMatcher matcher, int lookAheadLimit)
           
 int pop()
           
 String popTo(EndTokenMatcher matcher)
           
 void setVariable(Object key, Object value)
          Save a stateful variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeReader

public CodeReader(Reader reader)

CodeReader

public CodeReader(String code)
Method Detail

mark

public final void mark(int readAheadLimit)
                throws IOException
Throws:
IOException

lastChar

public final int lastChar()

peek

public final int peek()

pop

public final int pop()

popTo

public String popTo(EndTokenMatcher matcher)

peekTo

public String peekTo(EndTokenMatcher matcher)

peekTo

protected String peekTo(EndTokenMatcher matcher,
                        int lookAheadLimit)

close

public void close()

peek

public char[] peek(int index)

lastChar

public int lastChar(int index)

setVariable

public void setVariable(Object key,
                        Object value)
Save a stateful variable.

Parameters:
key - can NOT be null
value - can be null

getVariable

public Object getVariable(Object key)
Get a stateful variable. Return null if not found.


getVariable

public Object getVariable(Object key,
                          Object defaultValue)
Get a stateful variable. Return the default value if not found.


getVariables

public Map getVariables()
All stateful variables



Copyright © 2009 SonarSource SA. All Rights Reserved.