org.apache.avalon.composition.data
Class Parameter

java.lang.Object
  extended byorg.apache.avalon.composition.data.Parameter
All Implemented Interfaces:
Serializable

public class Parameter
extends Object
implements Serializable

A Parameter represents a single constructor typed argument value. A parameter container a classname (default value of java.lang.String) and possible sub-parameters. A parameter's value is established by creating a new instance using the parameter's classname, together with the values directived from the sub-sidiary parameters as constructor arguments.

XML

A param is a nested structure containing a string value or contructor parameter arguments.

    <-- Simple string param declaration -->

    <param>London</param>

    <-- Typed param declaration -->

    <param class="java.io.File">./home</param>

    <-- Typed parameter declaration referencing a context value -->

    <param class="java.lang.ClassLoader">${my-classloader-import-key}</param>

    <-- Multi-argument parameter declaration -->

    <param class="MyClass">
       <param class="java.io.File">./home</param>
       <param>London</param>
    </param>
 

TODO: Fix usage of basic type (int, float, long, etc.) - how do we return basic types - can't use getValue() becuase it returns an Object unless have some way of packing the basic type into a carrier

Version:
$Revision: 1.2 $ $Date: 2003/10/28 12:53:48 $
Author:
Avalon Development Team
See Also:
EntryDirective, ImportDirective, Serialized Form

Constructor Summary
Parameter(String value)
          Creation of a new parameter using the default java.lang.String type and a supplied value.
Parameter(String classname, Parameter[] parameters)
          Creation of a new entry directive.
Parameter(String classname, String value)
          Creation of a new entry directive using a supplied classname and value.
 
Method Summary
 String getArgument()
          Return the argument (may be null).
 String getClassname()
          Return the classname of the parameter implementation to use.
 Parameter[] getParameters()
          Return the constructor parameters for this parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter(String value)
Creation of a new parameter using the default java.lang.String type and a supplied value.

Parameters:
value - the string value

Parameter

public Parameter(String classname,
                 String value)
Creation of a new entry directive using a supplied classname and value.

Parameters:
classname - the classname of the parameter
value - the parameter constructor value

Parameter

public Parameter(String classname,
                 Parameter[] parameters)
Creation of a new entry directive.

Parameters:
classname - the classname of the entry implementation
parameters - implementation class constructor parameter directives
Method Detail

getClassname

public String getClassname()
Return the classname of the parameter implementation to use.

Returns:
the classname

getArgument

public String getArgument()
Return the argument (may be null).


getParameters

public Parameter[] getParameters()
Return the constructor parameters for this parameter.



Copyright © Apache Software Foundation. All Rights Reserved.