org.ejen
Class EjenStylesheetNode

java.lang.Object
  |
  +--org.ejen.EjenChildNode
        |
        +--org.ejen.EjenStylesheetNode
All Implemented Interfaces:
EjenConstants
Direct Known Subclasses:
EjenFilterNode, EjenImportNode, EjenIncludeNode, EjenTemplateNode

public abstract class EjenStylesheetNode
extends EjenChildNode

Parent abstract class of all Ejen...Node classes that use a stylesheet (filter, template, include and import).

Version:
1.0
Author:
F. Wolff

Field Summary
protected  Vector _childNodes
           
protected  String _file
           
 
Fields inherited from class org.ejen.EjenChildNode
_messageIndent
 
Fields inherited from interface org.ejen.EjenConstants
CTX_DOM_SOURCE, CTX_STYLESHEET_HANDLER, CTX_STYLESHEET_ROOT, CTX_TRANSFORMER_FACTORY_IMPL, CTX_TRANSFORMER_IMPL, DEFAULT_XML_DATA, DEFAULT_XML_DATA_ENCODING, DEFAULT_XSL_DATA, LOG_INDENT_STR1, LOG_INDENT_STR2, MSG_DEBUG, MSG_ERR, MSG_INFO, MSG_VERBOSE, MSG_WARN, STATE_AFTER_PROCESS, STATE_BEFORE_PROCESS, STATE_CHECK, STATE_IDLE, STATE_PROCESS, STATES
 
Constructor Summary
EjenStylesheetNode()
           
 
Method Summary
 void afterProcess()
          Pops the context that has been pushed by the beforeProcess() method.
 void beforeProcess()
          Prepares this EjenStylesheetNode execution.
 void check()
          Checks this EjenStylesheetNode for mandatory attributes.
 EjenImportNode createImport()
          Creates a new import node and appends it to the list of current child nodes of this EjenStylesheetNode.
 EjenIncludeNode createInclude()
          Creates a new include node and appends it to the list of current child nodes of this EjenStylesheetNode.
 EjenParamNode createParam()
          Creates a new param node and appends it to the list of current child nodes of this EjenStylesheetNode.
 Properties getAttributes()
          Returns all non null attributes of this EjenStylesheetNode.
 Vector getChildren()
          Returns all child nodes of this EjenStylesheetNode (include, import or param).
 void process()
          Executes this EjenStylesheetNode (and all child nodes).
 void setFile(String file)
          [mandatory/AVT] - sets the file attribute.
 
Methods inherited from class org.ejen.EjenChildNode
cloneContext, evaluateAVT, evaluateAVT, getFromContext, getFromContext, getFromGlobalContext, getListener, getState, idle, nodeName, popContext, pushContext, putInContext, putInGlobalContext, sendMessageEvent, sendMessageEvent, sendStateEvent, sendXSLMessageEvent, sendXSLMessageEvent, setListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_childNodes

protected Vector _childNodes

_file

protected String _file
Constructor Detail

EjenStylesheetNode

public EjenStylesheetNode()
Method Detail

getAttributes

public Properties getAttributes()
Returns all non null attributes of this EjenStylesheetNode.

Overrides:
getAttributes in class EjenChildNode
Returns:
non null attributes of this EjenStylesheetNode.

getChildren

public Vector getChildren()
Returns all child nodes of this EjenStylesheetNode (include, import or param).

Overrides:
getChildren in class EjenChildNode
Returns:
all child nodes of this EjenStylesheetNode.

setFile

public void setFile(String file)
[mandatory/AVT] - sets the file attribute.

Parameters:
file - name of the XSL file stylesheet to be used as filter, template, include or import.

createParam

public EjenParamNode createParam()
Creates a new param node and appends it to the list of current child nodes of this EjenStylesheetNode.

Returns:
the new param node.

createInclude

public EjenIncludeNode createInclude()
Creates a new include node and appends it to the list of current child nodes of this EjenStylesheetNode.

Returns:
the new include node.

createImport

public EjenImportNode createImport()
Creates a new import node and appends it to the list of current child nodes of this EjenStylesheetNode.

Returns:
the new import node.

check

public void check()
Checks this EjenStylesheetNode for mandatory attributes.

Overrides:
check in class EjenChildNode
Throws:
EjenException - if file attribute is not set or if any call to the check() method of a child node fails.

beforeProcess

public void beforeProcess()
Prepares this EjenStylesheetNode execution. Creates a new Transformer with the stylesheet whose name is provided by the file attribute and pushes a new context onto the context stack.

Overrides:
beforeProcess in class EjenChildNode

process

public void process()
Executes this EjenStylesheetNode (and all child nodes). This method is called by the process() method in each implementation of the EjenStylesheetNode abstract class.

Overrides:
process in class EjenChildNode

afterProcess

public void afterProcess()
Pops the context that has been pushed by the beforeProcess() method.

Overrides:
afterProcess in class EjenChildNode