Package jade.core
Class Specifier
- java.lang.Object
-
- jade.core.Specifier
-
public class Specifier extends Object
This class represent a specifier and collects a name, a className, and an array of arguments. Profile specifiers are used to describe several kinds of complex information when configuring JADE (e.g. MTPs to install, agents to start up, kernel services to activate). The general string format for a specifier is
The separated argument list uses a separator character that can be configured when invoking parsing-related utility methods.name:className(separated arglist)- Author:
- LEAP
-
-
Field Summary
Fields Modifier and Type Field Description static StringARG_SEPARATORstatic StringESCAPE_CHARstatic StringNULL_SPECIFIER_LISTstatic charSPECIFIER_SEPARATOR
-
Constructor Summary
Constructors Constructor Description Specifier()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringencodeList(Vector v, char delimiter)static StringencodeSpecifierList(Vector v)This static utility method produces a string representation of a list of Specifier objects.Object[]getArgs()Retrieve the argument list for this specifier.static chargetArgSeparator()StringgetClassName()Retrieve the class name of this specifier.static CharactergetEscapeChar()StringgetName()Retrieve the name for this specifier object.static VectorparseList(String list, char delimiter)static SpecifierparseSpecifier(String specString, char argsDelimiter)Utility method that parses a stringified object specifier in the formstatic VectorparseSpecifierList(String specsLine)This static utility method can parse the string representation of a list of specifiers.voidsetArgs(Object[] a)Set the argument list for this specifier object.voidsetClassName(String cn)Set the name of the class of this specifier.voidsetName(String n)Set the name for this specifier object.StringtoString()This method is used by Boot, ProfileImpl, and RMA in order to have a String representation of this Specifier according to the formatname:className(arg1,arg2,argn)
-
-
-
Field Detail
-
SPECIFIER_SEPARATOR
public static final char SPECIFIER_SEPARATOR
- See Also:
- Constant Field Values
-
ARG_SEPARATOR
public static final String ARG_SEPARATOR
- See Also:
- Constant Field Values
-
ESCAPE_CHAR
public static final String ESCAPE_CHAR
- See Also:
- Constant Field Values
-
NULL_SPECIFIER_LIST
public static final String NULL_SPECIFIER_LIST
- See Also:
- Constant Field Values
-
-
Method Detail
-
setName
public void setName(String n)
Set the name for this specifier object.- Parameters:
n- The name to give to this specifier.
-
getName
public String getName()
Retrieve the name for this specifier object.- Returns:
- The name of the specifier, if one was set, or
nullotherwise.
-
setClassName
public void setClassName(String cn)
Set the name of the class of this specifier.- Parameters:
cn- The class name to assign to the specifier object.
-
getClassName
public String getClassName()
Retrieve the class name of this specifier.- Returns:
- The class name of the specifier, if one was set, or
nullotherwise.
-
setArgs
public void setArgs(Object[] a)
Set the argument list for this specifier object.- Parameters:
a- An object array containing the argument list for this specifier.
-
getArgs
public Object[] getArgs()
Retrieve the argument list for this specifier.- Returns:
- An object array containing the argument list, if one
was set, or
nullotherwise.
-
toString
public String toString()
This method is used by Boot, ProfileImpl, and RMA in order to have a String representation of this Specifier according to the formatname:className(arg1,arg2,argn)
-
getArgSeparator
public static char getArgSeparator()
-
getEscapeChar
public static Character getEscapeChar()
-
parseSpecifierList
public static Vector parseSpecifierList(String specsLine) throws Exception
This static utility method can parse the string representation of a list of specifiers. The general format of a specifier is used, with a comma as argument separator, i.e.:
While comma is the separator character within a specifier arguments, the semicolon is used to separate the different specifiers in the list.name:className(comma-separated arglist)- Parameters:
specsLine- The string containing the representation of the specifier list, according to the format above.- Returns:
- A vector containing the parsed specifiers.
- Throws:
Exception
-
encodeSpecifierList
public static String encodeSpecifierList(Vector v)
This static utility method produces a string representation of a list of Specifier objects.
-
parseSpecifier
public static Specifier parseSpecifier(String specString, char argsDelimiter) throws Exception
Utility method that parses a stringified object specifier in the form
a Specifier object. Both the name and the list of arguments are optional.name:className(separated arglist)- Parameters:
specString- A string containing the representation of the specifier, according to the format above.argsDelimiter- The character to use as a delimiter within the argument list.- Returns:
- A specifier object, built according to the parsed information.
- Throws:
Exception
-
-