/** * Write a model to an OutputStream. * @param model * @param os * @throws ContributionWriteException */ public void write(Object model, OutputStream os, ProcessorContext context) throws ContributionWriteException { try { XMLStreamWriter writer = outputFactory.createXMLStreamWriter(os); write(model, writer, context); writer.flush(); writer.close(); } catch (XMLStreamException e) { ContributionWriteException cw = new ContributionWriteException(e); error(context.getMonitor(), "ContributionWriteException", outputFactory, cw); throw cw; } }
/** * Write a model to an OutputStream. * @param model * @param os * @throws ContributionWriteException */ public void write(Object model, OutputStream os, ProcessorContext context) throws ContributionWriteException { try { XMLStreamWriter writer = outputFactory.createXMLStreamWriter(os); write(model, writer, context); writer.flush(); writer.close(); } catch (XMLStreamException e) { ContributionWriteException cw = new ContributionWriteException(e); error(context.getMonitor(), "ContributionWriteException", outputFactory, cw); throw cw; } }
/** * Write a model to an OutputStream. * @param model * @param os * @param context * @throws ContributionWriteException */ public void write(Object model, OutputStream os, ProcessorContext context) throws ContributionWriteException { try { XMLStreamWriter writer = outputFactory.createXMLStreamWriter(os); write(model, writer, context); writer.flush(); writer.close(); } catch (XMLStreamException e) { ContributionWriteException cw = new ContributionWriteException(e); error(context.getMonitor(), "ContributionWriteException", outputFactory, cw); throw cw; } }
/** * Write a model to an OutputStream. * @param model * @param os * @param context * @throws ContributionWriteException */ public void write(Object model, OutputStream os, ProcessorContext context) throws ContributionWriteException { try { XMLStreamWriter writer = outputFactory.createXMLStreamWriter(os); write(model, writer, context); writer.flush(); writer.close(); } catch (XMLStreamException e) { ContributionWriteException cw = new ContributionWriteException(e); error(context.getMonitor(), "ContributionWriteException", outputFactory, cw); throw cw; } }
public void write(T bean, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException { try { // Write the bean properties as attributes List<XAttr> attrs = new ArrayList<XAttr>(); for (Map.Entry<String, Method> entry: getterMethods.entrySet()) { if (entry.getValue().getReturnType() == String.class) { String value = (String)entry.getValue().invoke(bean); attrs.add(new XAttr(entry.getKey(), value)); } } // Write element writeStart(writer, artifactType.getNamespaceURI(), artifactType.getLocalPart(), policyProcessor.writePolicies(bean), new XAttr(null, attrs)); writeEnd(writer); } catch (Exception e) { ContributionWriteException ce = new ContributionWriteException(e); error(context.getMonitor(), "ContributionWriteException", writer, ce); throw ce; } }
public void write(T bean, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException { try { // Write the bean properties as attributes List<XAttr> attrs = new ArrayList<XAttr>(); for (Map.Entry<String, Method> entry: getterMethods.entrySet()) { if (entry.getValue().getReturnType() == String.class) { String value = (String)entry.getValue().invoke(bean); attrs.add(new XAttr(entry.getKey(), value)); } } // Write element writeStart(writer, artifactType.getNamespaceURI(), artifactType.getLocalPart(), policyProcessor.writePolicies(bean), new XAttr(null, attrs)); writeEnd(writer); } catch (Exception e) { ContributionWriteException ce = new ContributionWriteException(e); error(context.getMonitor(), "ContributionWriteException", writer, ce); throw ce; } }