org.apache.cocoon.processor.dcp
Class DCPEngine

java.lang.Object
  |
  +--org.apache.cocoon.processor.dcp.DCPEngine

public class DCPEngine
extends java.lang.Object

This class implements a DOM processor that evaluates <?dcp? > processing instructions to generate dynamic content.

The following processing instructions are recognized:

Version:
$Revision: 1.1 $ $Date: 1999/09/13 00:22:23 $
Author:
Ricardo Rocha

Field Summary
private static java.lang.String CODE_ATTRIBUTE
           
private static java.lang.String CONTENT_PI
           
private  Director director
           
private  org.w3c.dom.Document document
           
private  java.util.Hashtable globalVariables
           
private  java.util.Hashtable instances
           
private  InterpreterFactory interpreterFactory
           
private static java.lang.String LANGUAGE_ATTRIBUTE
           
private static java.lang.String METHOD_ATTRIBUTE
           
private static java.lang.String NAME_ATTRIBUTE
           
private static java.lang.String OBJECT_PI
           
private  java.util.Dictionary parameters
           
private static java.lang.String VARIABLE_PI
           
 
Constructor Summary
DCPEngine(org.w3c.dom.Document document, InterpreterFactory factory, java.util.Dictionary parameters)
          Set the document being processed and any parameters passed by the invoking environment.
 
Method Summary
private  void doProcess(org.w3c.dom.Node node)
           
private  org.w3c.dom.Node[] getChildren(org.w3c.dom.Node node)
           
private  void parseAttributes(java.lang.String data, java.util.Hashtable attributes)
           
 void process()
          Process the document substituting <?
private  org.w3c.dom.Node processContent(org.w3c.dom.ProcessingInstruction pi)
           
private  void processObject(org.w3c.dom.ProcessingInstruction pi)
           
private  void processVariable(org.w3c.dom.ProcessingInstruction pi)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

OBJECT_PI

private static final java.lang.String OBJECT_PI

CONTENT_PI

private static final java.lang.String CONTENT_PI

VARIABLE_PI

private static final java.lang.String VARIABLE_PI

NAME_ATTRIBUTE

private static final java.lang.String NAME_ATTRIBUTE

LANGUAGE_ATTRIBUTE

private static final java.lang.String LANGUAGE_ATTRIBUTE

CODE_ATTRIBUTE

private static final java.lang.String CODE_ATTRIBUTE

METHOD_ATTRIBUTE

private static final java.lang.String METHOD_ATTRIBUTE

interpreterFactory

private InterpreterFactory interpreterFactory

document

private org.w3c.dom.Document document

director

private Director director

parameters

private java.util.Dictionary parameters

instances

private java.util.Hashtable instances

globalVariables

private java.util.Hashtable globalVariables
Constructor Detail

DCPEngine

public DCPEngine(org.w3c.dom.Document document,
                 InterpreterFactory factory,
                 java.util.Dictionary parameters)
Set the document being processed and any parameters passed by the invoking environment.

This method sets the DOM tree to be scanned for dynamic content <?dcp?> processing instructions as well as the context parameters provided by the invoking environment.

Parameters:
document - The document to be processed for dynamic content
parameters - The table of environment variables to be used during processing
Method Detail

process

public void process()
             throws java.lang.Exception
Process the document substituting <?dcp?> processing instructions by dynamic content.

This method carries out the actual expansion of dynamic content processing instructions embedded in the document.

Throws:
java.lang.Exception - When any error occurs during processing

doProcess

private void doProcess(org.w3c.dom.Node node)

processObject

private void processObject(org.w3c.dom.ProcessingInstruction pi)
                    throws java.lang.Exception

processContent

private org.w3c.dom.Node processContent(org.w3c.dom.ProcessingInstruction pi)
                                 throws java.lang.Exception

processVariable

private void processVariable(org.w3c.dom.ProcessingInstruction pi)
                      throws java.lang.Exception

parseAttributes

private void parseAttributes(java.lang.String data,
                             java.util.Hashtable attributes)

getChildren

private org.w3c.dom.Node[] getChildren(org.w3c.dom.Node node)


Copyright 1999 Java Apache Project. All Rights Reserved.