net.dpml.metro.data
Class ContextDirective

java.lang.Object
  extended by net.dpml.metro.data.AbstractDirective
      extended by net.dpml.metro.data.ContextDirective
All Implemented Interfaces:
Serializable

public final class ContextDirective
extends AbstractDirective

A context descriptor declares the context creation criteria for the context instance and context entries.

XML

A context directive may contain multiple import statements. Each import statement corresponds to a request for a context value from the container.

    <context class="MyContextClass">
       <entry key="special">
         <import key="urn:avalon:classloader"/>
       </entry>
       <entry key="xxx">
         <param class="MySpecialClass">
           <param>hello</param>
           <param class="java.io.File">../lib</param>
         </param>
       </entry>
    </context>
 

Version:
1.0.4
Author:
Digital Product Meta Library
See Also:
Serialized Form

Constructor Summary
ContextDirective()
          Creation of a context directive.
ContextDirective(PartReference[] entries)
          Creation of a context directive
ContextDirective(String classname, PartReference[] entries)
          Creation of a new file target.
 
Method Summary
 boolean equals(Object other)
          Test if the supplied object is equal to this object.
 String getClassname()
          Return the classname of the context implementation to use.
 PartReference[] getDirectives()
          Return the set of entry directives.
 Directive getPartDirective(String key)
          Return part defining the value for the requested entry.
 PartReference getPartReference(String key)
          Return part reference defining the value for the requested entry.
 int hashCode()
          Return the hashcode for the instance.
 
Methods inherited from class net.dpml.metro.data.AbstractDirective
getPartHandlerURI, setupURI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextDirective

public ContextDirective()
Creation of a context directive.


ContextDirective

public ContextDirective(PartReference[] entries)
Creation of a context directive

Parameters:
entries - the set of entry descriptors

ContextDirective

public ContextDirective(String classname,
                        PartReference[] entries)
Creation of a new file target.

Parameters:
classname - the context implementation class
entries - the set of entry descriptors
Method Detail

getClassname

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

Returns:
the classname

getDirectives

public PartReference[] getDirectives()
Return the set of entry directives.

Returns:
the entries

getPartReference

public PartReference getPartReference(String key)
Return part reference defining the value for the requested entry.

Parameters:
key - the context entry key
Returns:
the part reference corresponding to the supplied key or null if the key is unknown

getPartDirective

public Directive getPartDirective(String key)
Return part defining the value for the requested entry.

Parameters:
key - the context entry key
Returns:
the part defintion corresponding to the supplied key or null if the key is unknown

equals

public boolean equals(Object other)
Test if the supplied object is equal to this object.

Overrides:
equals in class AbstractDirective
Parameters:
other - the object to compare with this instance
Returns:
TRUE if the supplied object is equal to this object

hashCode

public int hashCode()
Return the hashcode for the instance.

Overrides:
hashCode in class AbstractDirective
Returns:
the instance hashcode