org.apache.batik.dom.util

Class DOMUtilities

public class DOMUtilities extends XMLUtilities

A collection of utility functions for the DOM.
Field Summary
protected static String[]LOCK_STRINGS
String constants representing DOM modifier strings for various all key lock combinations.
protected static String[]MODIFIER_STRINGS
String constants representing DOM modifier strings for various all shift modifier combinations.
Constructor Summary
protected DOMUtilities()
Do not need to be instantiated.
Method Summary
static StringcontentToString(String s)
Returns the given content value transformed to replace invalid characters with entities.
static DocumentdeepCloneDocument(Document doc, DOMImplementation impl)
Deep clones a document using the given DOM implementation.
static StringgetLocalName(String s)
Gets the local name from the given qualified name.
static StringgetModifiersList(int lockState, int modifiers)
Gets a DOM 3 modifiers string from the given lock and shift bitmasks.
static StringgetPrefix(String s)
Gets the prefix from the given qualified name.
static booleanisValidName(String s)
Tests whether the given string is a valid name.
static booleanisValidName11(String s)
Tests whether the given string is a valid XML 1.1 name.
static booleanisValidPrefix(String s)
Tests whether the given string is a valid prefix.
static voidparseStyleSheetPIData(String data, HashTable table)
Parses a 'xml-stylesheet' processing instruction data section and puts the pseudo attributes in the given table.
static voidwriteDocument(Document doc, Writer w)
Writes the given document using the given writer.
static voidwriteNode(Node n, Writer w)
Writes a node using the given writer.

Field Detail

LOCK_STRINGS

protected static final String[] LOCK_STRINGS
String constants representing DOM modifier strings for various all key lock combinations.

MODIFIER_STRINGS

protected static final String[] MODIFIER_STRINGS
String constants representing DOM modifier strings for various all shift modifier combinations.

Constructor Detail

DOMUtilities

protected DOMUtilities()
Do not need to be instantiated.

Method Detail

contentToString

public static String contentToString(String s)
Returns the given content value transformed to replace invalid characters with entities.

deepCloneDocument

public static Document deepCloneDocument(Document doc, DOMImplementation impl)
Deep clones a document using the given DOM implementation.

getLocalName

public static String getLocalName(String s)
Gets the local name from the given qualified name. This method assume that isValidName(s) is true.

getModifiersList

public static String getModifiersList(int lockState, int modifiers)
Gets a DOM 3 modifiers string from the given lock and shift bitmasks.

getPrefix

public static String getPrefix(String s)
Gets the prefix from the given qualified name. This method assume that isValidName(s) is true.

isValidName

public static boolean isValidName(String s)
Tests whether the given string is a valid name.

isValidName11

public static boolean isValidName11(String s)
Tests whether the given string is a valid XML 1.1 name.

isValidPrefix

public static boolean isValidPrefix(String s)
Tests whether the given string is a valid prefix. This method assume that isValidName(s) is true.

parseStyleSheetPIData

public static void parseStyleSheetPIData(String data, HashTable table)
Parses a 'xml-stylesheet' processing instruction data section and puts the pseudo attributes in the given table.

writeDocument

public static void writeDocument(Document doc, Writer w)
Writes the given document using the given writer.

writeNode

public static void writeNode(Node n, Writer w)
Writes a node using the given writer.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.