JIDE 3.5.15

com.jidesoft.pivot
Class AggregateTablePanePersistenceUtils

java.lang.Object
  extended by com.jidesoft.pivot.AggregateTablePanePersistenceUtils

public class AggregateTablePanePersistenceUtils
extends Object

A helper class that can support persist AggregateTablePane's layout to/from xml file.


Constructor Summary
AggregateTablePanePersistenceUtils()
           
 
Method Summary
static String getVersion(Document document)
          Gets the version of the layout file.
static String getVersion(InputStream in)
          Gets the version of the layout file.
static String getVersion(String fileName)
          Gets the version of the layout file.
static void isLayoutValid(AggregateTablePane pane, Document document)
          Checks if the layout is valid.
static void isLayoutValid(AggregateTablePane pane, InputStream in)
          Checks if the layout is valid.
static void isLayoutValid(AggregateTablePane pane, String fileName)
          Checks if the layout is valid.
static void load(AggregateTablePane pane, Document document)
          Loads the layout from xml document.
static void load(AggregateTablePane pane, Document document, PersistenceUtilsCallback.Load callback)
          Loads the layout from xml document.
static void load(AggregateTablePane pane, InputStream in)
          Loads the AggregateTablePane's layout from an input stream.
static void load(AggregateTablePane pane, InputStream in, PersistenceUtilsCallback.Load callback)
          Loads the layout from input stream.
static void load(AggregateTablePane pane, String fileName)
          Loads the layout from xml file.
static void load(AggregateTablePane pane, String fileName, PersistenceUtilsCallback.Load callback)
          Loads the layout from xml file.
static Document save(AggregateTablePane pane)
          Saves the AggregateTablePane's layout to an XML Document
static void save(AggregateTablePane pane, OutputStream out)
          Saves the AggregateTablePane's layout to an output stream.
static void save(AggregateTablePane pane, OutputStream out, PersistenceUtilsCallback.Save callback)
          Saves the AggregateTablePane's layout to an output stream.
static void save(AggregateTablePane pane, OutputStream out, PersistenceUtilsCallback.Save callback, String encoding)
          Saves the AggregateTablePane's layout to an output stream.
static Document save(AggregateTablePane pane, PersistenceUtilsCallback.Save callback)
          Saves the AggregateTablePane's layout to an XML Document
static void save(AggregateTablePane pane, String fileName)
          Saves the AggregateTablePane's layout to a file.
static void save(AggregateTablePane pane, String fileName, PersistenceUtilsCallback.Save callback)
          Saves the AggregateTablePane's layout to a file.
static void save(AggregateTablePane pane, String fileName, PersistenceUtilsCallback.Save callback, String encoding)
          Saves the AggregateTablePane's layout to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateTablePanePersistenceUtils

public AggregateTablePanePersistenceUtils()
Method Detail

save

public static void save(AggregateTablePane pane,
                        String fileName)
                 throws ParserConfigurationException,
                        IOException
Saves the AggregateTablePane's layout to a file.

Parameters:
pane - the AggregateTablePane
fileName - the file name
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
IOException - If the pathname argument is null or any IO errors happen

save

public static void save(AggregateTablePane pane,
                        OutputStream out)
                 throws ParserConfigurationException,
                        IOException
Saves the AggregateTablePane's layout to an output stream.

Parameters:
pane - the AggregateTablePane
out - the output stream
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
IOException - If the pathname argument is null or any IO errors happen

save

public static Document save(AggregateTablePane pane)
                     throws ParserConfigurationException
Saves the AggregateTablePane's layout to an XML Document

Parameters:
pane - the AggregateTablePane
Returns:
XML Document which has the AggregateTablePane's layout.
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration

save

public static void save(AggregateTablePane pane,
                        String fileName,
                        PersistenceUtilsCallback.Save callback)
                 throws ParserConfigurationException,
                        IOException
Saves the AggregateTablePane's layout to a file.

Parameters:
pane - the AggregateTablePane
fileName - the file name
callback - The callback which will be called when saving each element to the XML document.
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
IOException - If the pathname argument is null or any IO errors happen

save

public static void save(AggregateTablePane pane,
                        String fileName,
                        PersistenceUtilsCallback.Save callback,
                        String encoding)
                 throws ParserConfigurationException,
                        IOException
Saves the AggregateTablePane's layout to a file.

Parameters:
pane - the AggregateTablePane
fileName - the file name
callback - the callback which will be called when saving each element to the XML document
encoding - the encoding choice. It would be UTF-8 in default if you call the method without this parameter.
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
IOException - If the pathname argument is null or any IO errors happen

save

public static void save(AggregateTablePane pane,
                        OutputStream out,
                        PersistenceUtilsCallback.Save callback)
                 throws ParserConfigurationException,
                        IOException
Saves the AggregateTablePane's layout to an output stream.

Parameters:
pane - the AggregateTablePane
out - the output stream
callback - The callback which will be called when saving each element to the XML document.
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
IOException - If the pathname argument is null or any IO errors happen

save

public static void save(AggregateTablePane pane,
                        OutputStream out,
                        PersistenceUtilsCallback.Save callback,
                        String encoding)
                 throws ParserConfigurationException,
                        IOException
Saves the AggregateTablePane's layout to an output stream.

Parameters:
pane - the AggregateTablePane
out - the output stream
callback - The callback which will be called when saving each element to the XML document.
encoding - the encoding choice. It would be UTF-8 in default if you call the method without this parameter.
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
IOException - If the pathname argument is null or any IO errors happen

save

public static Document save(AggregateTablePane pane,
                            PersistenceUtilsCallback.Save callback)
                     throws ParserConfigurationException
Saves the AggregateTablePane's layout to an XML Document

Parameters:
pane - the AggregateTablePane
callback - The callback which will be called when saving each element to the XML document.
Returns:
XML Document which has the AggregateTablePane's layout.
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration

load

public static void load(AggregateTablePane pane,
                        InputStream in)
                 throws ParserConfigurationException,
                        SAXException,
                        IOException
Loads the AggregateTablePane's layout from an input stream.

Parameters:
pane - the AggregateTablePane
in - the input stream
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration
SAXException - if either the XML parser or the application has errors
IOException - if the pathname argument is null or any IO errors happen

load

public static void load(AggregateTablePane pane,
                        String fileName)
                 throws ParserConfigurationException,
                        SAXException,
                        IOException
Loads the layout from xml file.

Parameters:
pane - the AggregateTablePane
fileName - the layout file name.
Throws:
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 happen

load

public static void load(AggregateTablePane pane,
                        Document document)
Loads the layout from xml document.

Parameters:
pane - the AggregateTablePane
document - the XML document

load

public static void load(AggregateTablePane pane,
                        InputStream in,
                        PersistenceUtilsCallback.Load callback)
                 throws ParserConfigurationException,
                        SAXException,
                        IOException
Loads the layout from input stream.

Parameters:
pane - the AggregateTablePane
in - the input stream
callback - The callback which will be called when loading each element in the XML document.
Throws:
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 happen

load

public static void load(AggregateTablePane pane,
                        String fileName,
                        PersistenceUtilsCallback.Load callback)
                 throws ParserConfigurationException,
                        SAXException,
                        IOException
Loads the layout from xml file.

Parameters:
pane - the AggregateTablePane
fileName - the layout file name.
callback - The callback which will be called when loading each element in the XML document.
Throws:
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 happen

load

public static void load(AggregateTablePane pane,
                        Document document,
                        PersistenceUtilsCallback.Load callback)
Loads the layout from xml document.

Parameters:
pane - the AggregateTablePane
document - the XML document
callback - The callback which will be called when loading each element in the XML document.

getVersion

public static String getVersion(InputStream in)
                         throws ParserConfigurationException,
                                SAXException,
                                IOException
Gets the version of the layout file. Null is the layout file is invalid.

Parameters:
in - the InputStream
Returns:
the version.
Throws:
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 happen

getVersion

public static String getVersion(String fileName)
                         throws ParserConfigurationException,
                                SAXException,
                                IOException
Gets the version of the layout file. Null is the layout file is invalid.

Parameters:
fileName - the Document for the layout
Returns:
the version.
Throws:
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 happen

getVersion

public static String getVersion(Document document)
Gets the version of the layout file. Null is the layout file is invalid.

Parameters:
document - the Document for the layout
Returns:
the version.

isLayoutValid

public static void isLayoutValid(AggregateTablePane pane,
                                 InputStream in)
                          throws ParserConfigurationException,
                                 SAXException,
                                 IOException,
                                 IllegalArgumentException
Checks if the layout is valid.

Parameters:
pane - the aggregate table pane.
in - the input steam which is an XML layout file.
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration requested.
SAXException - if any parse error occurs.
IOException - if any IO error occurs.
IllegalArgumentException - if the layout content is invalid such as version number is missing or the field in the layout is no longer in the pivot table pane.

isLayoutValid

public static void isLayoutValid(AggregateTablePane pane,
                                 String fileName)
                          throws ParserConfigurationException,
                                 SAXException,
                                 IOException,
                                 IllegalArgumentException
Checks if the layout is valid.

Parameters:
pane - the aggregate table pane.
fileName - the file name of an XML layout file.
Throws:
ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration requested.
SAXException - if any parse error occurs.
IOException - if any IO error occurs.
IllegalArgumentException - if the layout content is invalid such as version number is missing or the field in the layout is no longer in the pivot table pane.

isLayoutValid

public static void isLayoutValid(AggregateTablePane pane,
                                 Document document)
                          throws IllegalArgumentException
Checks if the layout is valid.

Parameters:
pane - the aggregate table pane.
document - the XML Document
Throws:
IllegalArgumentException - if the layout content is invalid such as version number is missing or the field in the layout is no longer in the pivot table pane.

JIDE 3.5.15