Java XML JAXB Unmarshaller unmarshall(String xml, Class... classesToBeBound)

Here you can find the source of unmarshall(String xml, Class... classesToBeBound)

Description

unmarshall

License

Open Source License

Declaration

public static Object unmarshall(String xml, Class... classesToBeBound)
            throws JAXBException 

Method Source Code

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

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import java.io.StringReader;

public class Main {
    public static Object unmarshall(String xml, Class... classesToBeBound)
            throws JAXBException {

        JAXBContext context = JAXBContext.newInstance(classesToBeBound);
        Unmarshaller unmarshaller = context.createUnmarshaller();
        StringReader reader = new StringReader(xml);

        return unmarshaller.unmarshal(reader);
    }//from w w  w .j a  v a2 s  . co m
}

Related

  1. unmarshall(InputStream is, Class clz)
  2. unmarshall(InputStream toUnmarshall, Class clazz)
  3. unmarshall(JAXBContext c, Element e)
  4. unmarshall(String cntxtPkg, InputStream in)
  5. unmarshall(String file, Class desiredClass, Class context)
  6. unmarshall(String xml, Class clazz)
  7. unmarshall(String xml, URL schemaURL, Class... classesToBeBound)
  8. unmarshaller(Class entityType, InputStream in)
  9. unmarshaller(String xml, Class T)