org.openxml.x3p
Interface ProcessContext


public abstract interface ProcessContext

The process context is used to pass parameters to the processor, retrieve results and reserve context for engines. The context is created and maintained by the processor. The application can set parameters in the context and read processing results, and engines can save contexts and exchange information through it. It is recommended that context objects be named in distinct namespaces (e.g. "xml.stylesheet.url").

The activator should belong to the environment which created this processor, allowing engines to interact with execution environment. For example, the Servlet or EJB bean underwhich this processor is running. There is no guarantee that the activator will be any useful object.

Each context is also associated with a locale. Engines should use this locale for generating textual information, processing dates, sorting, and other locale-sensitive operations. Initially, the system default locale is used.

Version:
$Revision: 1.7 $ $Date: 1999/04/12 06:12:43 $
Author:
Assaf Arkin
See Also:
Processor, ProcessorEngine

Method Summary
 java.util.Enumeration enumerate()
          Returns an enumeration of all the object names.
 java.lang.Object getActivator()
          Returns the object that activated this processor.
 java.util.Locale getLocale()
          Returns the locale for processing.
 java.lang.Object getObject(java.lang.String name)
          Returns the named object.
 void setLocale(java.util.Locale newLocale)
          Sets the locale for processing.
 void setObject(java.lang.String name, java.lang.Object object)
          Associates the named value with an object.
 

Method Detail

getActivator

public java.lang.Object getActivator()
Returns the object that activated this processor. The activator provides access to the activating environment, e.g. a Servlet or an EJB bean.
Returns:
The activator object

setObject

public void setObject(java.lang.String name,
                      java.lang.Object object)
Associates the named value with an object. The object may be retrieved later with getObject(java.lang.String). If object is null, the object is removed.
Parameters:
name - The object name
object - The object, or null

getObject

public java.lang.Object getObject(java.lang.String name)
Returns the named object. The object must have been placed before with setObject(java.lang.String, java.lang.Object).
Parameters:
name - The object name
Returns:
The object, or null

enumerate

public java.util.Enumeration enumerate()
Returns an enumeration of all the object names. The objects must have been placed before with setObject(java.lang.String, java.lang.Object) and may be retrieved with getObject(java.lang.String).
Returns:
An enumeration of object names

getLocale

public java.util.Locale getLocale()
Returns the locale for processing.
Returns:
The locale for processing

setLocale

public void setLocale(java.util.Locale newLocale)
Sets the locale for processing.
Parameters:
newLocale - The new locale