org.activemath.presentation.preproc
Class PrepareForCnPTask

java.lang.Object
  extended by org.activemath.presentation.preproc.PrepareForCnPTask
All Implemented Interfaces:
Task

public class PrepareForCnPTask
extends Object
implements Task

A pre-processor to mark the coordinate of each node for further references.

Version:
$Revision: 1.7 $

Field Summary
static TaskFactory factory
           
static Task soleInstance
           
 
Fields inherited from interface org.activemath.presentation.preproc.Task
CVS_ID
 
Constructor Summary
PrepareForCnPTask()
           
 
Method Summary
 void close()
          Invoked by the pre-processor at the end of PreProcessor.run(org.jdom.Element, java.util.Map).
static TaskFactory giveFactory()
          Simply returns the same factory which, itself, returns the only task instance as this task is purely functional.
 void open()
          Invoked by the pre-processor at the beginning of PreProcessor.run(org.jdom.Element, java.util.Map).
 boolean perform(ListIterator listIt, org.jdom.Element elt, Map properties)
          Invoked by the pre-processor on an element elt to be processed by the task.
static void prepareForDnD(org.jdom.Element root)
           
static String testAssemblePath(org.jdom.Element e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

public static final TaskFactory factory

soleInstance

public static final Task soleInstance
Constructor Detail

PrepareForCnPTask

public PrepareForCnPTask()
Method Detail

giveFactory

public static TaskFactory giveFactory()
Simply returns the same factory which, itself, returns the only task instance as this task is purely functional.


open

public void open()
Description copied from interface: Task
Invoked by the pre-processor at the beginning of PreProcessor.run(org.jdom.Element, java.util.Map).

Specified by:
open in interface Task

close

public void close()
Description copied from interface: Task
Invoked by the pre-processor at the end of PreProcessor.run(org.jdom.Element, java.util.Map).

Specified by:
close in interface Task

perform

public boolean perform(ListIterator listIt,
                       org.jdom.Element elt,
                       Map properties)
Description copied from interface: Task
Invoked by the pre-processor on an element elt to be processed by the task.

Modifications like replacing, removing or adding an element to the parent of elt should only be performed using the currentPos list-iterator (and, as of this writing, such an operation would fail with JDOM b7 unless your element objects are OJElements. This will be fixed in further release of JDOM).

A task performance should not throw an exception unless the task cannot continue walking the subelements.

Specified by:
perform in interface Task
Parameters:
listIt - the iterator of all elements child of the same parent, currently enumerating this element may be null in which case the parent was not enumerated (i.e. when elt is the element called on PreProcessor.run(org.jdom.Element, java.util.Map).
elt - the element to process
properties - An object that lives during the performance and can be used to extract and store states and parameters for the processing action. Typical values include the user and session (as string in keys and value). Properties are passed at startup (i.e. in TaskFactory.make(org.jdom.Element, java.util.Map) and at each perform, they are the same object throughout.

prepareForDnD

public static void prepareForDnD(org.jdom.Element root)

testAssemblePath

public static String testAssemblePath(org.jdom.Element e)