org.makumba.commons
Class ArgumentReplacer

java.lang.Object
  extended by org.makumba.commons.ArgumentReplacer

public class ArgumentReplacer
extends Object

Parses a string and identifies the arguments, to allow operations with them for now, arguments are of the form $javaid[$] but the class can be extended for them to take other forms

Version:
$Id: ArgumentReplacer.java 3090 2008-08-16 12:39:58Z cristian_bogdan $
Author:
Cristian Bogdan

Field Summary
(package private)  Map<String,String> argumentNames
           
(package private)  List<String> argumentOrder
           
(package private)  List<String> text
           
 
Constructor Summary
ArgumentReplacer(String s, boolean acceptColon)
          Makes a list of all arguments and where they are
 
Method Summary
 Iterator<String> getArgumentNames()
          Gets the arguments list
 String replaceValues(Map<String,Object> d)
          Replaces the arguments in a dictionary by their equivalent in numbers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

text

List<String> text

argumentNames

Map<String,String> argumentNames

argumentOrder

List<String> argumentOrder
Constructor Detail

ArgumentReplacer

public ArgumentReplacer(String s,
                        boolean acceptColon)
Makes a list of all arguments and where they are

Parameters:
s - the string containing the arguments
acceptColon -
Method Detail

getArgumentNames

public Iterator<String> getArgumentNames()
Gets the arguments list

Returns:
An Enumeration containing the list of arguments

replaceValues

public String replaceValues(Map<String,Object> d)
Replaces the arguments in a dictionary by their equivalent in numbers

Parameters:
d - the dictionary containing the arguments in their original form
Returns:
A String with the respective values replaced