org.apache.avalon.composition.data
Class ConstructorDirective

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

public class ConstructorDirective
extends EntryDirective

A entry descriptor declares the context entry import or creation criteria for a single context entry instance.

XML

A entry may contain either (a) a single nested import directive, or (b) a single param constructor directives.

  <context>

    <!-- option (a) nested import -->
    <entry key="my-home-dir">
       <include key="urn:avalon:home"/>
    </entry>

    <!-- option (b) param constructors -->
    <entry key="title">
       <param>Lord of the Rings</>
    </entry>
    <entry key="home">
      <param class="java.io.File">../home</param>
    </entry>

  </context>
 

Version:
$Revision: 1.1.1.1 $ $Date: 2003/09/24 09:31:03 $
Author:
Avalon Development Team
See Also:
ImportDirective, Parameter, ContextDirective, Serialized Form

Constructor Summary
ConstructorDirective(String key, Parameter[] parameters)
          Creation of a new entry directive using a parameter.
ConstructorDirective(String key, String value)
          Creation of a new entry directive using a constructor classname and single argument value.
ConstructorDirective(String key, String classname, Parameter[] params)
          Creation of a new entry directive using a parameter.
ConstructorDirective(String key, String classname, String value)
          Creation of a new entry directive using a constructor classname and single argument value.
 
Method Summary
 String getArgument()
          Return the constructor single argument
 String getClassname()
          Return the constructor classname
 Parameter[] getParameters()
          Return the parameter directive if the mode is PARAM else null.
 
Methods inherited from class org.apache.avalon.composition.data.EntryDirective
getKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstructorDirective

public ConstructorDirective(String key,
                            String value)
Creation of a new entry directive using a constructor classname and single argument value.

Parameters:
key - the entry key
value - the single argument value

ConstructorDirective

public ConstructorDirective(String key,
                            String classname,
                            String value)
Creation of a new entry directive using a constructor classname and single argument value.

Parameters:
key - the entry key
classname - the classname of the entry implementation
value - the single argument value

ConstructorDirective

public ConstructorDirective(String key,
                            Parameter[] parameters)
Creation of a new entry directive using a parameter.

Parameters:
key - the entry key
parameters - implementation class constructor parameter directives

ConstructorDirective

public ConstructorDirective(String key,
                            String classname,
                            Parameter[] params)
Creation of a new entry directive using a parameter.

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

getClassname

public String getClassname()
Return the constructor classname

Returns:
the classname

getParameters

public Parameter[] getParameters()
Return the parameter directive if the mode is PARAM else null.

Returns:
the directive

getArgument

public String getArgument()
Return the constructor single argument

Returns:
the costructor argument


Copyright © Apache Software Foundation. All Rights Reserved.