net.sf.jagg
Class PropertyScanner

java.lang.Object
  extended by net.sf.jagg.PropertyScanner

public class PropertyScanner
extends java.lang.Object

This class is a scanner that helps to parse a property specification string.

Since:
0.1.0
Author:
Randy Gettman

Nested Class Summary
static class PropertyScanner.Token
          Enumeration for the different types of Tokens.
 
Constructor Summary
PropertyScanner()
          Construct a PropertyScanner object, with empty input.
PropertyScanner(java.lang.String propertyText)
          Construct a PropertyScanner object, with the given input.
 
Method Summary
 java.lang.String getCurrLexeme()
          Returns the current lexeme after a call to getNextToken.
 PropertyScanner.Token getNextToken()
          Returns the Token.
 void reset()
          Resets the scanner to the beginning of the property text string.
 void setPropertyText(java.lang.String propertyText)
          Give the PropertyScanner another property text string to scan.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyScanner

public PropertyScanner()
Construct a PropertyScanner object, with empty input.


PropertyScanner

public PropertyScanner(java.lang.String propertyText)
Construct a PropertyScanner object, with the given input.

Parameters:
propertyText - property tag text to scan.
Method Detail

getNextToken

public PropertyScanner.Token getNextToken()
Returns the Token. After this call completes, the current lexeme is available via a call to getCurrLexeme. Starts looking at the current offset, and once the token is found, then the offset is advanced to the start of the next token.

Returns:
A Token.
See Also:
getCurrLexeme()

getCurrLexeme

public java.lang.String getCurrLexeme()
Returns the current lexeme after a call to getNextToken.

Returns:
The current lexeme, or null if getNextToken hasn't been called yet after a reset.
See Also:
getNextToken(), reset()

reset

public void reset()
Resets the scanner to the beginning of the property text string.


setPropertyText

public void setPropertyText(java.lang.String propertyText)
Give the PropertyScanner another property text string to scan. Resets to the beginning of the string.

Parameters:
propertyText - The property text to scan.


Copyright © 2010-2013 jAgg Team. All Rights Reserved.