Class DocType

All Implemented Interfaces:
TagBase, Serializable, Cloneable
Direct Known Subclasses:
Html

public abstract class DocType extends AbstractHtml
Since:
1.0.0
See Also:
  • Constructor Details

    • DocType

      public DocType(String tagName, AbstractHtml base, AbstractAttribute[] attributes)
      should be invoked to generate opening and closing tag
      Parameters:
      tagName -
      attributes -
    • DocType

      protected DocType(PreIndexedTagName preIndexedTagName, AbstractHtml base, AbstractAttribute[] attributes)
      should be invoked to generate opening and closing tag
      Parameters:
      preIndexedTagName -
      attributes -
      Since:
      3.0.3
  • Method Details

    • toHtmlString

      public String toHtmlString()
      Description copied from interface: TagBase
      gets the html string of the tag including the child tags/values. rebuilds the html string if the child tags/values or attributes have been modified.
      Specified by:
      toHtmlString in interface TagBase
      Overrides:
      toHtmlString in class AbstractHtml
      Returns:
      String equalent to the html string of the tag including the child tags.
    • toBigHtmlString

      public String toBigHtmlString()
      Description copied from class: AbstractHtml
      Use this method to produce HTML from very heavy and complicated tag hierarchy. For normal and simple HTML hierarchy use toHtmlString method which is faster than this method. The advantage of toBigHtmlString over toHtmlString is it will never throw StackOverflowError.
      NB:- this method has not been undergone all testing process.
      Overrides:
      toBigHtmlString in class AbstractHtml
      Returns:
      the HTML string similar to toHtmlString method.
    • toBigHtmlString

      public String toBigHtmlString(boolean rebuild)
      Description copied from class: AbstractHtml
      Use this method to produce HTML from very heavy and complicated tag hierarchy. For normal and simple HTML hierarchy use toHtmlString method which is faster than this method. The advantage of toBigHtmlString over toHtmlString is it will never throw StackOverflowError.
      NB:- this method has not been undergone all testing process.
      Overrides:
      toBigHtmlString in class AbstractHtml
      Parameters:
      rebuild - true to rebuild the tag hierarchy or false to return from cache if available.
      Returns:
      the HTML string similar to toHtmlString method.
    • toHtmlString

      public String toHtmlString(boolean rebuild)
      Description copied from interface: TagBase
      rebuilds the html string of the tag including the child tags/values if parameter is true, otherwise returns the html string prebuilt and kept in the cache.
      Specified by:
      toHtmlString in interface TagBase
      Overrides:
      toHtmlString in class AbstractHtml
      Parameters:
      rebuild - true to rebuild & false to return previously built string.
      Returns:
      String equalent to the html string of the tag including the child tags.
    • toOutputStream

      public int toOutputStream(OutputStream os) throws IOException
      Overrides:
      toOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      Returns:
      the total number of bytes written
      Throws:
      IOException
    • toOutputStream

      public int toOutputStream(OutputStream os, boolean rebuild) throws IOException
      Overrides:
      toOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      rebuild - true to rebuild & false to write previously built bytes.
      Returns:
      the total number of bytes written
      Throws:
      IOException
    • toOutputStream

      public int toOutputStream(OutputStream os, boolean rebuild, boolean flushOnWrite) throws IOException
      Overrides:
      toOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      rebuild - true to rebuild & false to write previously built bytes.
      flushOnWrite - true to flush on each write to OutputStream
      Returns:
      the total number of bytes written
      Throws:
      IOException
    • toOutputStream

      public int toOutputStream(OutputStream os, Charset charset) throws IOException
      Overrides:
      toOutputStream in class AbstractHtml
      Parameters:
      os - object of OutputStream to which the bytes to be written
      charset - the charset to encode for the bytes
      Returns:
      the total number of bytes written
      Throws:
      IOException
      Since:
      1.0.0
    • toOutputStream

      public int toOutputStream(OutputStream os, Charset charset, boolean flushOnWrite) throws IOException
      Overrides:
      toOutputStream in class AbstractHtml
      Parameters:
      os - object of OutputStream to which the bytes to be written
      charset - the charset to encode for the bytes
      flushOnWrite - true to flush on each write to OutputStream
      Returns:
      the total number of bytes written
      Throws:
      IOException
      Since:
      3.0.2
    • toOutputStream

      public int toOutputStream(OutputStream os, String charset) throws IOException
      Overrides:
      toOutputStream in class AbstractHtml
      Parameters:
      os - object of OutputStream to which the bytes to be written
      charset - the charset to encode for the bytes
      Returns:
      the total number of bytes written
      Throws:
      IOException
      Since:
      1.0.0
    • toOutputStream

      public int toOutputStream(OutputStream os, boolean rebuild, Charset charset) throws IOException
      Overrides:
      toOutputStream in class AbstractHtml
      Parameters:
      os - object of OutputStream to which the bytes to be written
      rebuild - true to rebuild the tags
      charset - the charset to encode for the bytes
      Returns:
      the total number of bytes written
      Throws:
      IOException
      Since:
      1.0.0
    • toOutputStream

      public int toOutputStream(OutputStream os, boolean rebuild, Charset charset, boolean flushOnWrite) throws IOException
      Overrides:
      toOutputStream in class AbstractHtml
      Parameters:
      os - object of OutputStream to which the bytes to be written
      rebuild - true to rebuild the tags
      charset - the charset to encode for the bytes
      flushOnWrite - true to flush on each write to OutputStream
      Returns:
      the total number of bytes written
      Throws:
      IOException
      Since:
      3.0.2
    • toOutputStream

      public int toOutputStream(OutputStream os, boolean rebuild, String charset) throws IOException
      Overrides:
      toOutputStream in class AbstractHtml
      Parameters:
      os - object of OutputStream to which the bytes to be written
      rebuild - true to rebuild the tags
      charset - the charset to encode for the bytes
      Returns:
      the total number of bytes written
      Throws:
      IOException
      Since:
      1.0.0
    • toBigOutputStream

      public int toBigOutputStream(OutputStream os) throws IOException
      Description copied from class: AbstractHtml
      Use this method to produce HTML from very heavy and complicated tag hierarchy. For normal and simple HTML hierarchy use toOutputStream method which is faster than this method. The advantage of toBigOutputStream over toOutputStream is it will never throw StackOverflowError and the memory consumed at the time of writing could be available for GC (depends on JVM GC rules).
      NB:- this method has not been undergone all testing process.
      Overrides:
      toBigOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      Returns:
      the total number of bytes written
      Throws:
      IOException
    • toBigOutputStream

      public int toBigOutputStream(OutputStream os, boolean rebuild) throws IOException
      Description copied from class: AbstractHtml
      Use this method to produce HTML from very heavy and complicated tag hierarchy. For normal and simple HTML hierarchy use toOutputStream method which is faster than this method. The advantage of toBigOutputStream over toOutputStream is it will never throw StackOverflowError and the memory consumed at the time of writing could be available for GC (depends on JVM GC rules).
      NB:- this method has not been undergone all testing process.
      Overrides:
      toBigOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      rebuild - true to rebuild & false to write previously built bytes.
      Returns:
      the total number of bytes written
      Throws:
      IOException
    • toBigOutputStream

      public int toBigOutputStream(OutputStream os, Charset charset) throws IOException
      Description copied from class: AbstractHtml
      Use this method to produce HTML from very heavy and complicated tag hierarchy. For normal and simple HTML hierarchy use toOutputStream method which is faster than this method. The advantage of toBigOutputStream over toOutputStream is it will never throw StackOverflowError and the memory consumed at the time of writing could be available for GC (depends on JVM GC rules).
      NB:- this method has not been undergone all testing process.
      Overrides:
      toBigOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      charset - the charset
      Returns:
      Throws:
      IOException
    • toBigOutputStream

      public int toBigOutputStream(OutputStream os, String charset) throws IOException
      Description copied from class: AbstractHtml
      Use this method to produce HTML from very heavy and complicated tag hierarchy. For normal and simple HTML hierarchy use toOutputStream method which is faster than this method. The advantage of toBigOutputStream over toOutputStream is it will never throw StackOverflowError and the memory consumed at the time of writing could be available for GC (depends on JVM GC rules).
      NB:- this method has not been undergone all testing process.
      Overrides:
      toBigOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      charset - the charset
      Returns:
      the total number of bytes written
      Throws:
      IOException
    • toBigOutputStream

      public int toBigOutputStream(OutputStream os, boolean rebuild, Charset charset) throws IOException
      Description copied from class: AbstractHtml
      Use this method to produce HTML from very heavy and complicated tag hierarchy. For normal and simple HTML hierarchy use toOutputStream method which is faster than this method. The advantage of toBigOutputStream over toOutputStream is it will never throw StackOverflowError and the memory consumed at the time of writing could be available for GC (depends on JVM GC rules).
      NB:- this method has not been undergone all testing process.
      Overrides:
      toBigOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      rebuild - true to rebuild & false to write previously built bytes.
      charset - the charset
      Returns:
      the total number of bytes written
      Throws:
      IOException
    • toBigOutputStream

      public int toBigOutputStream(OutputStream os, boolean rebuild, String charset) throws IOException
      Description copied from class: AbstractHtml
      Use this method to produce HTML from very heavy and complicated tag hierarchy. For normal and simple HTML hierarchy use toOutputStream method which is faster than this method. The advantage of toBigOutputStream over toOutputStream is it will never throw StackOverflowError and the memory consumed at the time of writing could be available for GC (depends on JVM GC rules).
      NB:- this method has not been undergone all testing process.
      Overrides:
      toBigOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      rebuild - true to rebuild & false to write previously built bytes.
      charset - the charset
      Returns:
      the total number of bytes written
      Throws:
      IOException
    • toBigOutputStream

      public int toBigOutputStream(OutputStream os, boolean rebuild, Charset charset, boolean flushOnWrite) throws IOException
      Description copied from class: AbstractHtml
      Use this method to produce HTML from very heavy and complicated tag hierarchy. For normal and simple HTML hierarchy use toOutputStream method which is faster than this method. The advantage of toBigOutputStream over toOutputStream is it will never throw StackOverflowError and the memory consumed at the time of writing could be available for GC (depends on JVM GC rules).
      NB:- this method has not been undergone all testing process.
      Overrides:
      toBigOutputStream in class AbstractHtml
      Parameters:
      os - the object of OutputStream to write to.
      rebuild - true to rebuild & false to write previously built bytes.
      charset - the charset
      flushOnWrite - true to flush on each write to OutputStream
      Returns:
      the total number of bytes written
      Throws:
      IOException
    • toString

      public String toString()
      Description copied from interface: TagBase
      gets the html string of the tag including the child tags/values. rebuilds the html string if the child tags/values or attributes have been modified.
      Specified by:
      toString in interface TagBase
      Overrides:
      toString in class AbstractHtml
      Returns:
      String equalent to the html string of the tag including the child tags.
    • isPrependDocType

      public boolean isPrependDocType()
      Returns:
      the prependDocType
      Since:
      1.0.0
    • setPrependDocType

      public void setPrependDocType(boolean prependDocType)
      Parameters:
      prependDocType - the prependDocType to set
      Since:
      1.0.0
    • getDocTypeTag

      public String getDocTypeTag()
      Returns:
      the docTypeTag
      Since:
      1.0.0
    • setDocTypeTag

      public void setDocTypeTag(String docTypeTag)
      the default doc type is <!DOCTYPE html>
      Parameters:
      docTypeTag - the docTypeTag to set
      Since:
      1.0.0