List of utility methods to do XML JAXB Marshaller
Marshaller | createJAXBMarshaller(JAXBContext jaxbContext) create JAXB Marshaller Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); jaxbMarshaller.setProperty(Marshaller.JAXB_FRAGMENT, true); jaxbMarshaller.setProperty("com.sun.xml.bind.xmlHeaders", XML_HEADER); return jaxbMarshaller; |
Marshaller | createMarshall(String pkgName) create Marshall JAXBContext jaxbCtx = null; if ((jaxbCtx = marshallContexts.get(pkgName)) == null) { jaxbCtx = JAXBContext.newInstance(pkgName); marshallContexts.put(pkgName, jaxbCtx); Marshaller marshaller = jaxbCtx.createMarshaller(); return marshaller; |
Marshaller | createMarshaller() create Marshaller return getContext().createMarshaller();
|
Marshaller | createMarshaller(Class> clazz, Map create Marshaller try { JAXBContext jaxbContext = getJaxbContext(clazz); Marshaller marshaller = jaxbContext.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.setProperty(Marshaller.JAXB_ENCODING, (String) settings.get(JAXB_ENCODING)); marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true); return marshaller; } catch (JAXBException e) { ... |
Marshaller | createMarshaller(Class create Marshaller Marshaller marshaller = createJAXBContext(clazz).createMarshaller();
marshallers.put(clazz, marshaller);
return marshaller;
|
Marshaller | createMarshaller(JAXBContext context) create Marshaller try { return context.createMarshaller(); } catch (JAXBException e) { throw new IllegalStateException(e); |
Marshaller | createMarshaller(JAXBContext ctx, boolean indent) create Marshaller Marshaller mar = ctx.createMarshaller();
mar.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, indent ? Boolean.TRUE : Boolean.FALSE);
return mar;
|
Marshaller | createMarshaller(Object object) create Marshaller JAXBContext context; Marshaller marshaller = null; try { context = JAXBContext.newInstance(object.getClass()); marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE); } catch (JAXBException e) { ... |
Marshaller | createMarshaller(String pack) create Marshaller return createMarshaller(pack, null);
|
Marshaller | getJSIDLMarshaller() get JSIDL Marshaller if (jsidlJc == null) jsidlJc = JAXBContext.newInstance("org.jts.jsidl.binding"); if (jsidlMarshaller == null) jsidlMarshaller = jsidlJc.createMarshaller(); return jsidlMarshaller; |