Class Tree2Xml<C,N>

Type Parameters:
C - Container of the root of the tree
N - The tree node type
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, XMLFilter, XMLReader
Direct Known Subclasses:
DomTreeAligner, Json2Xml

public abstract class Tree2Xml<C,N> extends ToXml<C,N>
Base class for XML Schema guided Tree to XML conversion;
Author:
Gerrit van Brakel
  • Constructor Details

    • Tree2Xml

      public Tree2Xml(ValidatorHandler validatorHandler, List<org.apache.xerces.xs.XSModel> schemaInformation)
  • Method Details

    • getAllNodeChildNames

      public abstract Set<String> getAllNodeChildNames(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node) throws SAXException
      Throws:
      SAXException
    • getNodeChildrenByName

      public abstract Iterable<N> getNodeChildrenByName(N node, org.apache.xerces.xs.XSElementDeclaration childElementDeclaration) throws SAXException
      Throws:
      SAXException
    • getNodeText

      public abstract String getNodeText(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node)
    • hasChild

      public boolean hasChild(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node, String childName) throws SAXException
      Specified by:
      hasChild in class ToXml<C,N>
      Throws:
      SAXException
    • getSubstitutedChild

      protected N getSubstitutedChild(N node, String childName)
      Allows subclasses to provide a special way of substituting. This is used by Json2Xml to insert a List of values as a JsonArray.
    • getOverride

      protected String getOverride(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node)
    • getChildrenByName

      public final Iterable<N> getChildrenByName(N node, org.apache.xerces.xs.XSElementDeclaration childElementDeclaration) throws SAXException
      Specified by:
      getChildrenByName in class ToXml<C,N>
      Throws:
      SAXException
    • getText

      public final String getText(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node)
      Specified by:
      getText in class ToXml<C,N>
    • getUnprocessedChildElementNames

      protected Set<String> getUnprocessedChildElementNames(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node, Set<String> processedChildren) throws SAXException
      Overrides:
      getUnprocessedChildElementNames in class ToXml<C,N>
      Throws:
      SAXException
    • getSubstitutionProvider

      public SubstitutionProvider<?> getSubstitutionProvider()
    • setSubstitutionProvider

      public void setSubstitutionProvider(SubstitutionProvider<?> substitutions)
    • setOverrideValues

      public void setOverrideValues(Map<String,Object> overrideValues)