wt.util.xml
Class XMLMechanismUtilities

java.lang.Object
  extended bywt.util.xml.XMLMechanismUtilities
All Implemented Interfaces:
Serializable

public class XMLMechanismUtilities
extends Object
implements Serializable

Class Utility for this package.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static boolean DEBUG
           
private static String RESOURCE
           
 
Constructor Summary
XMLMechanismUtilities()
           
 
Method Summary
static void cleanDOMDocument(Node node)
          removes whitespace Text Nodes from a Node or Document's hierarchy, and trims whitespace from the beginning and end of the String data of non-whitespace Text Nodes in a Node or Document's hierarchy.
static String convertTypeName(String propertyType)
          Given the results of the getPropertyType introspection method, this method returns the class, interface or java primitive type as a single fully qualified class name, or the primitive name.
static String createFullyQualifiedFileName(File file)
          

Supported API: false
static String createFullyQualifiedFileName(String path, String fileroot, String ext)
          

Supported API: false
static String dotToUnderscore(String theString)
          

Supported API: false
static String getSpaces(int spaces)
          returns a string with spaces only, whose length is equal to the length argument

Supported API: false
static String parseAttributeName(String attributeNameClassNamePair)
          parses the attribute name from an attributeName:className pair.
static String parseClassGetName(String classGetName)
          given the results of .getName() or .toString() on a class object, returns a more human-readable version, especially for arrays.
static String parseClassName(String attributeNameClassNamePair)
          parses the class name from an attributeName:className pair.
static String stripGeneratorFromClassName(String className)
          This method takes a String and removes the suffix "Generator" from it, if any such suffix exists.
static String stripPackagesFromClassName(String fullyQualifiedClassName)
          Given a String, this method returns the same String with any text up to and including the first period (".") removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

XMLMechanismUtilities

public XMLMechanismUtilities()
Method Detail

stripPackagesFromClassName

public static String stripPackagesFromClassName(String fullyQualifiedClassName)
Given a String, this method returns the same String with any text up to and including the first period (".") removed. If there are no periods in the String, no text is removed.

Supported API: false

Parameters:
fullyQualifiedClassName -
Returns:
String

stripGeneratorFromClassName

public static String stripGeneratorFromClassName(String className)
This method takes a String and removes the suffix "Generator" from it, if any such suffix exists. If not, the original String is returned, unmodified.

Supported API: false

Parameters:
className -
Returns:
String

convertTypeName

public static String convertTypeName(String propertyType)
Given the results of the getPropertyType introspection method, this method returns the class, interface or java primitive type as a single fully qualified class name, or the primitive name.

Supported API: false

Parameters:
propertyType -
Returns:
String

cleanDOMDocument

public static void cleanDOMDocument(Node node)
removes whitespace Text Nodes from a Node or Document's hierarchy, and trims whitespace from the beginning and end of the String data of non-whitespace Text Nodes in a Node or Document's hierarchy. CDATA sections are not touched.

Supported API: false

Parameters:
node -

dotToUnderscore

public static String dotToUnderscore(String theString)


Supported API: false

Parameters:
theString -
Returns:
String

createFullyQualifiedFileName

public static String createFullyQualifiedFileName(String path,
                                                  String fileroot,
                                                  String ext)


Supported API: false

Parameters:
path -
fileroot -
ext -
Returns:
String

createFullyQualifiedFileName

public static String createFullyQualifiedFileName(File file)
                                           throws XMLMechanismException


Supported API: false

Parameters:
file -
Returns:
String
Throws:
XMLMechanismException

getSpaces

public static String getSpaces(int spaces)
                        throws XMLMechanismException
returns a string with spaces only, whose length is equal to the length argument

Supported API: false

Parameters:
spaces - the number of spaces to return
Returns:
String
Throws:
XMLMechanismException

parseClassName

public static String parseClassName(String attributeNameClassNamePair)
parses the class name from an attributeName:className pair.

Supported API: false

Parameters:
attributeNameClassNamePair -
Returns:
String

parseAttributeName

public static String parseAttributeName(String attributeNameClassNamePair)
parses the attribute name from an attributeName:className pair.

Supported API: false

Parameters:
attributeNameClassNamePair -
Returns:
String

parseClassGetName

public static String parseClassGetName(String classGetName)
given the results of .getName() or .toString() on a class object, returns a more human-readable version, especially for arrays.

Supported API: false

Parameters:
classGetName - the results of .getName() or .toString() on a class object.
Returns:
String