org.springframework.beandoc.output
Class EchoTransformer

java.lang.Object
  extended by org.springframework.beandoc.output.EchoTransformer
All Implemented Interfaces:
Transformer

public class EchoTransformer
extends Object
implements Transformer

Transformer that simply echoes the XML representation of the decorated DOM. Useful for testing or debugging. Not included in the default context file for the beandoc tool.

This transformer can be configured to write the XML to any Writer object you like by setting the 'writer' bean property. Defaults to System.out (wrapped by an OutputStreamWriter).

Since:
1.0
Author:
Darren Davison

Constructor Summary
EchoTransformer()
           
 
Method Summary
 void setPrettyPrint(boolean prettyPrint)
          The default processor removes all comments and whitespcace by default for efficiency.
 void setWriter(Writer writer)
          Set the Writer that you wish output to be directed to.
 void transform(org.jdom.Document[] contextDocuments, File outputDir)
          Simply echoes a textual representation of the decorated JDOM documents to the configured Writer (or System.out if no other was specified).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EchoTransformer

public EchoTransformer()
Method Detail

transform

public void transform(org.jdom.Document[] contextDocuments,
                      File outputDir)
Simply echoes a textual representation of the decorated JDOM documents to the configured Writer (or System.out if no other was specified).

Specified by:
transform in interface Transformer
Parameters:
contextDocuments - an array of JDOM Document objects
outputDir - the directory to place any output in
See Also:
Transformer.transform(org.jdom.Document[], File)

setWriter

public void setWriter(Writer writer)
Set the Writer that you wish output to be directed to. Defaults to an OutputStreamWriter around System.out

Parameters:
writer - which must not be null (throws IllegalArgumentException)

setPrettyPrint

public void setPrettyPrint(boolean prettyPrint)
The default processor removes all comments and whitespcace by default for efficiency. If you want the debug output to be a bit more readable, set this to true. False by default which echoes the raw format of the DOMified XML.

Parameters:
prettyPrint -


Copyright © 2004-2010 Spring BeanDoc. All Rights Reserved.