xelem.3.0

nl.fountain.xelem.excel
Class AbstractXLElement

java.lang.Object
  extended by nl.fountain.xelem.excel.AbstractXLElement
All Implemented Interfaces:
XLElement
Direct Known Subclasses:
ODocumentProperties, SSCell, SSColumn, SSComment, SSNamedRange, SSRow, SSTable, SSWorksheet, XAutoFilter, XExcelWorkbook, XLWorkbook, XPane, XWorksheetOptions

public abstract class AbstractXLElement
extends Object
implements XLElement

An abstract implementation of an XLElement.


Field Summary
 
Fields inherited from interface nl.fountain.xelem.excel.XLElement
PREFIX_HTML, PREFIX_O, PREFIX_SS, PREFIX_X, XMLNS, XMLNS_HTML, XMLNS_O, XMLNS_SS, XMLNS_X
 
Constructor Summary
protected AbstractXLElement()
           
 
Method Summary
 void addElementComment(String comment)
          Add a comment to this XLElement.
protected  Element assemble(Document doc, GIO gio)
          Creates an Element with the tag-name, namespace and prefix suitable for the calling XLElement-implementation.
protected  Attr createAttributeNS(Document doc, String qName, int i)
          Creates an Attr with the given qName as it's qualified name and the given value of i as it's value.
protected  Attr createAttributeNS(Document doc, String qName, String value)
          Creates an Attr with the given qName as it's qualified name and the given value as it's value.
protected  Element createElementNS(Document doc, String qName)
          Creates an Element with the given qName as it's qualified name.
protected  Element createElementNS(Document doc, String qName, boolean b)
          Creates an Element with the given qName as it's qualified name and the given value of b appended to it as a Text, translated as "True" or "False".
protected  Element createElementNS(Document doc, String qName, int i)
          Creates an Element with the given qName as it's qualified name and the given value of i appended to it as a Text.
protected  Element createElementNS(Document doc, String qName, String value)
          Creates an Element with the given qName as it's qualified name and the given value appended to it as a Text.
 List<String> getElementComments()
          Gets the list of added comments.
 void setAttributes(Attributes attrs)
          Does effectively nothing.
 void setChildElement(String localName, String content)
          Does effectively nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.fountain.xelem.excel.XLElement
assemble, getNameSpace, getPrefix, getTagName
 

Constructor Detail

AbstractXLElement

protected AbstractXLElement()
Method Detail

addElementComment

public void addElementComment(String comment)
Add a comment to this XLElement. Whether the comment will be printed in the xml produced during assembly, depends on the setting of the Workbook's Workbook.setPrintElementComments(boolean)-method.

Specified by:
addElementComment in interface XLElement
Parameters:
comment - the comment to be added.
See Also:
Workbook.setPrintElementComments(boolean print)

getElementComments

public List<String> getElementComments()
Gets the list of added comments.

Specified by:
getElementComments in interface XLElement
Returns:
a list of Strings.

setAttributes

public void setAttributes(Attributes attrs)
Does effectively nothing.

Specified by:
setAttributes in interface XLElement
Parameters:
attrs - the attributes found on the element

setChildElement

public void setChildElement(String localName,
                            String content)
Does effectively nothing.

Specified by:
setChildElement in interface XLElement
Parameters:
localName - the local name of the child
content - the content of the child

assemble

protected Element assemble(Document doc,
                           GIO gio)
Creates an Element with the tag-name, namespace and prefix suitable for the calling XLElement-implementation. If comments were set on the calling XLElement-subclass and comments should be printed according to the gio, these comments are appended to the returned element.

Parameters:
doc - the enveloping Document
gio - a global information object
Returns:
an Element suitable for the calling XLElement-implementation.

createElementNS

protected Element createElementNS(Document doc,
                                  String qName)
Creates an Element with the given qName as it's qualified name. Namespace and prefix of the returned element are the same as those of the calling AbstractXLElement-subclass.

Parameters:
doc - the enveloping Document
qName - the qualified name of the newly created element.
Returns:
a newly created element.

createElementNS

protected Element createElementNS(Document doc,
                                  String qName,
                                  String value)
Creates an Element with the given qName as it's qualified name and the given value appended to it as a Text. Namespace and prefix of the returned element are the same as those of the calling AbstractXLElement-subclass.

Parameters:
doc - the enveloping Document.
qName - the qualified name of the newly created element.
value - the data for the Node.
Returns:
a newly created element.

createElementNS

protected Element createElementNS(Document doc,
                                  String qName,
                                  int i)
Creates an Element with the given qName as it's qualified name and the given value of i appended to it as a Text. Namespace and prefix of the returned element are the same as those of the calling AbstractXLElement-subclass.

Parameters:
doc - the enveloping Document.
qName - the qualified name of the newly created element.
i - the data for the Node.
Returns:
a newly created element.

createElementNS

protected Element createElementNS(Document doc,
                                  String qName,
                                  boolean b)
Creates an Element with the given qName as it's qualified name and the given value of b appended to it as a Text, translated as "True" or "False". Namespace and prefix of the returned element are the same as those of the calling AbstractXLElement-subclass.

Parameters:
doc - the enveloping Document.
qName - the qualified name of the newly created element.
b - the data for the Node.
Returns:
a newly created element.

createAttributeNS

protected Attr createAttributeNS(Document doc,
                                 String qName,
                                 int i)
Creates an Attr with the given qName as it's qualified name and the given value of i as it's value. Namespace and prefix of the returned attribute are the same as those of the calling AbstractXLElement-subclass.

Parameters:
doc - the enveloping Document.
qName - the qualified name of the newly created attribute.
i - the value of the attribute.
Returns:
a newly created attribute.

createAttributeNS

protected Attr createAttributeNS(Document doc,
                                 String qName,
                                 String value)
Creates an Attr with the given qName as it's qualified name and the given value as it's value. Namespace and prefix of the returned attribute are the same as those of the calling AbstractXLElement-subclass.

Parameters:
doc - the enveloping Document.
qName - the qualified name of the newly created attribute.
value - the value of the attribute.
Returns:
a newly created attribute.

xelem.3.0