com.dyuproject.util.format
Class XMLConverter

java.lang.Object
  extended by com.dyuproject.util.format.FormatConverter
      extended by com.dyuproject.util.format.XMLConverter

public class XMLConverter
extends FormatConverter

Converts a bean to a string in XML format.

Author:
David Yu

Nested Class Summary
 
Nested classes/interfaces inherited from class com.dyuproject.util.format.FormatConverter
FormatConverter.Bean, FormatConverter.Builder
 
Field Summary
protected static String ATTR_SUFFIX
           
protected static String DATA_NULL
           
protected static String HEADER
           
protected static String LIST_P
           
protected static String LIST_S
           
protected static String OBJECT_P
           
protected static String OBJECT_S
           
protected static String OBJECT_WITH_CLASS
           
protected static String PROP_P
           
protected static String PROP_S
           
protected static String ROOT_P
           
protected static String ROOT_S
           
protected static String VALUE_P
           
protected static String VALUE_S
           
 
Fields inherited from class com.dyuproject.util.format.FormatConverter
CLASS, EMPTY_ARRAY, JSON, NULL, TEXT_HTML, TEXT_JAVASCRIPT, TEXT_PLAIN, TEXT_XML, XML
 
Method Summary
 StringBuilder getBuffer(Collection<Object> c, String callback)
           
 StringBuilder getBuffer(FormatConverter.Bean bean, String callback)
           
 StringBuilder getBuffer(Map<String,Object>[] m, String callback)
           
 StringBuilder getBuffer(Map<String,Object> m, String callback)
           
 StringBuilder getBuffer(Object[] objs, String callback)
           
 StringBuilder getBuffer(Object obj, String callback)
           
 String getContentType()
           
 String getFormat()
           
static XMLConverter getInstance()
           
 String toString(Collection<Object> obj, String callback)
           
 String toString(FormatConverter.Bean bean, String callback)
           
 String toString(Map<String,Object>[] m, String callback)
           
 String toString(Map<String,Object> m, String callback)
           
 String toString(Object[] objs, String callback)
           
 String toString(Object obj, String callback)
           
 
Methods inherited from class com.dyuproject.util.format.FormatConverter
getConverter, getDefault, getMethods, getOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_SUFFIX

protected static final String ATTR_SUFFIX
See Also:
Constant Field Values

DATA_NULL

protected static final String DATA_NULL
See Also:
Constant Field Values

HEADER

protected static final String HEADER
See Also:
Constant Field Values

ROOT_P

protected static final String ROOT_P
See Also:
Constant Field Values

ROOT_S

protected static final String ROOT_S
See Also:
Constant Field Values

LIST_P

protected static final String LIST_P
See Also:
Constant Field Values

LIST_S

protected static final String LIST_S
See Also:
Constant Field Values

VALUE_P

protected static final String VALUE_P
See Also:
Constant Field Values

VALUE_S

protected static final String VALUE_S
See Also:
Constant Field Values

OBJECT_P

protected static final String OBJECT_P
See Also:
Constant Field Values

OBJECT_S

protected static final String OBJECT_S
See Also:
Constant Field Values

OBJECT_WITH_CLASS

protected static final String OBJECT_WITH_CLASS
See Also:
Constant Field Values

PROP_P

protected static final String PROP_P
See Also:
Constant Field Values

PROP_S

protected static final String PROP_S
See Also:
Constant Field Values
Method Detail

getInstance

public static XMLConverter getInstance()

getContentType

public String getContentType()
Specified by:
getContentType in class FormatConverter

getFormat

public String getFormat()
Specified by:
getFormat in class FormatConverter

toString

public String toString(Object obj,
                       String callback)
Specified by:
toString in class FormatConverter

toString

public String toString(Object[] objs,
                       String callback)
Specified by:
toString in class FormatConverter

toString

public String toString(Collection<Object> obj,
                       String callback)
Specified by:
toString in class FormatConverter

toString

public String toString(Map<String,Object> m,
                       String callback)
Specified by:
toString in class FormatConverter

toString

public String toString(FormatConverter.Bean bean,
                       String callback)
Specified by:
toString in class FormatConverter

toString

public String toString(Map<String,Object>[] m,
                       String callback)
Specified by:
toString in class FormatConverter

getBuffer

public StringBuilder getBuffer(Object obj,
                               String callback)
Specified by:
getBuffer in class FormatConverter

getBuffer

public StringBuilder getBuffer(Object[] objs,
                               String callback)
Specified by:
getBuffer in class FormatConverter

getBuffer

public StringBuilder getBuffer(Collection<Object> c,
                               String callback)
Specified by:
getBuffer in class FormatConverter

getBuffer

public StringBuilder getBuffer(Map<String,Object> m,
                               String callback)
Specified by:
getBuffer in class FormatConverter

getBuffer

public StringBuilder getBuffer(FormatConverter.Bean bean,
                               String callback)
Specified by:
getBuffer in class FormatConverter

getBuffer

public StringBuilder getBuffer(Map<String,Object>[] m,
                               String callback)
Specified by:
getBuffer in class FormatConverter


Copyright © 2013. All Rights Reserved.