public class ConfigurationParser
extends java.lang.Object
This class contains methods to parse the contents of a string which specifies components for a TrafficGenerator object. Configuration string format must be as follows:
Each component for the TrafficGenerator must be specified with a clause: mainFlag typeFlag params...;
If the component desired is a complex component which has one or more other base components as parameters, for example a BurstyTimeDistribution, then the specifications for the base components should be included within the parameter list and surrounded by curly brackets. For example, a BurstyTimeDistribution might be specified as follows:
-time_distribution -bursty { -time_distribution -regular 100 } 100 {-time_distribution -random 100 10} { -time_distribution -random 1000 };
Current valid main flags:
Current valid type flags (must be paired with a main flag for which the type actually exists):
For example, "-time_distribution -random 12 34;" would specify a RandomTimeDistribution with the parameters 12, 34.
Individual component specifications must be delimited by semicolons. All other values should be separated by whitespace or newline characters.
| Constructor and Description |
|---|
ConfigurationParser()
Creates a new ConfigurationParser without any set string to parse; a
string should be given to the parser before attempting to call the
parseConfigurationString() method.
|
ConfigurationParser(java.lang.String configString)
Creates a new ConfigurationParser which will parse the specified
configuration string.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ComponentSpecification> |
getSpecifications() |
void |
parseConfigurationString()
Parses the configuration string currently stored in this
ConfigurationParser and stores the results.
|
void |
parseConfigurationString(java.lang.String inConfigurationString)
Sets the configuration string for this parser to the specified string,
and then parses the string.
|
void |
setConfigurationString(java.lang.String newConfigString)
Sets the string this ConfigurationParser will parse to the specified
string.
|
public ConfigurationParser()
public ConfigurationParser(java.lang.String configString)
public void setConfigurationString(java.lang.String newConfigString)
newConfigString - the new string which will be used when
parseConfigurationString() is calledpublic java.util.List<ComponentSpecification> getSpecifications()
public void parseConfigurationString()
java.lang.IllegalArgumentException - if there are any missing or invalid
flags within the file (see configuration string format specifications)public void parseConfigurationString(java.lang.String inConfigurationString)
inConfigurationString - the new string to parsejava.lang.IllegalArgumentException - if there are any missing or invalid
flags within the string (see configuration string format specifications)