|
org.netbeans.modules.convertor/1 1.3 | |||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
ConvertorDescriptor | Convertor descriptor describes basic capability of the convertor, that is the XML namespace and element name which the convertor is capable to read, and (optional) class name which instances the convertor is capable to persist. |
Convertors | Main API class with methods allowing conversion of object to namespace aware XML fragment and recreation of object from that fragment. |
Exception Summary | |
---|---|
ConvertorException | Unchecked exception thrown when convertor does not exist for the requested read or write operation or when there is general runtime error during the conversion. |
The Convertor API allows to convertor object to namespace aware XML fragment and vice versa.
boolean canWrite = Convertors.canWrite(anObject);
OutputStream os = new FileOutputStream("somefilename.xml");
try {
Convertors.write(os,
anObject);
} finally {
os.close();
}
InputStream is = new FileInputStream("somefilename.xml");
try {
theObject
= Convertors.read(is);
} catch (SAXException ex) {
// file is not valid XML document.
// notify user and/or ignore file.
} catch (IOException ex) {
// file cannot be read or there is no convertor for root element
// notify user and/or ignore file.
} finally {
is.close();
}
|
org.netbeans.modules.convertor/1 1.3 | |||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |