Top Description Fields Constructors Methods
com.sun.javafx.application

public Class ParametersImpl

extends Parameters
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .Collections, .HashMap, .List, .Map, javafx.application.Application, .Application.Parameters

Implementation class for Application parameters. This is called by the application launcher to create the startup parameters for the given class.

Field Summary

Modifier and TypeField and Description
private Map<String, String>
private static Map<Application, Application.Parameters>
private List<String>
private Map<String, String>
private List<String>
private List<String>
private List<String>

Constructor Summary

AccessConstructor and Description
public
ParametersImpl()

Constructs an empty Parameters object.

public
ParametersImpl(List<String>
list of command line arguments
args
)

Constructs an Parameters object from the specified list of arguments.

public
ParametersImpl(String[]
array of command line arguments
args
)

Constructs an Parameters object from the specified array of unnamed parameters.

public
ParametersImpl(Map<K, V>
a map of parameters from which to initialize this object.
params
,
String[] arguments)

Constructs an Parameters object from the specified map of named parameters.

Method Summary

Modifier and TypeMethod and Description
private void
computeNamedParams()

This method parses the current array of raw arguments looking for name,value pairs.

private void
computeRawArgs()

This method creates string representations of the name,value pairs in the map for this Parameters object, and appends those strings to the raw arguments array.

private void
computeUnnamedParams()

This method computes the list of unnamed parameters, by filtering the list of raw arguments, stripping out the named parameters.

public Map<String, String>
getNamed()

Implements abstract javafx.application.Application.Parameters.getNamed.

Retrieves a read-only map of the named parameters.

public static Application.Parameters
public List<String>
getRaw()

Implements abstract javafx.application.Application.Parameters.getRaw.

Retrieves a read-only list of the raw arguments.

public List<String>
getUnnamed()

Implements abstract javafx.application.Application.Parameters.getUnnamed.

Retrieves a read-only list of the unnamed parameters.

private void
init(List<String>
list of command line arguments
args
)

Initialize this Parameters object from the set of command line arguments.

private void
init(Map<K, V>
a map of parameters from which to initialize this object.
params
,
String[] arguments)

Constructs an Parameters object from the specified map of named parameters.

private boolean

Returns:

true if the string matches the pattern for a named parameter.
isNamedParam
(String
the string to check
arg
)

Returns true if the specified string is a named parameter of the form: --name=value

public static void
private boolean

Returns:

whether or not it is valid
validFirstChar
(char
the first char of a key string
c
)

Validate the first character of a key.

private boolean

Returns:

true if key is a valid key, otherwise false
validKey
(Object
Object representing a potential key
key
)

Validate the key.

Field Detail

namedParamsback to summary
private Map<String, String> namedParams
paramsback to summary
private static Map<Application, Application.Parameters> params
rawArgsback to summary
private List<String> rawArgs
readonlyNamedParamsback to summary
private Map<String, String> readonlyNamedParams
readonlyRawArgsback to summary
private List<String> readonlyRawArgs
readonlyUnnamedParamsback to summary
private List<String> readonlyUnnamedParams
unnamedParamsback to summary
private List<String> unnamedParams

Constructor Detail

ParametersImplback to summary
public ParametersImpl()

Constructs an empty Parameters object.

ParametersImplback to summary
public ParametersImpl(List<String> args)

Constructs an Parameters object from the specified list of arguments. The list may be null.

Parameters
args:List<String>

list of command line arguments

ParametersImplback to summary
public ParametersImpl(String[] args)

Constructs an Parameters object from the specified array of unnamed parameters. The array may be null.

Parameters
args:String[]

array of command line arguments

ParametersImplback to summary
public ParametersImpl(Map<K, V> params, String[] arguments)

Constructs an Parameters object from the specified map of named parameters.

Parameters
params:Map<K, V>

a map of parameters from which to initialize this object.

Method Detail

computeNamedParamsback to summary
private void computeNamedParams()

This method parses the current array of raw arguments looking for name,value pairs. These name,value pairs are then added to the map for this parameters object, and are of the form: --name=value.

computeRawArgsback to summary
private void computeRawArgs()

This method creates string representations of the name,value pairs in the map for this Parameters object, and appends those strings to the raw arguments array. The newly added strings are of the form: "--name=value".

computeUnnamedParamsback to summary
private void computeUnnamedParams()

This method computes the list of unnamed parameters, by filtering the list of raw arguments, stripping out the named parameters.

getNamedback to summary
public Map<String, String> getNamed()

Implements abstract javafx.application.Application.Parameters.getNamed.

Doc from javafx.application.Application.Parameters.getNamed.

Retrieves a read-only map of the named parameters. It may be empty, but is never null. Named parameters include any command line arguments of the form: "--name=value".

Returns:Map<String, String>

a read-only map of named parameters.

Annotations
@Override
getParametersback to summary
public static Application.Parameters getParameters(Application app)
getRawback to summary
public List<String> getRaw()

Implements abstract javafx.application.Application.Parameters.getRaw.

Doc from javafx.application.Application.Parameters.getRaw.

Retrieves a read-only list of the raw arguments. This list may be empty, but is never null. In the case of a standalone application, it is the ordered list of arguments specified on the command line. For named parameters, each <name,value> pair is represented as a single argument of the form: "--name=value".

Returns:List<String>

a read-only list of raw application arguments

Annotations
@Override
getUnnamedback to summary
public List<String> getUnnamed()

Implements abstract javafx.application.Application.Parameters.getUnnamed.

Doc from javafx.application.Application.Parameters.getUnnamed.

Retrieves a read-only list of the unnamed parameters. This list may be empty, but is never null. The named parameters, that is the parameters that are represented as <name,value> pairs, are filtered out.

Returns:List<String>

a read-only list of unnamed parameters.

Annotations
@Override
initback to summary
private void init(List<String> args)

Initialize this Parameters object from the set of command line arguments. Null elements are elided.

Parameters
args:List<String>

list of command line arguments

initback to summary
private void init(Map<K, V> params, String[] arguments)

Constructs an Parameters object from the specified map of named parameters.

Parameters
params:Map<K, V>

a map of parameters from which to initialize this object.

isNamedParamback to summary
private boolean isNamedParam(String arg)

Returns true if the specified string is a named parameter of the form: --name=value

Parameters
arg:String

the string to check

Returns:boolean

true if the string matches the pattern for a named parameter.

registerParametersback to summary
public static void registerParameters(Application app, Application.Parameters p)
validFirstCharback to summary
private boolean validFirstChar(char c)

Validate the first character of a key. It is valid if it is a letter or an "_" character.

Parameters
c:char

the first char of a key string

Returns:boolean

whether or not it is valid

validKeyback to summary
private boolean validKey(Object key)

Validate the key. A key is valid if it is a String object that starts with a letter or "_" character and does not contain an "=" character.

Parameters
key:Object

Object representing a potential key

Returns:boolean

true if key is a valid key, otherwise false