|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.controls.XML
public class XML
This defines the ObjectLoader interface and static methods for managing and accessing ObjectLoader implementations.
Nested Class Summary | |
---|---|
static interface |
XML.ObjectLoader
This defines methods for moving xml data between an XMLControl and a corresponding Java object. |
Field Summary | |
---|---|
static java.lang.String |
CDATA_POST
|
static java.lang.String |
CDATA_PRE
|
static int |
INDENT
|
static java.lang.String |
NEW_LINE
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Method Detail |
---|
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 class
public static void setDefaultLoader(XML.ObjectLoader loader)
loader
- the ObjectLoaderpublic static java.lang.String getDataType(java.lang.Object obj)
obj
- the object
public static java.lang.String[] getDataTypes()
public static boolean requiresCDATA(java.lang.String text)
text
- the string
true
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 path
public static java.lang.String getName(java.lang.String path)
path
- the full path
public static java.lang.String getExtension(java.lang.String fileName)
fileName
- the file name with or without path
public static java.lang.String getSimpleClassName(java.lang.Class<?> type)
type
- the class
public static java.lang.String stripExtension(java.lang.String fileName)
fileName
- the file name with or without path
public static java.lang.String getPathRelativeTo(java.lang.String absolutePath, java.lang.String base)
absolutePath
- the absolute pathbase
- the absolute base directory path
public static java.lang.String getRelativePath(java.lang.String absolutePath)
absolutePath
- the absolute path
public static java.lang.String getUserDirectory()
public static java.lang.String getDirectoryPath(java.lang.String fileName)
fileName
- the full file name, including path
public static java.lang.String getResolvedPath(java.lang.String relativePath, java.lang.String base)
relativePath
- the relative file namebase
- the absolute base path
public static void createFolders(java.lang.String path)
path
- the path to construct
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |