| 
 | org.netbeans.modules.settings/1 1.10.51 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.spi.settings.Convertor
org.netbeans.spi.settings.DOMConvertor
public abstract class DOMConvertor
DOMConvertor extends the Convertor to allow to compose output of several convertors into one xml document. For more info see Composed Content.
| Constructor Summary | |
|---|---|
| protected  | DOMConvertor(String publicID,
             String systemID,
             String rootElement)Creat a DOMConvertor | 
| Method Summary | |
|---|---|
| protected static Object | delegateRead(Element element)delegate the read operation to a convertor referenced by dtd_public_id | 
| protected static Element | delegateWrite(Document doc,
              Object obj)delegate the write operation to a convertor able to write obj | 
| protected static Lookup | findContext(Document doc)get a context associated with the document doc. | 
|  Object | read(Reader r)Read content from rand delegate toreadElement(org.w3c.dom.Element)passing parsed content as a root element of DOM document | 
| protected abstract  Object | readElement(Element element)Provide an object constructed from the element. | 
|  void | write(Writer w,
      Object inst)Write object described by DOM document filled by writeElement(org.w3c.dom.Document, org.w3c.dom.Element, java.lang.Object) | 
| protected abstract  void | writeElement(Document doc,
             Element element,
             Object obj)Fill a DOM element describing objwith attributes or subelements. | 
| Methods inherited from class org.netbeans.spi.settings.Convertor | 
|---|
| findContext, findContext, registerSaver, unregisterSaver | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
protected DOMConvertor(String publicID, String systemID, String rootElement)
publicID - public ID of DOCTYPEsystemID - system ID of DOCTYPErootElement - qualified name of root element| Method Detail | 
|---|
public final Object read(Reader r) throws IOException, ClassNotFoundException
r and delegate to readElement(org.w3c.dom.Element)
 passing parsed content as a root element of DOM document
r - stream containing stored object
IOException - if the object cannot be read
ClassNotFoundException - if the object class cannot be resolvedpublic final void write(Writer w, Object inst) throws IOException
writeElement(org.w3c.dom.Document, org.w3c.dom.Element, java.lang.Object)
w - stream into which inst is writteninst - the setting object to be written
IOException - if the object cannot be writtenprotected abstract Object readElement(Element element) throws IOException, ClassNotFoundException
element - represents a read object in a DOM document
IOException - if the object cannot be read
ClassNotFoundException - if the object class cannot be resolvedprotected abstract void writeElement(Document doc, Element element, Object obj) throws IOException, DOMException
obj with attributes or subelements.
doc - a DOM document allowing to create elements describing passed objectelement - represents a written object in a DOM documentobj - an object to convert
IOException - if the object cannot be written
DOMException - if an element construction failedprotected static final Object delegateRead(Element element) throws IOException, ClassNotFoundException
dtd_public_id
element - DOM element that should be read
IOException - if the object cannot be read
ClassNotFoundException - if the object class cannot be resolvedreadElement(org.w3c.dom.Element)protected static final Element delegateWrite(Document doc, Object obj) throws IOException, DOMException
obj.
- 
- Parameters:
- doc- a DOM document allowing to create elements describing passed object
- obj- an object to convert
- Returns:
- a DOM element representation
- Throws:
- IOException- if the object cannot be written
- DOMException- if an element construction failed
- Since:
- 1.1
- See Also:
- writeElement(org.w3c.dom.Document, org.w3c.dom.Element, java.lang.Object)
 
protected static Lookup findContext(Document doc)
doc. It can
 contain various info like a file location of the read document etc.
doc - a DOM document containing stored object
| 
 | org.netbeans.modules.settings/1 1.10.51 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||