Package org.springframework.util.xml
Class TransformerUtils
- java.lang.Object
- org.springframework.util.xml.TransformerUtils
public abstract class TransformerUtils extends Object
Contains common behavior relating toTransformers
and thejavax.xml.transform
package in general.- Since:
- 2.5.5
- Author:
- Rick Evans, Juergen Hoeller
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_INDENT_AMOUNT
The indent amount of characters ifindenting is enabled
.
Constructor Summary
Constructors Constructor Description TransformerUtils()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
disableIndenting(Transformer transformer)
Disable indenting for the suppliedTransformer
.static void
enableIndenting(Transformer transformer)
Enable indenting for the suppliedTransformer
.static void
enableIndenting(Transformer transformer, int indentAmount)
Enable indenting for the suppliedTransformer
.
Field Detail
DEFAULT_INDENT_AMOUNT
public static final int DEFAULT_INDENT_AMOUNT
The indent amount of characters ifindenting is enabled
.Defaults to "2".
- See Also:
- Constant Field Values
Constructor Detail
TransformerUtils
public TransformerUtils()
Method Detail
enableIndenting
public static void enableIndenting(Transformer transformer)
Enable indenting for the suppliedTransformer
.If the underlying XSLT engine is Xalan, then the special output key
indent-amount
will be also be set to a value ofDEFAULT_INDENT_AMOUNT
characters.- Parameters:
transformer
- the target transformer- See Also:
Transformer.setOutputProperty(String, String)
,OutputKeys.INDENT
enableIndenting
public static void enableIndenting(Transformer transformer, int indentAmount)
Enable indenting for the suppliedTransformer
.If the underlying XSLT engine is Xalan, then the special output key
indent-amount
will be also be set to a value ofDEFAULT_INDENT_AMOUNT
characters.- Parameters:
transformer
- the target transformerindentAmount
- the size of the indent (2 characters, 3 characters, etc)- See Also:
Transformer.setOutputProperty(String, String)
,OutputKeys.INDENT
disableIndenting
public static void disableIndenting(Transformer transformer)
Disable indenting for the suppliedTransformer
.- Parameters:
transformer
- the target transformer- See Also:
OutputKeys.INDENT