List of utility methods to do XML JAXB Unmarshaller
T | unmarshal(Class unmarshal Unmarshaller u = _jaxbContexts.get(clz).createUnmarshaller();
return clz.cast(u.unmarshal(file));
|
Object | unmarshal(File f) Unmarshals a file. return unmar.unmarshal(f);
|
Object | unmarshal(final Class clazz, String json) unmarshal Gson gson = new Gson(); return gson.fromJson(json, clazz); |
T | unmarshal(final String xml, Class> clazz, InputStream inputSchema) Unmarshalls the XML string given the JaxB class. try { JAXBContext ctxt = JAXBContext.newInstance(clazz); Unmarshaller u = ctxt.createUnmarshaller(); if (inputSchema != null) { if (inputSchema != null) { SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = sf.newSchema(new StreamSource(inputSchema)); u.setSchema(schema); ... |
T | unmarshal(final String xml, final Class JAXBContext.newInstance(..) is a slow operation. return (T) unmarshal(JAXBContext.newInstance(clazz), xml);
|
Object | unmarshal(InputSource inputSource, Class> clazz) Unmarshal. JAXBContext jc = JAXBContext.newInstance(clazz); Unmarshaller u = jc.createUnmarshaller(); ValidationEventCollector vec = new ValidationEventCollector(); u.setEventHandler(vec); Object o1 = u.unmarshal(inputSource); return o1; |
T | unmarshal(InputStream content, Class Unmarshal XML data from InputStream by expectedType and return the resulting content tree. return unmarshal(new StreamSource(content), expectedType); |
T | unmarshal(InputStream in, Class... boundClasses) unmarshal try { Unmarshaller u = JAXBContext.newInstance(boundClasses).createUnmarshaller(); return (T) u.unmarshal(in); } catch (Exception ex) { return null; |
T | unmarshal(InputStream inputStream, Class Unmarshal XML data from the specified file and return the resulting object. JAXBContext jaxbContext = JAXBContext.newInstance(entityClass);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
T document = (T) jaxbUnmarshaller.unmarshal(inputStream);
return document;
|
T | unmarshal(InputStream inputStream, Class Attempts to unmarshal an XML document from an InputStream. JAXBContext jaxbContext = JAXBContext.newInstance(type.getPackage().getName()); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); @SuppressWarnings("unchecked") JAXBElement<T> jaxbElement = (JAXBElement<T>) unmarshaller.unmarshal(inputStream); return jaxbElement.getValue(); |