org.ejen
Class EjenSourceNode

java.lang.Object
  |
  +--org.ejen.EjenChildNode
        |
        +--org.ejen.EjenSourceNode
All Implemented Interfaces:
EjenConstants

public class EjenSourceNode
extends EjenChildNode

Source node class (child of an EjenRootNode).

A Source node always replace an existing in memory DOM tree, even if it is the first sub-node of an "ejen" node (see EjenRootNode.beforeProcess()).

Usage (ant build file)

  <?xml version="1.0" encoding="UTF-8"?>

  <project name="generate" default="build">

    <taskdef name="ejen" classname="org.ejen.EjenTask"/>

    <target name="build">
      <ejen ...>
        ...
        <source [file="source.xml"]/>
        ...
      </ejen>
    </target>

  </project>
 

Parent nodes:

Version:
1.0
Author:
F. Wolff

Field Summary
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
EjenSourceNode()
           
 
Method Summary
 void check()
          Checks this EjenSourceNode for mandatory attributes.
 Properties getAttributes()
          Returns all non null attributes of this EjenSourceNode.
 String nodeName()
          Returns the name of this EjenSourceNode (always "source").
 void process()
          Executes this EjenSourceNode.
 void setFile(String file)
          [optional/AVT] - sets the file attribute.
 
Methods inherited from class org.ejen.EjenChildNode
afterProcess, beforeProcess, cloneContext, evaluateAVT, evaluateAVT, getChildren, getFromContext, getFromContext, getFromGlobalContext, getListener, getState, idle, 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

_file

protected String _file
Constructor Detail

EjenSourceNode

public EjenSourceNode()
Method Detail

nodeName

public String nodeName()
Returns the name of this EjenSourceNode (always "source").

Specified by:
nodeName in class EjenChildNode
Returns:
the name of this EjenSourceNode.

getAttributes

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

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

setFile

public void setFile(String file)
[optional/AVT] - sets the file attribute. If this attribute is missing, the current DOM tree will be reset to default (EjenConstants.DEFAULT_XML_DATA).

Parameters:
file - the XML file name to load.

check

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

Overrides:
check in class EjenChildNode

process

public void process()
Executes this EjenSourceNode. Even if a file is loaded, an "ejen-version" attribute, with the current Ejen version, is always added to the root node of the new DOM tree.

Overrides:
process in class EjenChildNode
Throws:
EjenException - if something goes wrong...