Java XML JAXB String to Object getXmlObject(String xml, Class cls)

Here you can find the source of getXmlObject(String xml, Class cls)

Description

get XML object for the xml string.

License

Open Source License

Declaration

public static Object getXmlObject(String xml, Class cls) 

Method Source Code


//package com.java2s;
import java.io.StringReader;

import javax.xml.bind.JAXB;

public class Main {
    /**/*from w  w w. ja v a  2 s.  c  om*/
     * get XML object for the xml string.
     */
    public static Object getXmlObject(String xml, Class cls) {

        return JAXB.unmarshal(new StringReader(xml), cls);

    }
}

Related

  1. fromXml(Reader xml, Class clazz)
  2. fromXml(String responseBody, Class c)
  3. fromXml(String xml, Class clazz)
  4. fromXml(String xml, Class type)
  5. fromXML(String xml, Class valueType)
  6. stringToObject(String s, Class theclass)
  7. toObject(Class className, String strXml)
  8. toObject(String xml, Class c)
  9. toObject(String xml, Class clazz)