jade.core
Class Specifier

java.lang.Object
  |
  +--jade.core.Specifier

public class Specifier
extends java.lang.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

name:className(separated arglist)

The separated argument list uses a separator character that can be configured when invoking parsing-related utility methods.

Author:
LEAP

Field Summary
static java.lang.String NULL_SPECIFIER_LIST
           
static char SPECIFIER_SEPARATOR
           
 
Constructor Summary
Specifier()
           
 
Method Summary
static java.lang.String encodeSpecifierList(java.util.Vector v)
          This static utility method produces a string representation of a list of Specifier objects.
 java.lang.Object[] getArgs()
          Retrieve the argument list for this specifier.
 java.lang.String getClassName()
          Retrieve the class name of this specifier.
 java.lang.String getName()
          Retrieve the name for this specifier object.
static java.util.Vector parseList(java.lang.String list, char delimiter)
           
static Specifier parseSpecifier(java.lang.String specString, char argsDelimiter)
          Utility method that parses a stringified object specifier in the form name:className(separated arglist) a Specifier object.
static java.util.Vector parseSpecifierList(java.lang.String specsLine)
          This static utility method can parse the string representation of a list of specifiers.
 void setArgs(java.lang.Object[] a)
          Set the argument list for this specifier object.
 void setClassName(java.lang.String cn)
          Set the name of the class of this specifier.
 void setName(java.lang.String n)
          Set the name for this specifier object.
 java.lang.String toString()
          This method is used by Boot, ProfileImpl, and RMA in order to have a String representation of this Specifier according to the format name:className(arg1 arg2 argn)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SPECIFIER_SEPARATOR

public static final char SPECIFIER_SEPARATOR
See Also:
Constant Field Values

NULL_SPECIFIER_LIST

public static final java.lang.String NULL_SPECIFIER_LIST
See Also:
Constant Field Values
Constructor Detail

Specifier

public Specifier()
Method Detail

setName

public void setName(java.lang.String n)
Set the name for this specifier object.

Parameters:
n - The name to give to this specifier.

getName

public java.lang.String getName()
Retrieve the name for this specifier object.

Returns:
The name of the specifier, if one was set, or null otherwise.

setClassName

public void setClassName(java.lang.String cn)
Set the name of the class of this specifier.

Parameters:
cn - The class name to assign to the specifier object.

getClassName

public java.lang.String getClassName()
Retrieve the class name of this specifier.

Returns:
The class name of the specifier, if one was set, or null otherwise.

setArgs

public void setArgs(java.lang.Object[] a)
Set the argument list for this specifier object.

Parameters:
a - An object array containing the argument list for this specifier.

getArgs

public java.lang.Object[] getArgs()
Retrieve the argument list for this specifier.

Returns:
An object array containing the argument list, if one was set, or null otherwise.

toString

public java.lang.String toString()
This method is used by Boot, ProfileImpl, and RMA in order to have a String representation of this Specifier according to the format name:className(arg1 arg2 argn)

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this specifier, according to the format above.

parseSpecifierList

public static java.util.Vector parseSpecifierList(java.lang.String specsLine)
                                           throws java.lang.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.:

name:className(comma-separated arglist)

While comma is the separator character within a specifier arguments, the semicolon is used to separate the different specifiers in the list.

Parameters:
specsLine - The string containing the representation of the specifier list, according to the format above.
Returns:
A vector containing the parsed specifiers.
java.lang.Exception

encodeSpecifierList

public static java.lang.String encodeSpecifierList(java.util.Vector v)
This static utility method produces a string representation of a list of Specifier objects.


parseList

public static final java.util.Vector parseList(java.lang.String list,
                                               char delimiter)

parseSpecifier

public static Specifier parseSpecifier(java.lang.String specString,
                                       char argsDelimiter)
                                throws java.lang.Exception
Utility method that parses a stringified object specifier in the form

name:className(separated arglist)

a Specifier object. Both the name and the list of arguments are optional.

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.
java.lang.Exception


JADE