The following example shows how the Configuration class can be used
to list available configurations and how to pass a configuration object to a
Recording.
public static void main(String... args) throws Exception { if (args.length == 0) { System.out.println("Configurations:"); for (Configuration c : Configuration.getConfigurations()) { System.out.println("Name: " + c.getName()); System.out.println("Label: " + c.getLabel()); System.out.println("Description: " + c.getDescription()); System.out.println("Provider: " + c.getProvider()); System.out.println(); } } else { String name = args[0]; Configuration c = Configuration.getConfiguration(name); try (Recording r = new Recording(c)) { System.out.println("Starting recording with settings:"); for (Map.Entry<String, String> setting : c.getSettings().entrySet()) { System.out.println(setting.getKey() + " = " + setting.getValue()); } r.start(); } } }
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final String | |
| private final String | |
| private final String | |
| private final String | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static Configuration | |
| public static Configuration | |
| public static Configuration | Returns: a configuration, notnullthe name of the configuration (for example, name)"default" or
"profile")Returns a predefined configuration. |
| public static List | Returns: the list of predefined configurations, notnullReturns an immutable list of predefined configurations for this Java Virtual Machine (JVM). |
| public String | Returns: contents, ornull if it doesn't existReturns a textual representation of the configuration (for example, the contents of a JFC file). |
| public String | Returns: the description, ornull if it doesn't existReturns a short sentence that describes the configuration (for example
|
| public String | Returns: the label, ornull if it doesn't existReturns a human-readable name (for example, |
| public String | Returns: the name, ornull if it doesn't existReturns an identifying name (for example, |
| public String | Returns: the provider, ornull if it doesn't existReturns who created the configuration (for example |
| public Map | Returns: settings, notnullReturns the settings that specify how a recording is configured. |
| contents | back to summary |
|---|---|
| private final String contents | |
| description | back to summary |
|---|---|
| private final String description | |
| label | back to summary |
|---|---|
| private final String label | |
| name | back to summary |
|---|---|
| private final String name | |
| provider | back to summary |
|---|---|
| private final String provider | |
| settings | back to summary |
|---|---|
| private final Map<String, String> settings | |
| Configuration | back to summary |
|---|---|
| pack-priv Configuration(String name, String label, String description, String provider, Map<String, String> settings, String contents) | |
| create | back to summary |
|---|---|
| public static Configuration create(Path path) throws IOException, ParseException Reads a configuration from a file.
| |
| create | back to summary |
|---|---|
| public static Configuration create(Reader reader) throws IOException, ParseException Reads a configuration from a character stream.
| |
| getConfiguration | back to summary |
|---|---|
| public static Configuration getConfiguration(String name) throws IOException, ParseException Returns a predefined configuration.
See
| |
| getConfigurations | back to summary |
|---|---|
| public static List Returns an immutable list of predefined configurations for this Java Virtual Machine (JVM).
| |
| getContents | back to summary |
|---|---|
| public String getContents() Returns a textual representation of the configuration (for example, the contents of a JFC file).
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() Returns a short sentence that describes the configuration (for example
| |
| getLabel | back to summary |
|---|---|
| public String getLabel() Returns a human-readable name (for example,
| |
| getName | back to summary |
|---|---|
| public String getName() Returns an identifying name (for example,
| |
| getProvider | back to summary |
|---|---|
| public String getProvider() Returns who created the configuration (for example
| |
| getSettings | back to summary |
|---|---|
| public Map Returns the settings that specify how a recording is configured.
Modifying the returned | |