context.arch.comm.language
Class XMLEncoder

java.lang.Object
  |
  +--context.arch.comm.language.XMLEncoder

public class XMLEncoder
extends java.lang.Object
implements EncoderInterface


Field Summary
static java.lang.String LANGUAGE
          Language used to encode
 
Constructor Summary
XMLEncoder()
          Constructor for XMLEncoder
 
Method Summary
 void addElement(DataObject elt)
          Method to add XML element
 java.lang.String beginTag(java.lang.String tag)
          Method to start XML element - creates opening tag
 java.lang.String beginTag(java.lang.String tag, java.lang.String attributes)
          Method to start XML element - creates opening tag and sets attributes
 java.lang.String encodeData(DataObject data)
          Method used to encode data
 java.lang.String endTag(java.lang.String tag)
          Method to end XML element - creates closing tag
 java.lang.String getClassName()
          Returns name of class used to encode XML
 java.lang.String getLanguage()
          Returns language used to encode XML
 java.lang.String getXML()
          Returns XML encoding as a string
 java.lang.String singleTag(java.lang.String tag)
          Method to add single XML tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LANGUAGE

public static final java.lang.String LANGUAGE
Language used to encode
Constructor Detail

XMLEncoder

public XMLEncoder()
Constructor for XMLEncoder
Method Detail

encodeData

public java.lang.String encodeData(DataObject data)
                            throws EncodeException
Method used to encode data
Specified by:
encodeData in interface EncoderInterface
Parameters:
data - Data to be encoded
Throws:
EncodeException - if the data can't be encoded
See Also:
addElement(context.arch.comm.DataObject), getXML()

beginTag

public java.lang.String beginTag(java.lang.String tag)
Method to start XML element - creates opening tag
Parameters:
tag - XML element being started

beginTag

public java.lang.String beginTag(java.lang.String tag,
                                 java.lang.String attributes)
Method to start XML element - creates opening tag and sets attributes
Parameters:
tag - XML element being started
attributes - attributes for XML element

singleTag

public java.lang.String singleTag(java.lang.String tag)
Method to add single XML tag
Parameters:
tag - single XML element

endTag

public java.lang.String endTag(java.lang.String tag)
Method to end XML element - creates closing tag
Parameters:
tag - XML element being closed

addElement

public void addElement(DataObject elt)
                throws EncodeException
Method to add XML element
Parameters:
elt - DataObject element being added
Throws:
EncodeException - if the element can't be added

getXML

public java.lang.String getXML()
Returns XML encoding as a string
Returns:
XML encoding

getLanguage

public java.lang.String getLanguage()
Returns language used to encode XML
Specified by:
getLanguage in interface EncoderInterface
Returns:
language used to encode XML
See Also:
LANGUAGE

getClassName

public java.lang.String getClassName()
Returns name of class used to encode XML
Specified by:
getClassName in interface EncoderInterface
Returns:
name of class used to encode XML