public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
DOM2HTML(Node node)
Converts an w3c.dom.Node into a color syntax HTML
|
static String |
DOM2String(Node node)
Converts an w3c.dom.Node into a String
|
static String |
leftPad(String str,
int length)
Pads a string left with spaces
|
static String |
leftPad(String str,
int length,
char ch)
Pads a string left with specified character
|
static void |
setDDIIdentifiableId(Element e,
String id)
Adds id related attributes to DDI Identifiable element
|
static void |
setDDIMaintainableId(Element e,
String id)
Adds id related attributes to DDI Maintainable element
|
static void |
setDDIVersionableId(Element e,
String id)
Adds id related attributes to DDI Versionable element
|
static void |
writeXmlFile(Document doc,
String filename)
Writes and org.w3c.dom.Document to a file
|
static void |
writeXmlFileAsHtml(Document doc,
String filename)
Writes and org.w3c.dom.Document to a file in a colored syntax HTML file
|
public static String DOM2String(Node node) throws TransformerException, TransformerFactoryConfigurationError
node - TransformerFactoryConfigurationErrorTransformerExceptionTransformerConfigurationExceptionpublic static String DOM2HTML(Node node) throws TransformerException
node - TransformerExceptionpublic static String leftPad(String str, int length)
str - public static String leftPad(String str, int length, char ch)
str - public static void writeXmlFile(Document doc, String filename) throws TransformerFactoryConfigurationError, TransformerException
doc - filename - TransformerFactoryConfigurationErrorTransformerExceptionpublic static void writeXmlFileAsHtml(Document doc, String filename) throws TransformerFactoryConfigurationError, TransformerException
doc - filename - TransformerFactoryConfigurationErrorTransformerExceptionpublic static void setDDIIdentifiableId(Element e, String id)
e - id - public static void setDDIMaintainableId(Element e, String id)
e - id - Copyright © 2016. All rights reserved.