com.oroad.stxx.transform
Class DOMWriteTransformer

java.lang.Object
  extended bycom.oroad.stxx.transform.AbstractSAXTransformer
      extended bycom.oroad.stxx.transform.DOMWriteTransformer
All Implemented Interfaces:
Transformer

public class DOMWriteTransformer
extends AbstractSAXTransformer

This transformer creates the usual xml from the request then saves it as a DOM node in either the request, session, or servlet context attributes. One possible use would be to use JSTL's XML tags to manipulate stxx-created XML by forwarding the request to a JSP using the "path" attribute.

Author:
Don Brown

Field Summary
static java.lang.String DEFAULT_ATTRIBUTE_NAME
          The default attribute name
static java.lang.String DEFAULT_SCOPE
          The default scope
 
Fields inherited from class com.oroad.stxx.transform.AbstractSAXTransformer
allowURLDebug, builder, cache, debugXMLPath, expiryTime, log, name, resolveFromTemplatePath, rules, transFactory, writeXMLDebug
 
Fields inherited from interface com.oroad.stxx.transform.Transformer
PROPS_PREFIX
 
Constructor Summary
DOMWriteTransformer()
          Constructor
 
Method Summary
 void init(java.lang.String name, StxxProperties props, javax.servlet.ServletContext context, BuilderRules rules)
          Initializes the defaults
 void setCache(Cache cache, long expiryTime)
          Sets the cache for the transformer (not used)
 void transform(ActionTransform trans, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Creates the XML, converts it into a DOM node, and stores it in the scope
 
Methods inherited from class com.oroad.stxx.transform.AbstractSAXTransformer
getFactory, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ATTRIBUTE_NAME

public static final java.lang.String DEFAULT_ATTRIBUTE_NAME
The default attribute name

See Also:
Constant Field Values

DEFAULT_SCOPE

public static final java.lang.String DEFAULT_SCOPE
The default scope

See Also:
Constant Field Values
Constructor Detail

DOMWriteTransformer

public DOMWriteTransformer()
Constructor

Method Detail

init

public void init(java.lang.String name,
                 StxxProperties props,
                 javax.servlet.ServletContext context,
                 BuilderRules rules)
Initializes the defaults

Specified by:
init in interface Transformer
Overrides:
init in class AbstractSAXTransformer
Parameters:
name - The name of the transformer
props - The properties
context - The servlet context
rules - The Builder rules

setCache

public void setCache(Cache cache,
                     long expiryTime)
Sets the cache for the transformer (not used)

Specified by:
setCache in interface Transformer
Overrides:
setCache in class AbstractSAXTransformer
Parameters:
cache - The cache
expiryTime - The expiration time for objects in milliseconds

transform

public void transform(ActionTransform trans,
                      javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws TransformerException
Creates the XML, converts it into a DOM node, and stores it in the scope

Specified by:
transform in interface Transformer
Specified by:
transform in class AbstractSAXTransformer
Parameters:
trans - The value object holding transformation information
response - The response object
request - The request object
Throws:
TransformerException - If something goes wrong