Java XML JAXB String to Object converyToJavaBean(String xml, Class clazz)

Here you can find the source of converyToJavaBean(String xml, Class clazz)

Description

convery To Java Bean

License

Open Source License

Declaration

public static <T> T converyToJavaBean(String xml, Class<T> clazz) 

Method Source Code


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

import javax.xml.bind.JAXB;

public class Main {

    public static <T> T converyToJavaBean(String xml, Class<T> clazz) {
        T t = (T) JAXB.unmarshal(new StringReader(xml), clazz);
        return t;
    }/*from w w  w  . j a  v a  2  s  .c o m*/
}

Related

  1. convertXmlFileToObject(Class clazz, String xmlPath)
  2. convertXmlToObj(Class clazz, String xmlStr)
  3. convertXMLToObject(byte[] data, Class clazz)
  4. converyToJavaBean(String xml, Class c)
  5. converyToJavaBean(String xml, Class c)
  6. createObject(String xml, Object type)
  7. fromFile(Class jaxbClass, String fileName)
  8. fromStream(Class jaxbClass, InputStream is)
  9. fromStringToObject(String xmlString, Class xmlObjClass)