Interface IXMLIndentDeterminator

All Known Implementing Classes:
XMLIndentDeterminatorHTML, XMLIndentDeterminatorXML

@MustImplementEqualsAndHashcode public interface IXMLIndentDeterminator
Interface used in writing XML to determine the real indentation and align (as defined in EXMLSerializeIndent) that should be used for a single element.
Author:
Philip Helger
  • Method Details

    • getIndentOuter

      @Nonnull EXMLSerializeIndent getIndentOuter(@Nullable String sParentNamespaceURI, @Nullable String sParentTagName, @Nullable String sNamespaceURI, @Nonnull String sTagName, @Nullable Map<QName,String> aAttrs, boolean bHasChildren, @Nonnull EXMLSerializeIndent eDefaultIndent)
      Determine the outer indentation mode (before the start tag and after the closing tag).
      Parameters:
      sParentNamespaceURI - Optional namespace URI of the parent element (if any). May be null.
      sParentTagName - Tag name of the parent element (if any). May be null.
      sNamespaceURI - Optional namespace URI. May be null.
      sTagName - Tag name.
      aAttrs - Optional set of attributes.
      bHasChildren - true if the current element has children
      eDefaultIndent - The default indentation mode provided by the IXMLWriterSettings. Never null.
      Returns:
      The indentation mode to be used. May not be null.
    • getIndentInner

      @Nonnull EXMLSerializeIndent getIndentInner(@Nullable String sParentNamespaceURI, @Nullable String sParentTagName, @Nullable String sNamespaceURI, @Nonnull String sTagName, @Nullable Map<QName,String> aAttrs, boolean bHasChildren, @Nonnull EXMLSerializeIndent eDefaultIndent)
      Determine the outer indentation mode (after the start tag and before the closing tag).
      Parameters:
      sParentNamespaceURI - Optional namespace URI of the parent element (if any). May be null.
      sParentTagName - Tag name of the parent element (if any). May be null.
      sNamespaceURI - Optional namespace URI. May be null.
      sTagName - Tag name.
      aAttrs - Optional set of attributes.
      bHasChildren - true if the current element has children
      eDefaultIndent - The default indentation mode provided by the IXMLWriterSettings. Never null.
      Returns:
      The indentation mode to be used. May not be null.