|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.taursys.dom.DOM_1_20000929_DocumentAdapter
DocumentAdapter for DOM version 1 09/29/2000
Constructor Summary | |
DOM_1_20000929_DocumentAdapter(java.lang.Object newDoc)
Constructs a new DOM_1_20000929_DocumentAdapter for given document. |
Method Summary | |
protected AbstractWriter |
createDefaultWriter()
Creates the default AbstractWriter for this subcomponent. |
static org.w3c.dom.Text |
findFirstTextNode(org.w3c.dom.Element ele)
Returns first TEXT_NODE under given element else returns null |
static java.lang.String |
getAttribute(java.lang.String attributeName,
org.w3c.dom.Node node)
Extracts the named attribute value from the node. |
org.w3c.dom.Document |
getDocument()
Returns the Document/adaptee of this DocumentAdapter |
org.w3c.dom.Element |
getElementById(java.lang.String elementId)
Returns the Element for the given mapped identifier else null if not found. |
static java.lang.String |
getElementText(org.w3c.dom.Element element)
Get the text from the given Element's text node. |
java.util.Hashtable |
getIdentifierMap()
Returns a Hashtable of id's and their cooresponding Elements for this document. |
AbstractWriter |
getXMLWriter()
Get the AbstractWriter used to render this document to a stream or writer. |
static boolean |
hasChildElements(org.w3c.dom.Element parent)
Indicates whether or not the given Element has child Elements. |
void |
importContents(DocumentAdapter sourceAdapter,
java.lang.String sourceId,
java.lang.String destId)
Import the contents from the given sourceAdapter at the sourceId and replace the contents of the destId in this DocumentAdapter. |
protected void |
mapIdentifiers(org.w3c.dom.Node parent)
Recursively maps all the identifiers for the given document starting at the given node |
void |
removeAttribute(java.lang.String elementId,
java.lang.String attribute)
Removes the given attribute from the element identified by the given id Does nothing if the id is not found. |
void |
setAttributeText(java.lang.String elementId,
java.lang.String attribute,
java.lang.String value)
Stores given value as a text attribute of the element identified by the given id Does nothing if the id is not found. |
void |
setDocument(org.w3c.dom.Document newDoc)
Sets the Document/adaptee for this DocumentAdapter. |
static void |
setElementText(org.w3c.dom.Element element,
java.lang.String value)
Stores the given value as a text node of the given element. |
void |
setElementText(java.lang.String elementId,
java.lang.String value)
Sets the Text of the Element indicated by the given id to the given value. |
void |
setXMLWriter(AbstractWriter newXMLWriter)
Set the AbstractWriter used to render this document to a stream or writer. |
void |
write(java.io.OutputStream stream)
Write the document to the given OutputStream. |
void |
write(java.io.Writer writer)
Write the document to the given Writer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DOM_1_20000929_DocumentAdapter(java.lang.Object newDoc)
Method Detail |
protected AbstractWriter createDefaultWriter()
protected void mapIdentifiers(org.w3c.dom.Node parent)
public void write(java.io.OutputStream stream)
write
in interface DocumentAdapter
stream
- to render the document topublic void write(java.io.Writer writer)
write
in interface DocumentAdapter
writer
- to render the document topublic void setXMLWriter(AbstractWriter newXMLWriter)
newXMLWriter
- the AbstractWriter used to render this documentpublic AbstractWriter getXMLWriter()
public void setElementText(java.lang.String elementId, java.lang.String value)
setElementText
in interface DocumentAdapter
public void setAttributeText(java.lang.String elementId, java.lang.String attribute, java.lang.String value)
setAttributeText
in interface DocumentAdapter
public void removeAttribute(java.lang.String elementId, java.lang.String attribute)
removeAttribute
in interface DocumentAdapter
public void importContents(DocumentAdapter sourceAdapter, java.lang.String sourceId, java.lang.String destId) throws DocumentAdapterException
importContents
in interface DocumentAdapter
sourceAdapter
- the source DocumentAdapter for the importsourceId
- the parent element to import contents fromdestId
- the parent element to import the contents to
java.lang.IllegalArgumentException
- if any arguments are null
DocumentAdapterException
- if sourceId or destId is invalidpublic org.w3c.dom.Document getDocument()
getDocument
in interface DocumentAdapter
public void setDocument(org.w3c.dom.Document newDoc)
public org.w3c.dom.Element getElementById(java.lang.String elementId)
getElementById
in interface DocumentAdapter
public java.util.Hashtable getIdentifierMap()
getIdentifierMap
in interface DocumentAdapter
public static java.lang.String getAttribute(java.lang.String attributeName, org.w3c.dom.Node node)
public static void setElementText(org.w3c.dom.Element element, java.lang.String value)
public static java.lang.String getElementText(org.w3c.dom.Element element)
element
- the element to get the text from
public static org.w3c.dom.Text findFirstTextNode(org.w3c.dom.Element ele)
public static boolean hasChildElements(org.w3c.dom.Element parent)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |