public XMLStreamWriter createXMLStreamWriter(Writer writer) throws XMLStreamException { return new BadgerFishXMLStreamWriter(writer); } }
public void writeAttribute(String p, String ns, String local, String value) throws XMLStreamException { String key = createAttributeKey(p, ns, local); try { getCurrentNode().put(key, value); } catch (JSONException e) { throw new XMLStreamException(e); } }
private String createAttributeKey(String p, String ns, String local) { return "@" + createKey(p, ns, local); }
currentKey = createKey(prefix, ns, local); Object existing = getCurrentNode().opt(currentKey); if (existing instanceof JSONObject) { JSONArray array = new JSONArray(); array.put(newCurrent); getCurrentNode().put(currentKey, array); getNodes().push(node); } else { JSONObject newCurrent = new JSONObject(); ((JSONArray) existing).put(newCurrent); } else { getCurrentNode().put(currentKey, newCurrent); getNodes().push(node);
public void writeAttribute(String ns, String local, String value) throws XMLStreamException { writeAttribute(null, ns, local, value); }
public String getPrefix(String ns) throws XMLStreamException { return getNamespaceContext().getPrefix(ns); }
public void writeDefaultNamespace(String ns) throws XMLStreamException { writeNamespace("", ns); }
public void writeAttribute(String p, String ns, String local, String value) throws XMLStreamException { String key = createAttributeKey(p, ns, local); try { currentNode.put(key, value); } catch (JSONException e) { throw new XMLStreamException(e); } }
public void writeAttribute(String local, String value) throws XMLStreamException { writeAttribute(null, local, value); }
public String getPrefix(String ns) throws XMLStreamException { return getNamespaceContext().getPrefix(ns); }
public void writeDefaultNamespace(String ns) throws XMLStreamException { writeNamespace("", ns); }
public static XMLStreamWriter createWriter(final Writer writer, final JettisonConfig config) throws IOException { switch (config.getNotation()) { case BADGERFISH: return new BadgerFishXMLStreamWriter(writer); case MAPPED_JETTISON: Configuration jmConfig; if (null == config.getXml2JsonNs()) { jmConfig = new Configuration(); } else { jmConfig = new Configuration(config.getXml2JsonNs()); } final MappedXMLStreamWriter result = new MappedXMLStreamWriter(new MappedNamespaceConvention(jmConfig), writer); for (String array : config.getArrayElements()) { result.serializeAsArray(array); } return result; default: return null; } }
public void writeAttribute(String ns, String local, String value) throws XMLStreamException { writeAttribute(null, ns, local, value); }
private String createAttributeKey(String p, String ns, String local) { return "@" + createKey(p, ns, local); }
@Override protected XMLStreamWriter getJSONWriter(Writer writer, MessageContext messageContext) { return new BadgerFishXMLStreamWriter(writer); } }
public void writeAttribute(String local, String value) throws XMLStreamException { writeAttribute(null, local, value); }
currentKey = createKey(prefix, ns, local);
public XMLStreamWriter createXMLStreamWriter(Writer writer) throws XMLStreamException { return new BadgerFishXMLStreamWriter(writer); } }
@Override protected XMLStreamWriter getJSONWriter(Writer writer, MessageContext messageContext) { return new BadgerFishXMLStreamWriter(writer); } }
public void marshal(Object o, Writer writer) throws JAXBException { BadgerFishXMLStreamWriter badger = new BadgerFishXMLStreamWriter(writer); marshaller.marshal(o, badger); }