uk.ac.bbk.dcs.automed.xml.utilities
Class PrintUtility

java.lang.Object
  extended by uk.ac.bbk.dcs.automed.xml.utilities.PrintUtility

public class PrintUtility
extends java.lang.Object


Field Summary
private static int bannerWidth
           
 
Constructor Summary
PrintUtility()
           
 
Method Summary
static void banner()
          Prints a line of 90 stars.
static void banner(int num, java.io.Writer w)
          Prints a line of num stars.
static void banner(java.io.Writer w)
          Prints a line of 90 stars.
static java.lang.String documentToString(org.w3c.dom.Document d)
          Returns the String representation of document d.
static void prettyPrint(org.w3c.dom.Node n)
          Outputs the subtree with root n to System.out with identation, without any respect to the file's original identation
static void prettyPrint(org.w3c.dom.Node n, java.io.OutputStream ps)
           
static void prettyPrint(org.w3c.dom.Node n, java.lang.String title)
          Outputs the subtree with root n to System.out with identation, without any respect to the file's original identation.
static void prettyPrint(org.w3c.dom.Node n, java.lang.String title, java.io.OutputStream ps)
           
static void printDocument(org.w3c.dom.Document doc)
          Outputs Document doc in System.out exactly as it is in the DOM.
static void printDocument(org.w3c.dom.Document doc, java.io.File f)
          Outputs Document doc in File f exactly as it is in the DOM.
static void printDocument(org.w3c.dom.Document doc, java.io.OutputStream ps)
          Outputs Document doc in ps exactly as it is in the DOM.
static void title(java.lang.String title)
          Prints a line of stars, then the input title centered inside a line of stars, then another line of stars.
static void title(java.lang.String title, java.io.Writer w)
          Prints a line of stars, then the input title centered inside a line of stars, then another line of stars.
private static void treatNodes(org.w3c.dom.Node n, java.io.Writer osw)
          Help method for method NodeUtility#prettyPrint(Node n).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bannerWidth

private static int bannerWidth
Constructor Detail

PrintUtility

public PrintUtility()
Method Detail

printDocument

public static void printDocument(org.w3c.dom.Document doc,
                                 java.io.File f)
Outputs Document doc in File f exactly as it is in the DOM. This means that if there is no identation, it will not add any.


documentToString

public static java.lang.String documentToString(org.w3c.dom.Document d)
Returns the String representation of document d.


printDocument

public static void printDocument(org.w3c.dom.Document doc)
Outputs Document doc in System.out exactly as it is in the DOM. This means that if there is no identation, it will not add any.


printDocument

public static void printDocument(org.w3c.dom.Document doc,
                                 java.io.OutputStream ps)
Outputs Document doc in ps exactly as it is in the DOM. This means that if there is no identation, it will not add any.


banner

public static void banner(int num,
                          java.io.Writer w)
Prints a line of num stars.


title

public static void title(java.lang.String title)
Prints a line of stars, then the input title centered inside a line of stars, then another line of stars.


title

public static void title(java.lang.String title,
                         java.io.Writer w)
Prints a line of stars, then the input title centered inside a line of stars, then another line of stars.


banner

public static void banner()
Prints a line of 90 stars.


banner

public static void banner(java.io.Writer w)
Prints a line of 90 stars.


prettyPrint

public static void prettyPrint(org.w3c.dom.Node n,
                               java.io.OutputStream ps)

prettyPrint

public static void prettyPrint(org.w3c.dom.Node n,
                               java.lang.String title,
                               java.io.OutputStream ps)

prettyPrint

public static void prettyPrint(org.w3c.dom.Node n,
                               java.lang.String title)
Outputs the subtree with root n to System.out with identation, without any respect to the file's original identation.

Parameters:
n - the root of the subtree - will accept a Document variable
Throws:
XMLException

prettyPrint

public static void prettyPrint(org.w3c.dom.Node n)
Outputs the subtree with root n to System.out with identation, without any respect to the file's original identation

Parameters:
n - the root of the subtree - will accept a Document variable
Throws:
XMLException
org.w3c.dom.DOMException

treatNodes

private static void treatNodes(org.w3c.dom.Node n,
                               java.io.Writer osw)
                        throws java.io.IOException,
                               XMLException
Help method for method NodeUtility#prettyPrint(Node n).

Throws:
XMLException
org.w3c.dom.DOMException
java.io.IOException