use of com.sun.xml.txw2.output.StaxSerializer in project metro-jax-ws by eclipse-ee4j.
the class XmlPolicyModelMarshaller method marshal.
/**
* Marshal a policy onto the given XMLStreamWriter.
*
* @param model A policy source model.
* @param writer An XML stream writer.
* @throws PolicyException If marshalling failed.
*/
private void marshal(final PolicySourceModel model, final XMLStreamWriter writer) throws PolicyException {
final StaxSerializer serializer = new StaxSerializer(writer);
final TypedXmlWriter policy = TXW.create(model.getNamespaceVersion().asQName(XmlToken.Policy), TypedXmlWriter.class, serializer);
marshalDefaultPrefixes(model, policy);
marshalPolicyAttributes(model, policy);
marshal(model.getNamespaceVersion(), model.getRootNode(), policy);
policy.commit();
serializer.flush();
}
use of com.sun.xml.txw2.output.StaxSerializer in project metro-jax-ws by eclipse-ee4j.
the class XmlPolicyModelMarshaller method marshal.
/**
* Marshal a policy onto the given StaxSerializer.
*
* @param model A policy source model.
* @param writer A Stax serializer.
* @throws PolicyException If marshalling failed.
*/
private void marshal(final PolicySourceModel model, final StaxSerializer writer) throws PolicyException {
final TypedXmlWriter policy = TXW.create(model.getNamespaceVersion().asQName(XmlToken.Policy), TypedXmlWriter.class, writer);
marshalDefaultPrefixes(model, policy);
marshalPolicyAttributes(model, policy);
marshal(model.getNamespaceVersion(), model.getRootNode(), policy);
policy.commit();
}
Aggregations