Class DocType

  • All Implemented Interfaces:
    TagBase, java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    Html


    public abstract class DocType
    extends AbstractHtml
    Since:
    1.0.0
    See Also:
    Serialized Form
    • Constructor Detail

      • DocType

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

      • toHtmlString

        public java.lang.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 java.lang.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 java.lang.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 java.lang.String toHtmlString​(java.nio.charset.Charset charset)
        Description copied from interface: TagBase
        gets the html string of the tag including the child tags/values using the given charset. 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.
      • toHtmlString

        public java.lang.String toHtmlString​(java.lang.String charset)
        Description copied from interface: TagBase
        gets the html string of the tag including the child tags/values using the given charset. 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.
      • toHtmlString

        public java.lang.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.
      • toHtmlString

        public java.lang.String toHtmlString​(boolean rebuild,
                                             java.nio.charset.Charset charset)
        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.
      • toHtmlString

        public java.lang.String toHtmlString​(boolean rebuild,
                                             java.lang.String charset)
        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​(java.io.OutputStream os)
                           throws java.io.IOException
        Overrides:
        toOutputStream in class AbstractHtml
        Parameters:
        os - the object of OutputStream to write to.
        Returns:
        the total number of bytes written
        Throws:
        java.io.IOException
      • toOutputStream

        public int toOutputStream​(java.io.OutputStream os,
                                  boolean rebuild)
                           throws java.io.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:
        java.io.IOException
      • toOutputStream

        public int toOutputStream​(java.io.OutputStream os,
                                  java.nio.charset.Charset charset)
                           throws java.io.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:
        java.io.IOException
        Since:
        1.0.0
      • toOutputStream

        public int toOutputStream​(java.io.OutputStream os,
                                  java.lang.String charset)
                           throws java.io.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:
        java.io.IOException
        Since:
        1.0.0
      • toOutputStream

        public int toOutputStream​(java.io.OutputStream os,
                                  boolean rebuild,
                                  java.nio.charset.Charset charset)
                           throws java.io.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:
        java.io.IOException
        Since:
        1.0.0
      • toOutputStream

        public int toOutputStream​(java.io.OutputStream os,
                                  boolean rebuild,
                                  java.lang.String charset)
                           throws java.io.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:
        java.io.IOException
        Since:
        1.0.0
      • toBigOutputStream

        public int toBigOutputStream​(java.io.OutputStream os)
                              throws java.io.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:
        java.io.IOException
      • toBigOutputStream

        public int toBigOutputStream​(java.io.OutputStream os,
                                     boolean rebuild)
                              throws java.io.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:
        java.io.IOException
      • toBigOutputStream

        public int toBigOutputStream​(java.io.OutputStream os,
                                     java.nio.charset.Charset charset)
                              throws java.io.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:
        java.io.IOException
      • toBigOutputStream

        public int toBigOutputStream​(java.io.OutputStream os,
                                     java.lang.String charset)
                              throws java.io.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:
        java.io.IOException
      • toBigOutputStream

        public int toBigOutputStream​(java.io.OutputStream os,
                                     boolean rebuild,
                                     java.nio.charset.Charset charset)
                              throws java.io.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:
        java.io.IOException
      • toBigOutputStream

        public int toBigOutputStream​(java.io.OutputStream os,
                                     boolean rebuild,
                                     java.lang.String charset)
                              throws java.io.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:
        java.io.IOException
      • toString

        public java.lang.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 java.lang.String getDocTypeTag​()
        Returns:
        the docTypeTag
        Since:
        1.0.0
      • setDocTypeTag

        public void setDocTypeTag​(java.lang.String docTypeTag)
        the default doc type is
        Parameters:
        docTypeTag - the docTypeTag to set
        Since:
        1.0.0