|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xiruss.util.DataUtil
public class DataUtil
Field Summary | |
---|---|
(package private) static org.apache.log4j.Logger |
logger
|
Constructor Summary | |
---|---|
DataUtil()
|
Method Summary | |
---|---|
static java.lang.String |
byteToHex(byte b)
|
static java.lang.String |
charToHex(char c)
|
static java.lang.String |
echoEndTag(org.w3c.dom.Element elem)
|
static java.lang.String |
echoStartTag(org.w3c.dom.Element elem)
|
static java.lang.String |
escapeUnicodeString(java.lang.String inString)
|
static java.lang.String |
escapeXmlMarkup(java.lang.String line)
|
static org.w3c.dom.Element |
getAttHolder(org.w3c.dom.Element startNode,
java.lang.String attName)
Returns element that exhibits the specified attribute, walking up the element hierarchy. |
static long |
getCharacterCount(java.io.File inFile,
java.lang.String charSetName)
|
static java.lang.String |
getCharacterEncodingForFile(java.io.File inFile)
Returns the characater encoding for the file. |
static org.w3c.dom.Element |
getElement(org.w3c.dom.Element parentElem,
java.lang.String tagName)
Returns the element with the specified tag name. |
static java.util.List |
getElementChildren(org.w3c.dom.Element elem)
|
static ElementIterator |
getElementChildrenIterator(org.w3c.dom.Element elem)
|
static java.lang.String |
getElementContent(org.w3c.dom.Element elem)
Returns the string content of an element (e.g., xsl:value-of()). |
static java.lang.String |
getElementLanguage(org.w3c.dom.Element elemNode,
java.lang.String defaultLangCode)
Returns the language code associated with the specified element. |
static org.w3c.dom.Element |
getFirstElementChild(org.w3c.dom.Element elemNode)
Returns the first element node within the children of the specified element. |
static int |
getIntForHexChar(char hexChar)
|
static java.lang.String |
getMimeTypeForFile(java.io.File memberFile)
|
static boolean |
hasElementChildren(org.w3c.dom.Element elemNode)
Returns true if the input element has element children. |
static byte[] |
hexToBytes(java.lang.String hexString)
|
static boolean |
isTextFile(java.io.File inFile)
Returns true if the input file appears to be a text file. |
static java.lang.String |
lastPathToken(java.lang.String path)
Returns the last token of a tokenized file path. |
static java.lang.String |
readUnicodeFile(java.lang.String filePath,
java.lang.String encoding)
Given the path to a file in the specified encoding, returns a single string with the contents of that file. |
static java.lang.String |
stripAngleBrackets(java.lang.String toStrip)
|
static java.util.Vector<java.lang.String> |
tokenizePath(java.lang.String path)
|
static void |
writeCollationRulesForLocale(java.util.Locale locale,
java.lang.String outFilePath)
|
static void |
writeUnicodeFile(java.lang.String outString,
java.lang.String filePath,
java.lang.String encoding)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static org.apache.log4j.Logger logger
Constructor Detail |
---|
public DataUtil()
Method Detail |
---|
public static java.lang.String stripAngleBrackets(java.lang.String toStrip)
public static byte[] hexToBytes(java.lang.String hexString)
public static java.lang.String echoStartTag(org.w3c.dom.Element elem)
public static java.lang.String echoEndTag(org.w3c.dom.Element elem)
public static org.w3c.dom.Element getAttHolder(org.w3c.dom.Element startNode, java.lang.String attName)
startNode
- The node to check first. It's ancestors will be interogated until
the attribute is found or the root is reached.attName
- The name of the attribute to find.
I18nServiceError
public static org.w3c.dom.Element getFirstElementChild(org.w3c.dom.Element elemNode)
elemNode
- The element whose first element child is to be returned.public static boolean hasElementChildren(org.w3c.dom.Element elemNode)
elemNode
- public static java.lang.String getElementContent(org.w3c.dom.Element elem)
elem
- Element to get the value of.public static java.lang.String getElementLanguage(org.w3c.dom.Element elemNode, java.lang.String defaultLangCode)
elemNode
- The whose language value is to be returned.defaultLangCode
- The default language code to return if
there is no explicit language code.public static org.w3c.dom.Element getElement(org.w3c.dom.Element parentElem, java.lang.String tagName) throws DataUtilException
DataUtilException
public static int getIntForHexChar(char hexChar)
public static java.lang.String escapeUnicodeString(java.lang.String inString)
public static java.lang.String byteToHex(byte b)
public static java.lang.String charToHex(char c)
public static java.lang.String readUnicodeFile(java.lang.String filePath, java.lang.String encoding) throws DataUtilException
filePath
- The local path to the fileencoding
- The encoding name: UTF8, UTF16, etc.
DataUtilException
public static void writeUnicodeFile(java.lang.String outString, java.lang.String filePath, java.lang.String encoding) throws DataUtilException
DataUtilException
public static void writeCollationRulesForLocale(java.util.Locale locale, java.lang.String outFilePath) throws DataUtilException
DataUtilException
public static java.lang.String getMimeTypeForFile(java.io.File memberFile)
memberFile
-
public static boolean isTextFile(java.io.File inFile)
inFile
-
public static java.lang.String getCharacterEncodingForFile(java.io.File inFile) throws java.io.FileNotFoundException, java.io.IOException
inFile
-
java.io.FileNotFoundException
java.io.IOException
public static java.lang.String escapeXmlMarkup(java.lang.String line)
line
-
public static java.util.Vector<java.lang.String> tokenizePath(java.lang.String path)
docKey
-
public static long getCharacterCount(java.io.File inFile, java.lang.String charSetName)
inFile
-
public static java.lang.String lastPathToken(java.lang.String path)
public static java.util.List getElementChildren(org.w3c.dom.Element elem)
public static ElementIterator getElementChildrenIterator(org.w3c.dom.Element elem)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |