JGAP

org.jgap.data
Class DocumentBuilderBase

java.lang.Object
  extended by org.jgap.data.DocumentBuilderBase
Direct Known Subclasses:
XMLDocumentBuilder

public abstract class DocumentBuilderBase
extends java.lang.Object


Constructor Summary
DocumentBuilderBase()
           
 
Method Summary
 java.lang.Object buildDocument(IDataCreators a_dataholder, java.lang.Object a_document)
          Builds a document from the given input (input data + existing document).
protected abstract  java.lang.Object createElement(java.lang.Object a_document, java.lang.Object a_element, java.lang.String a_tagName)
          Creates an element with help for a given document.
protected abstract  java.lang.Object documentAppendChild(java.lang.Object a_document, java.lang.Object a_element)
          Append a child to a given document.
protected abstract  java.lang.Object elementAppendChild(java.lang.Object a_rootElement, java.lang.Object a_childElement)
          Append a child to a given element.
protected abstract  void setAttribute(java.lang.Object a_element, java.lang.String a_key, java.lang.String a_value)
          Sets an attribute for a given Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentBuilderBase

public DocumentBuilderBase()
Method Detail

buildDocument

public java.lang.Object buildDocument(IDataCreators a_dataholder,
                                      java.lang.Object a_document)
                               throws java.lang.Exception
Builds a document from the given input (input data + existing document).

Parameters:
a_dataholder - the input structure holding the data to be represented as a generic document
a_document - the document to put the elements in
Returns:
the document built up by adding elements
Throws:
java.lang.Exception
Since:
2.0

documentAppendChild

protected abstract java.lang.Object documentAppendChild(java.lang.Object a_document,
                                                        java.lang.Object a_element)
Append a child to a given document.

Parameters:
a_document - to append element on (e.g. org.w3c.dom.Document)
a_element - to append to document (e.g. org.w3c.com.Element)
Returns:
a_document with appended element (e.g. org.w3c.dom.Document)
Since:
2.0

elementAppendChild

protected abstract java.lang.Object elementAppendChild(java.lang.Object a_rootElement,
                                                       java.lang.Object a_childElement)
Append a child to a given element.

Parameters:
a_rootElement - to append childElement on (e.g. org.w3c.com.Element)
a_childElement - to append to rootElement (e.g. org.w3c.com.Element)
Returns:
rootElement with appended childElement (e.g. org.w3c.com.Element)
Since:
2.0

createElement

protected abstract java.lang.Object createElement(java.lang.Object a_document,
                                                  java.lang.Object a_element,
                                                  java.lang.String a_tagName)
Creates an element with help for a given document.

Parameters:
a_document - could be used as factory to create the element with
a_element - null or existing element as template
a_tagName - name of tag to create for the element
Returns:
created element
Since:
2.0

setAttribute

protected abstract void setAttribute(java.lang.Object a_element,
                                     java.lang.String a_key,
                                     java.lang.String a_value)
Sets an attribute for a given Element.

Parameters:
a_element - the Element to set an attribute for (e.g. org.w3c.com.Element)
a_key - the key of the attribute
a_value - the value of the attribute
Since:
2.0

JGAP