Java XML JAXB Unmarshaller unmarshal(final Class clazz, String json)

Here you can find the source of unmarshal(final Class clazz, String json)

Description

unmarshal

License

Open Source License

Declaration

public static final synchronized Object unmarshal(final Class clazz, String json)
            throws JAXBException, IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import com.google.gson.Gson;

import java.io.IOException;

import javax.xml.bind.JAXBException;

public class Main {
    public static final synchronized Object unmarshal(final Class clazz, String json)
            throws JAXBException, IOException {
        Gson gson = new Gson();
        return gson.fromJson(json, clazz);
    }/*from  ww  w.j a  v  a  2  s.c  om*/
}

Related

  1. unmarshal(Class clazz, Source source)
  2. unmarshal(Class clazz, String xml)
  3. unmarshal(Class clazz, String xmlInClassPath)
  4. unmarshal(Class clz, File file)
  5. unmarshal(File f)
  6. unmarshal(final String xml, Class clazz, InputStream inputSchema)
  7. unmarshal(final String xml, final Class clazz)
  8. unmarshal(InputSource inputSource, Class clazz)
  9. unmarshal(InputStream content, Class expectedType)