Class HtmlImplicitClosingRules


  • public class HtmlImplicitClosingRules
    extends java.lang.Object
    HTML rules for implicitly closing tags.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] CLOSED_ON_EOF  
      static java.lang.String[][] IMPLIED_ON_END
      List of tags that can be implicitly closed on tags end.
      static java.lang.String[][] IMPLIED_ON_START
      List of tags that can be implicitly closed on provided children.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean implicitlyCloseParentTagOnNewTag​(java.lang.String parentNodeName, java.lang.String nodeName)
      Returns true if parent node tag can be closed implicitly.
      boolean implicitlyCloseParentTagOnTagEnd​(java.lang.String parentNodeName, java.lang.String nodeName)
      Returns true if current end tag (node name) closes the parent tag.
      boolean implicitlyCloseTagOnEOF​(java.lang.String nodeName)
      Returns true if tag should be closed on EOF.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • IMPLIED_ON_START

        public static final java.lang.String[][] IMPLIED_ON_START
        List of tags that can be implicitly closed on provided children. The first array contains parent tag name (i.e. parent node name), that can be closed. The second array contains list of all children that will implicitly close the parent (i.e. current node name).

        Interpret it like this: [second array OPEN tag] closes [first array tag]

      • IMPLIED_ON_END

        public static final java.lang.String[][] IMPLIED_ON_END
        List of tags that can be implicitly closed on tags end. The first array contains current node name (i.e. ending tag). The second array contains list of all of parent tags that can be closed.

        Interpret it like this: [first array CLOSE tag] closes [second array tag]

      • CLOSED_ON_EOF

        public static final java.lang.String[] CLOSED_ON_EOF
    • Constructor Detail

      • HtmlImplicitClosingRules

        public HtmlImplicitClosingRules()
    • Method Detail

      • implicitlyCloseParentTagOnNewTag

        public boolean implicitlyCloseParentTagOnNewTag​(java.lang.String parentNodeName,
                                                        java.lang.String nodeName)
        Returns true if parent node tag can be closed implicitly.
      • implicitlyCloseParentTagOnTagEnd

        public boolean implicitlyCloseParentTagOnTagEnd​(java.lang.String parentNodeName,
                                                        java.lang.String nodeName)
        Returns true if current end tag (node name) closes the parent tag.
      • implicitlyCloseTagOnEOF

        public boolean implicitlyCloseTagOnEOF​(java.lang.String nodeName)
        Returns true if tag should be closed on EOF.