List of utility methods to do XMLStreamWriter
XMLStreamWriter | getXMLStreamWriter(final Writer writer) Get the XML stream writer. return XML_OUTPUT_FACTORY.createXMLStreamWriter(writer);
|
boolean | isEntityExpansionLimitException(XMLStreamException e) Tests whether the provided exception is an entity expansion exception. return e.getMessage() != null && e.getMessage().matches(ENTITY_EXPANSION_EXCEPTION_MESSAGE);
|
boolean | isPrefixDeclared(XMLStreamWriter writer, String nsUri, String prefix) is Prefix Declared boolean prefixDecl = false; NamespaceContext nscontext = writer.getNamespaceContext(); Iterator prefixItr = nscontext.getPrefixes(nsUri); while (prefixItr.hasNext()) { if (prefix.equals(prefixItr.next())) { prefixDecl = true; break; return prefixDecl; |
void | renderPath(XMLStreamWriter writer, String pathData, String id, String style) render Path writer.writeStartElement("path"); if (id != null) { writer.writeAttribute("id", id); writer.writeAttribute("d", pathData); if (style != null) { writer.writeAttribute("class", style); writer.writeEndElement(); |
void | serializeEndpart(XMLStreamWriter writer) Method serializeEndpart. writer.writeEndElement(); |
void | setValueType(XMLStreamWriter xml, String dataType) set Value Type if (dataType.equals(String.class.getName())) { return; if (dataType.startsWith("java.lang.")) { dataType = dataType.substring("java.lang.".length()); xml.writeAttribute(VALUE_TYPE, dataType); |
void | writeAttribute(XMLStreamWriter out, QName name, String value) write Attribute if (name.getNamespaceURI() == null || "".equals(name.getNamespaceURI())) out.writeAttribute(name.getLocalPart(), value); else if (name.getPrefix() == null || "".equals(name.getPrefix())) out.writeAttribute(name.getNamespaceURI(), name.getLocalPart(), value); else out.writeAttribute(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), value); |
void | writeCharactersOrCDATA(XMLStreamWriter xsw, String string) Write the given string to the given writer, using either writeCharacters or, if there are more than a few less than signs in the string (e.g. if (containsEnoughLTs(string)) { Matcher m = CDATA_END_PATTERN.matcher(string); int startFrom = 0; while (m.find()) { xsw.writeCData(string.substring(startFrom, m.start())); xsw.writeCharacters("]]>"); startFrom = m.end(); if (startFrom == 0) { xsw.writeCData(string); } else if (startFrom < string.length()) { xsw.writeCData(string.substring(startFrom)); } else { xsw.writeCharacters(string); |
void | writeColorConfig(XMLStreamWriter writer, Boolean enabled, String error, String warn, String success, String required, String batch) write Color Config writer.writeStartElement("color-output"); writer.writeStartElement("enabled"); writer.writeCharacters(enabled.toString()); writer.writeEndElement(); if (!"".equals(error)) { writer.writeStartElement("error-color"); writer.writeCharacters(error); writer.writeEndElement(); ... |
void | writeComment(String comment, XMLStreamWriter xmlsw) write Comment xmlsw.writeComment(comment); |