public void marshal(Object jaxbObject, XmlNode xmlNode) throws JAXBException { if ((xmlNode == null) || (jaxbObject == null)) throw new IllegalArgumentException(); getMarshaller().marshal(jaxbObject,createOutput(xmlNode)); }
public XmlNode updateXML(Object jaxbObject, XmlNode xmlNode) throws JAXBException { if(jaxbObject==null || xmlNode==null) throw new IllegalArgumentException(); // TODO // for now just marshal // TODO: object model independenc Element e = (Element)xmlNode; Node ns = e.getNextSibling(); Node p = e.getParentNode(); p.removeChild(e); // if the type object is passed, the following step is necessary to make // the marshalling successful. JaxBeanInfo bi = context.getBeanInfo(jaxbObject, true); if(!bi.isElement()) jaxbObject = new JAXBElement(new QName(e.getNamespaceURI(),e.getLocalName()),bi.jaxbType,jaxbObject); getMarshaller().marshal(jaxbObject,p); Node newNode = p.getLastChild(); p.removeChild(newNode); p.insertBefore(newNode,ns); return (XmlNode)newNode; }
public void marshal(Object jaxbObject, XmlNode xmlNode) throws JAXBException { if ((xmlNode == null) || (jaxbObject == null)) throw new IllegalArgumentException(); getMarshaller().marshal(jaxbObject,createOutput(xmlNode)); }
public XmlNode updateXML(Object jaxbObject, XmlNode xmlNode) throws JAXBException { if(jaxbObject==null || xmlNode==null) throw new IllegalArgumentException(); // TODO // for now just marshal // TODO: object model independenc Element e = (Element)xmlNode; Node ns = e.getNextSibling(); Node p = e.getParentNode(); p.removeChild(e); // if the type object is passed, the following step is necessary to make // the marshalling successful. JaxBeanInfo bi = context.getBeanInfo(jaxbObject, true); if(!bi.isElement()) jaxbObject = new JAXBElement(new QName(e.getNamespaceURI(),e.getLocalName()),bi.jaxbType,jaxbObject); getMarshaller().marshal(jaxbObject,p); Node newNode = p.getLastChild(); p.removeChild(newNode); p.insertBefore(newNode,ns); return (XmlNode)newNode; }
public void marshal(Marshaller m, Object object, OutputStream output, NamespaceContext nsContext) throws JAXBException { m.setProperty(Marshaller.JAXB_FRAGMENT,true); try { ((MarshallerImpl)m).marshal(object,output,nsContext); } finally { m.setProperty(Marshaller.JAXB_FRAGMENT,false); } }
public void marshal(Marshaller m, Object object, OutputStream output, NamespaceContext nsContext) throws JAXBException { m.setProperty(Marshaller.JAXB_FRAGMENT,true); try { ((MarshallerImpl)m).marshal(object,output,nsContext); } finally { m.setProperty(Marshaller.JAXB_FRAGMENT,false); } }
public void marshal(Marshaller m, Object object, OutputStream output, NamespaceContext nsContext) throws JAXBException { m.setProperty(Marshaller.JAXB_FRAGMENT,true); try { ((MarshallerImpl)m).marshal(object,output,nsContext); } finally { m.setProperty(Marshaller.JAXB_FRAGMENT,false); } }
public void marshal(Marshaller m, Object object, OutputStream output, NamespaceContext nsContext) throws JAXBException { m.setProperty(Marshaller.JAXB_FRAGMENT,true); try { ((MarshallerImpl)m).marshal(object,output,nsContext); } finally { m.setProperty(Marshaller.JAXB_FRAGMENT,false); } }
public void marshal(Marshaller m, Object object, OutputStream output, NamespaceContext nsContext) throws JAXBException { m.setProperty(Marshaller.JAXB_FRAGMENT,true); try { ((MarshallerImpl)m).marshal(object,output,nsContext); } finally { m.setProperty(Marshaller.JAXB_FRAGMENT,false); } }
public void marshal(Marshaller m, Object object, OutputStream output, NamespaceContext nsContext) throws JAXBException { m.setProperty(Marshaller.JAXB_FRAGMENT,true); try { ((MarshallerImpl)m).marshal(object,output,nsContext); } finally { m.setProperty(Marshaller.JAXB_FRAGMENT,false); } }
public void marshal(Object jaxbObject, XmlNode xmlNode) throws JAXBException { if ((xmlNode == null) || (jaxbObject == null)) throw new IllegalArgumentException(); getMarshaller().marshal(jaxbObject,createOutput(xmlNode)); }
public void marshal(Object jaxbObject, XmlNode xmlNode) throws JAXBException { if ((xmlNode == null) || (jaxbObject == null)) throw new IllegalArgumentException(); getMarshaller().marshal(jaxbObject,createOutput(xmlNode)); }
public XmlNode updateXML(Object jaxbObject, XmlNode xmlNode) throws JAXBException { if(jaxbObject==null || xmlNode==null) throw new IllegalArgumentException(); // TODO // for now just marshal // TODO: object model independenc Element e = (Element)xmlNode; Node ns = e.getNextSibling(); Node p = e.getParentNode(); p.removeChild(e); // if the type object is passed, the following step is necessary to make // the marshalling successful. JaxBeanInfo bi = context.getBeanInfo(jaxbObject, true); if(!bi.isElement()) jaxbObject = new JAXBElement(new QName(e.getNamespaceURI(),e.getLocalName()),bi.jaxbType,jaxbObject); getMarshaller().marshal(jaxbObject,p); Node newNode = p.getLastChild(); p.removeChild(newNode); p.insertBefore(newNode,ns); return (XmlNode)newNode; }
public XmlNode updateXML(Object jaxbObject, XmlNode xmlNode) throws JAXBException { if(jaxbObject==null || xmlNode==null) throw new IllegalArgumentException(); // TODO // for now just marshal // TODO: object model independenc Element e = (Element)xmlNode; Node ns = e.getNextSibling(); Node p = e.getParentNode(); p.removeChild(e); // if the type object is passed, the following step is necessary to make // the marshalling successful. JaxBeanInfo bi = context.getBeanInfo(jaxbObject, true); if(!bi.isElement()) jaxbObject = new JAXBElement(new QName(e.getNamespaceURI(),e.getLocalName()),bi.jaxbType,jaxbObject); getMarshaller().marshal(jaxbObject,p); Node newNode = p.getLastChild(); p.removeChild(newNode); p.insertBefore(newNode,ns); return (XmlNode)newNode; }
static public void marshalPMML(PMML pmml, OutputStream os) throws JAXBException { JAXBContextImpl context; try { context = (JAXBContextImpl)JAXBUtil.getContext(); } catch(ClassCastException cce){ throw new IllegalStateException("Not a GlassFish Metro runtime", cce); } MarshallerImpl marshaller = context.createMarshaller(); XmlOutput xmlOutput = new PrettyUTF8XmlOutput(os, context.getUTF8NameTable()); marshaller.marshal(pmml, xmlOutput); } }