jlibs.xml.xsl
Class TransformerUtil

java.lang.Object
  extended by jlibs.xml.xsl.TransformerUtil

public class TransformerUtil
extends Object

This class contains utility method related to transformation

Author:
Santhosh Kumar T

Field Summary
static String OUTPUT_KEY_INDENT_AMOUT
           
 
Constructor Summary
TransformerUtil()
           
 
Method Summary
static Transformer newTransformer(Source source, boolean omitXMLDeclaration, int indentAmount, String encoding)
          Creates Transformer
static TransformerHandler newTransformerHandler(Source source, boolean omitXMLDeclaration, int indentAmount, String encoding)
          Creates TransformerHandler
static Transformer setOutputProperties(Transformer transformer, boolean omitXMLDeclaration, int indentAmount, String encoding)
          to set various output properties on given transformer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUTPUT_KEY_INDENT_AMOUT

public static final String OUTPUT_KEY_INDENT_AMOUT
See Also:
Constant Field Values
Constructor Detail

TransformerUtil

public TransformerUtil()
Method Detail

setOutputProperties

public static Transformer setOutputProperties(Transformer transformer,
                                              boolean omitXMLDeclaration,
                                              int indentAmount,
                                              String encoding)
to set various output properties on given transformer.

Parameters:
transformer - transformer on which properties are set
omitXMLDeclaration - omit xml declaration or not
indentAmount - the number fo spaces used for indentation. use <=0, in case you dont want indentation
encoding - required encoding. use null to don't set any encoding
Returns:
the same transformer which is passed as argument

newTransformer

public static Transformer newTransformer(Source source,
                                         boolean omitXMLDeclaration,
                                         int indentAmount,
                                         String encoding)
                                  throws TransformerConfigurationException
Creates Transformer

Parameters:
source - source of xsl document, use null for identity transformer
omitXMLDeclaration - omit xml declaration or not
indentAmount - the number fo spaces used for indentation. use <=0, in case you dont want indentation
encoding - required encoding. use null to don't set any encoding
Returns:
the same transformer which is passed as argument
Throws:
TransformerConfigurationException

newTransformerHandler

public static TransformerHandler newTransformerHandler(Source source,
                                                       boolean omitXMLDeclaration,
                                                       int indentAmount,
                                                       String encoding)
                                                throws TransformerConfigurationException
Creates TransformerHandler

Parameters:
source - source of xsl document, use null for identity transformer
omitXMLDeclaration - omit xml declaration or not
indentAmount - the number fo spaces used for indentation. use <=0, in case you dont want indentation
encoding - required encoding. use null to don't set any encoding
Returns:
the same transformer which is passed as argument
Throws:
TransformerConfigurationException


Copyright © 2015. All rights reserved.