org.ocltf.common
Class Context

java.lang.Object
  extended byorg.ocltf.common.Context

public class Context
extends java.lang.Object

A configurable context object. These are passed to Plugin instances (Cartridges, Libraries, etc.).

Author:
Chad Brandon

Constructor Summary
Context()
           
 
Method Summary
 void addProperty(Property property)
          Adds a property to this Context object.
 java.lang.String getName()
          Returns name of this Context.
 Property getProperty(java.lang.String name)
          Retrieves the property with the specified name.
 void init()
          This method normally be unnecessary.
 void setName(java.lang.String name)
          Sets the name of this Context.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Context

public Context()
Method Detail

init

public void init()
This method normally be unnecessary. It is here because of the way Ant behaves. Ant calls addProperty() before the Property javabean is fully initialized (therefore the 'name' isn't set). So we kept the javabeans in an ArrayList that we have to copy into the properties Map.


getName

public java.lang.String getName()
Returns name of this Context. Will correspond to a Plugin name (or it can be be 'default' if we want it's settings to be used everywhere).

Returns:
String

setName

public void setName(java.lang.String name)
Sets the name of this Context.

Parameters:
name - The name to set

addProperty

public void addProperty(Property property)
Adds a property to this Context object. A property must correspond to a java bean property name on a Plugin in order for it to be set during processing. Otherwise the property will just be ignored.

Parameters:
property -

getProperty

public Property getProperty(java.lang.String name)
Retrieves the property with the specified name.

Parameters:
name -
Returns:
Property.

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.