|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.swing.PersistenceUtils
public class PersistenceUtils
Field Summary | |
---|---|
static String |
ATTRIBUTE_VERSION
Version attribute for every layout persistence utility class. |
static String |
NODE_COMPONENT
Component node for every layout persistence utility class. |
Constructor Summary | |
---|---|
PersistenceUtils()
|
Method Summary | |
---|---|
static byte[] |
bufferStreamToArray(InputStream stream)
Reads the input stream into a byte array. |
static String |
getDefaultXmlEncoding()
Get default XML encoding type. |
static String |
getDefaultXmlVersion()
Get default XML encoding version. |
static Document |
getDocument(InputStream in)
Get Document from the input stream. |
static Document |
getDocument(String fileName)
Get Document from the file. |
static String |
getVersion(Document document)
Get version from the document. |
static String |
intArrayToString(int[] indices)
Translate an Integer array to a string in a document. |
static boolean |
isXmlFormat(byte[] byteArray)
Checks if the string inside the byte array is in XML format. |
static void |
saveXMLDocumentToFile(Document document,
String fileName,
String encoding)
Save XML document to designated file. |
static void |
saveXMLDocumentToStream(Document document,
OutputStream out,
String encoding)
Save XML document to designated output stream. |
static void |
setDefaultXmlEncoding(String defaultXmlEncoding)
Set default XML encoding type. |
static void |
setDefaultXmlVersion(String defaultXmlVersion)
Set default XML encoding version. |
static int[] |
stringToIntArray(String s)
Translate string in a document to an Integer array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NODE_COMPONENT
public static final String ATTRIBUTE_VERSION
Constructor Detail |
---|
public PersistenceUtils()
Method Detail |
---|
public static void saveXMLDocumentToFile(Document document, String fileName, String encoding) throws IOException
document
- the XML ready to be savedfileName
- the file name to be saved toencoding
- the encoding type
IOException
- possibly IO exceptions during file writing.public static void saveXMLDocumentToStream(Document document, OutputStream out, String encoding) throws IOException
document
- the XML ready to be savedout
- the output stream to be saved toencoding
- the encoding type
IOException
- possibly IO exceptions during stream output.public static String getDefaultXmlEncoding()
public static void setDefaultXmlEncoding(String defaultXmlEncoding)
defaultXmlEncoding
- the default XML encodingpublic static String getDefaultXmlVersion()
public static void setDefaultXmlVersion(String defaultXmlVersion)
defaultXmlVersion
- the default XML versionpublic static Document getDocument(InputStream in) throws ParserConfigurationException, SAXException, IOException
in
- the input stream
ParserConfigurationException
- if a DocumentBuilder cannot be created which satisfies the configuration
requested.
SAXException
- If any parse errors occur.
IOException
- If the pathname argument is null or any IO errors happenpublic static Document getDocument(String fileName) throws ParserConfigurationException, SAXException, IOException
fileName
- the file name
ParserConfigurationException
- if a DocumentBuilder cannot be created which satisfies the configuration
requested.
SAXException
- If any parse errors occur.
IOException
- If the pathname argument is null or any IO errors happenpublic static String getVersion(Document document)
document
- the document
public static int[] stringToIntArray(String s)
s
- the string
public static String intArrayToString(int[] indices)
indices
- the Integer array
public static boolean isXmlFormat(byte[] byteArray)
byteArray
- the byte array
public static byte[] bufferStreamToArray(InputStream stream) throws IOException
stream
- the input stream
IOException
- if there is any IO error
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |