org.openptk.structure
Class XmlConverter

java.lang.Object
  extended by org.openptk.structure.Converter
      extended by org.openptk.structure.XmlConverter
All Implemented Interfaces:
ConverterIF

public class XmlConverter
extends Converter

This class supports the conversion of StructureIF data TO and FROM XML. Nested data is presented using standard XML syntax.

Author:
Scott Fehrman, Sun Microsystems, Inc.

Field Summary
 
Fields inherited from class org.openptk.structure.Converter
GT, GTE, KEYVALUE, LT, LTE, NEWLINE, PAD, QUOTE, SEPARATOR
 
Fields inherited from interface org.openptk.structure.ConverterIF
PROP_CHILDREN, PROP_NAMEVALUE, PROP_VALUE, VALUE_CHILDREN_DISCRETE, VALUE_CHILDREN_LIST, VALUE_NAMEVALUE_COLLAPSED, VALUE_NAMEVALUE_EXPANDED, VALUE_VALUE_MULTI, VALUE_VALUE_SINGLE
 
Constructor Summary
XmlConverter()
          Create a new XmlConverter object.
 
Method Summary
 StructureIF decode(java.lang.String data)
          Convert the XML syntax (String) into StructureIF data.
 java.lang.String encode(StructureIF struct)
          Convert the Structure data into a XML (syntax) String.
 
Methods inherited from class org.openptk.structure.Converter
getStructInfo, getStructInfoIds, getStructProperty, getType, handleError, pad, setStructInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlConverter

public XmlConverter()
Create a new XmlConverter object.

Method Detail

decode

public final StructureIF decode(java.lang.String data)
                         throws ConverterException
Convert the XML syntax (String) into StructureIF data.

Specified by:
decode in interface ConverterIF
Overrides:
decode in class Converter
Parameters:
data - XML representation of the data
Returns:
StructureIF data
Throws:
ConverterException

encode

public final java.lang.String encode(StructureIF struct)
                              throws ConverterException
Convert the Structure data into a XML (syntax) String.

Specified by:
encode in interface ConverterIF
Overrides:
encode in class Converter
Parameters:
struct - StructureIF of data
Returns:
String XML representation of the data
Throws:
ConverterException


View/submit a bug or feature

For further API reference and developer documentation, see www.openptk.org. That documentation contains more detailed, developer-targeted descriptions, definitions of terms, workarounds, and working code examples.

Copyright (C) 2008-2012, Project OpenPTK. All Rights Reserved