Class XmlSerializer

java.lang.Object
org.rumbledb.serialization.XmlSerializer
All Implemented Interfaces:
Serializable, Serializer
Direct Known Subclasses:
HtmlSerializer, XhtmlSerializer

public class XmlSerializer extends Object implements Serializer, Serializable
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • serialize

      public String serialize(Item item)
      Specified by:
      serialize in interface Serializer
    • serialize

      public void serialize(Item item, StringBuilder sb, String indent, boolean isTopLevel)
      Specified by:
      serialize in interface Serializer
    • serializeDocumentNode

      protected void serializeDocumentNode(Item item, StringBuilder sb, String indent, boolean isTopLevel)
    • serializeElementNode

      protected void serializeElementNode(Item item, StringBuilder sb, String indent, boolean isTopLevel)
    • appendTextNode

      protected void appendTextNode(Item item, StringBuilder sb)
    • appendAttributeOrNamespaceNode

      protected void appendAttributeOrNamespaceNode(Item item, StringBuilder sb)
    • matchesElementNamespace

      protected boolean matchesElementNamespace(Item element, Item namespace)
    • getNamespaceNodesToSerialize

      protected List<Item> getNamespaceNodesToSerialize(Item element)
    • shouldEmitNamespaceUndeclaration

      protected boolean shouldEmitNamespaceUndeclaration(String prefix, String previousUri, Item element)
    • supportsPrefixUndeclaration

      protected boolean supportsPrefixUndeclaration(Item element)
    • getEffectiveNamespaceScope

      protected Map<String,String> getEffectiveNamespaceScope(Item element)
    • getParentElement

      protected Item getParentElement(Item item)
    • createNamespaceNode

      protected Item createNamespaceNode(Item parent, String prefix, String uri)
    • prepareAttributeValue

      protected String prepareAttributeValue(Item attribute)
    • escapeAttribute

      protected String escapeAttribute(String value)
    • escapeText

      protected String escapeText(String value)
    • shouldSerializeNamespace

      protected boolean shouldSerializeNamespace(String prefix, String uri)
    • shouldEmitXmlDeclaration

      protected boolean shouldEmitXmlDeclaration(Item item)
    • appendXmlDeclaration

      protected void appendXmlDeclaration(StringBuilder sb)
    • appendDocTypeIfNeeded

      protected void appendDocTypeIfNeeded(Item element, StringBuilder sb)
    • getEffectiveVersion

      protected String getEffectiveVersion(String defaultValue)
    • isXml11

      protected boolean isXml11()
    • isCDataSectionElement

      protected boolean isCDataSectionElement(Item element)
    • shouldIndentElement

      protected boolean shouldIndentElement(Item item)
    • mustPreserveWhitespace

      protected boolean mustPreserveWhitespace(Item element)
    • matchesExpandedQNameEntry

      protected boolean matchesExpandedQNameEntry(Set<String> entries, Item element)
    • containsElementLikeChild

      protected boolean containsElementLikeChild(List<Item> children)
    • hasSignificantTextChild

      protected boolean hasSignificantTextChild(List<Item> children)
    • shouldIndentBeforeChild

      protected boolean shouldIndentBeforeChild(Item child)
    • nextIndent

      protected String nextIndent(String indent)
    • appendCDataText

      protected void appendCDataText(String value, StringBuilder sb)
    • serializationError

      protected RumbleException serializationError(String message, String errorCode)