List of utility methods to do XML JAXB Unmarshaller
T | unmarshall(String file, Class unmarshall JAXBContext ctx = JAXBContext.newInstance(context); Unmarshaller unMarshaller = ctx.createUnmarshaller(); JAXBElement<T> object = (JAXBElement<T>) unMarshaller.unmarshal(new File(file)); return object.getValue(); |
Object | unmarshall(String xml, Class... classesToBeBound) unmarshall JAXBContext context = JAXBContext.newInstance(classesToBeBound); Unmarshaller unmarshaller = context.createUnmarshaller(); StringReader reader = new StringReader(xml); return unmarshaller.unmarshal(reader); |
T | unmarshall(String xml, Class unmarshall JAXBContext ctx = JAXBContext.newInstance(clazz); Unmarshaller m = ctx.createUnmarshaller(); StringReader reader = new StringReader(HEADER + xml); return (T) m.unmarshal(reader); |
Object | unmarshall(String xml, URL schemaURL, Class... classesToBeBound) unmarshall JAXBContext context = JAXBContext.newInstance(classesToBeBound); Unmarshaller unmarshaller = context.createUnmarshaller(); if (schemaURL != null) { SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = sf.newSchema(schemaURL); unmarshaller.setSchema(schema); StringReader reader = new StringReader(xml); ... |
T | unmarshaller(Class unmarshaller Unmarshaller unmarshaller = createUnmarshaller(entityType);
return (T) unmarshaller.unmarshal(in);
|
T | unmarshaller(String xml, Class> T) unmarshaller JAXBContext jc; Unmarshaller unmarshaller; Object o = null; try { jc = JAXBContext.newInstance(T); unmarshaller = jc.createUnmarshaller(); o = unmarshaller.unmarshal(new StreamSource(new StringReader(xml))); } catch (JAXBException e) { ... |
BoundType | unmarshallJAXBElement(JAXBElement extends BoundType> v) unmarshall JAXB Element if (v == null) { return null; } else { return v.getValue(); |
Object | unMarshallRequest(String xmlString) un Marshall Request Object request = null; try { Unmarshaller um = getRequestContext().createUnmarshaller(); request = um.unmarshal(new ByteArrayInputStream(xmlString.getBytes())); } catch (JAXBException je) { je.printStackTrace(); return request; ... |
T | unmarshallString(String str, Class unmarshall String initUnmarshaller(c); ByteArrayInputStream bis = new ByteArrayInputStream(str.getBytes()); return (T) um.unmarshal(bis); |
OBJECT_TYPE | unmarshallXml(final String string, final Class unmarshall Xml return unmarschall(string, type, null);
|