ch.sahits.codegen.output
Class XMLStringOutput

java.lang.Object
  extended by ch.sahits.codegen.output.XMLStringOutput
All Implemented Interfaces:
IGeneralFileGenerator, IGeneralGenerator

public abstract class XMLStringOutput
extends java.lang.Object
implements IGeneralFileGenerator

Create an XML file but return a String instead of a file

Since:
1.2.0
Author:
Andi Hotz

Field Summary
protected  IOutputFileModel model
          Model that defines the setup
protected  Element root
          This is the root tag of the XML document
 
Constructor Summary
XMLStringOutput()
           
 
Method Summary
protected  void addAttribute(Element e, java.lang.String attrName, java.lang.String attrValue)
          Add an attribute to the element
protected  void addElement(Element parent, Element child)
          Add a child element
protected  void addText(Element parent, java.lang.String text)
          Add text to an element
 java.lang.String getAbsoluteOutputLoacation()
          Retrieve the absolute path to the file output location based on the initialized model
protected  Element getRoot()
          Retrieve the root element
 boolean isGeneratedOutputFile()
          This generator class IGeneralFileGenerator.generate() method returns an IFile instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.sahits.codegen.generator.IGeneralFileGenerator
generate
 
Methods inherited from interface ch.sahits.codegen.generator.IGeneralGenerator
createModel, init
 

Field Detail

model

protected IOutputFileModel model
Model that defines the setup


root

protected Element root
This is the root tag of the XML document

Constructor Detail

XMLStringOutput

public XMLStringOutput()
Method Detail

getRoot

protected final Element getRoot()
Retrieve the root element

Returns:
root element

addAttribute

protected final void addAttribute(Element e,
                                  java.lang.String attrName,
                                  java.lang.String attrValue)
Add an attribute to the element

Parameters:
e - Element to add the attribute to
attrName - name of the attribute
attrValue - value of the attribute

addElement

protected final void addElement(Element parent,
                                Element child)
Add a child element

Parameters:
parent - Element to add the child to
child - Element to add

addText

protected final void addText(Element parent,
                             java.lang.String text)
Add text to an element

Parameters:
parent - Element the text should be added to
text - to add

getAbsoluteOutputLoacation

public final java.lang.String getAbsoluteOutputLoacation()
Retrieve the absolute path to the file output location based on the initialized model

Specified by:
getAbsoluteOutputLoacation in interface IGeneralFileGenerator
Returns:
Absolute path to the output location

isGeneratedOutputFile

public final boolean isGeneratedOutputFile()
This generator class IGeneralFileGenerator.generate() method returns an IFile instance

Specified by:
isGeneratedOutputFile in interface IGeneralGenerator
Returns:
true