public abstract class DOMConvertor extends Convertor
| Modifier | Constructor | Description |
|---|---|---|
protected |
DOMConvertor(java.lang.String publicID,
java.lang.String systemID,
java.lang.String rootElement) |
Creat a DOMConvertor
|
| Modifier and Type | Method | Description |
|---|---|---|
protected static java.lang.Object |
delegateRead(org.w3c.dom.Element element) |
delegate the read operation to a convertor referenced by
dtd_public_id |
protected static org.w3c.dom.Element |
delegateWrite(org.w3c.dom.Document doc,
java.lang.Object obj) |
delegate the write operation to a convertor able to write
obj |
protected static org.openide.util.Lookup |
findContext(org.w3c.dom.Document doc) |
get a context associated with the document
doc. |
java.lang.Object |
read(java.io.Reader r) |
Read content from
r and delegate to readElement(org.w3c.dom.Element)
passing parsed content as a root element of DOM document |
protected abstract java.lang.Object |
readElement(org.w3c.dom.Element element) |
Provide an object constructed from the element.
|
void |
write(java.io.Writer w,
java.lang.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(org.w3c.dom.Document doc,
org.w3c.dom.Element element,
java.lang.Object obj) |
Fill a DOM element describing
obj with attributes or subelements. |
findContext, findContext, registerSaver, unregisterSaverprotected DOMConvertor(java.lang.String publicID,
java.lang.String systemID,
java.lang.String rootElement)
publicID - public ID of DOCTYPEsystemID - system ID of DOCTYPErootElement - qualified name of root elementpublic final java.lang.Object read(java.io.Reader r)
throws java.io.IOException,
java.lang.ClassNotFoundException
r and delegate to readElement(org.w3c.dom.Element)
passing parsed content as a root element of DOM documentpublic final void write(java.io.Writer w,
java.lang.Object inst)
throws java.io.IOException
writeElement(org.w3c.dom.Document, org.w3c.dom.Element, java.lang.Object)protected abstract java.lang.Object readElement(org.w3c.dom.Element element)
throws java.io.IOException,
java.lang.ClassNotFoundException
element - represents a read object in a DOM documentjava.io.IOException - if the object cannot be readjava.lang.ClassNotFoundException - if the object class cannot be resolvedprotected abstract void writeElement(org.w3c.dom.Document doc,
org.w3c.dom.Element element,
java.lang.Object obj)
throws java.io.IOException,
org.w3c.dom.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 convertjava.io.IOException - if the object cannot be writtenorg.w3c.dom.DOMException - if an element construction failedprotected static final java.lang.Object delegateRead(org.w3c.dom.Element element)
throws java.io.IOException,
java.lang.ClassNotFoundException
dtd_public_idelement - DOM element that should be readjava.io.IOException - if the object cannot be readjava.lang.ClassNotFoundException - if the object class cannot be resolvedreadElement(org.w3c.dom.Element)protected static final org.w3c.dom.Element delegateWrite(org.w3c.dom.Document doc,
java.lang.Object obj)
throws java.io.IOException,
org.w3c.dom.DOMException
obj.doc - a DOM document allowing to create elements describing passed objectobj - an object to convertjava.io.IOException - if the object cannot be writtenorg.w3c.dom.DOMException - if an element construction failedwriteElement(org.w3c.dom.Document, org.w3c.dom.Element, java.lang.Object)protected static org.openide.util.Lookup findContext(org.w3c.dom.Document doc)
doc. It can
contain various info like a file location of the read document etc.doc - a DOM document containing stored objectBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.