public class XML
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
XML.ObjectLoader
This defines methods for moving xml data between an XMLControl and
a corresponding Java object.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CDATA_POST |
static java.lang.String |
CDATA_PRE |
static int |
INDENT |
static java.lang.String |
NEW_LINE |
Modifier and Type | Method and Description |
---|---|
static void |
createFolders(java.lang.String path)
Creates any missing folders in the specified path.
|
static java.lang.String |
forwardSlash(java.lang.String path)
Replaces backslashes with slashes.
|
static java.lang.ClassLoader |
getClassLoader()
Gets the ClassLoader.
|
static java.lang.String |
getDataType(java.lang.Object obj)
Gets the datatype of the object.
|
static java.lang.String[] |
getDataTypes()
Gets an array containing all supported data types.
|
static java.lang.String |
getDirectoryPath(java.lang.String fileName)
Gets the path of the directory containing the specified file.
|
static java.lang.String |
getDTD(java.lang.String doctype)
Gets the DTD for the specified doctype file name.
|
static java.lang.String |
getExtension(java.lang.String fileName)
Gets the extension of the specified file name.
|
static XML.ObjectLoader |
getLoader(java.lang.Class classtype)
Gets the ObjectLoader for the specified class.
|
static java.lang.String |
getName(java.lang.String path)
Gets the name from the specified path.
|
static java.lang.String |
getPathRelativeTo(java.lang.String absolutePath,
java.lang.String base)
Gets the path relative to the specified base directory.
|
static java.lang.String |
getRelativePath(java.lang.String absolutePath)
Gets a path relative to the default user directory.
|
static java.lang.String |
getResolvedPath(java.lang.String relativePath,
java.lang.String base)
Resolves the name of a file specified relative to a base path.
|
static java.lang.String |
getSimpleClassName(java.lang.Class type)
Gets a simple class name for the specified class type.
|
static java.lang.String |
getUserDirectory()
Gets the default user directory.
|
static boolean |
requiresCDATA(java.lang.String text)
Determines whether the specified string requires CDATA tags.
|
static void |
setClassLoader(java.lang.ClassLoader loader)
Sets the ClassLoader.
|
static void |
setDefaultLoader(XML.ObjectLoader loader)
Sets the default ObjectLoader.
|
static void |
setLoader(java.lang.Class classtype,
XML.ObjectLoader loader)
Sets the ObjectLoader for a specified class.
|
static java.lang.String |
stripExtension(java.lang.String fileName)
Strips the extension from the specified file name.
|
public static java.lang.String NEW_LINE
public static final java.lang.String CDATA_PRE
public static final java.lang.String CDATA_POST
public static final int INDENT
public static void setLoader(java.lang.Class classtype, XML.ObjectLoader loader)
classtype
- the classloader
- the ObjectLoaderpublic static XML.ObjectLoader getLoader(java.lang.Class classtype)
classtype
- the classpublic static void setDefaultLoader(XML.ObjectLoader loader)
loader
- the ObjectLoaderpublic static java.lang.String getDataType(java.lang.Object obj)
obj
- the objectpublic static java.lang.String[] getDataTypes()
public static boolean requiresCDATA(java.lang.String text)
text
- the stringtrue
if CDATA tags are requiredpublic static java.lang.String getDTD(java.lang.String doctype)
doctype
- the doctype file name (e.g., "osp10.dtd")public static void setClassLoader(java.lang.ClassLoader loader)
loader
- the classLoaderpublic static java.lang.ClassLoader getClassLoader()
public static java.lang.String forwardSlash(java.lang.String path)
path
- the pathpublic static java.lang.String getName(java.lang.String path)
path
- the full pathpublic static java.lang.String getExtension(java.lang.String fileName)
fileName
- the file name with or without pathpublic static java.lang.String getSimpleClassName(java.lang.Class type)
type
- the classpublic static java.lang.String stripExtension(java.lang.String fileName)
fileName
- the file name with or without pathpublic static java.lang.String getPathRelativeTo(java.lang.String absolutePath, java.lang.String base)
absolutePath
- the absolute pathbase
- the absolute base directory pathpublic static java.lang.String getRelativePath(java.lang.String absolutePath)
absolutePath
- the absolute pathpublic static java.lang.String getUserDirectory()
public static java.lang.String getDirectoryPath(java.lang.String fileName)
fileName
- the full file name, including pathpublic static java.lang.String getResolvedPath(java.lang.String relativePath, java.lang.String base)
relativePath
- the relative file namebase
- the absolute base pathpublic static void createFolders(java.lang.String path)
path
- the path to construct