java.lang.Object
gw.gosudoc.com.sun.tools.doclets.internal.toolkit.Content
gw.gosudoc.com.sun.tools.doclets.formats.html.markup.HtmlTree

@Deprecated public class HtmlTree extends Content
Deprecated.
Class for generating HTML tree for javadoc output.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

  • Field Details

    • htmlTag

      private HtmlTag htmlTag
      Deprecated.
    • attrs

      private Map<HtmlAttr,String> attrs
      Deprecated.
    • content

      private List<Content> content
      Deprecated.
    • EMPTY

      public static final Content EMPTY
      Deprecated.
    • NONENCODING_CHARS

      public static final BitSet NONENCODING_CHARS
      Deprecated.
      A set of ASCII URI characters to be left unencoded.
  • Constructor Details

    • HtmlTree

      public HtmlTree(HtmlTag tag)
      Deprecated.
      Constructor to construct HtmlTree object.
      Parameters:
      tag - HTML tag for the HtmlTree object
    • HtmlTree

      public HtmlTree(HtmlTag tag, Content... contents)
      Deprecated.
      Constructor to construct HtmlTree object.
      Parameters:
      tag - HTML tag for the HtmlTree object
      contents - contents to be added to the tree
  • Method Details

    • addAttr

      public void addAttr(HtmlAttr attrName, String attrValue)
      Deprecated.
      Adds an attribute for the HTML tag.
      Parameters:
      attrName - name of the attribute
      attrValue - value of the attribute
    • setTitle

      public void setTitle(Content body)
      Deprecated.
    • setRole

      public void setRole(HtmlAttr.Role role)
      Deprecated.
    • addStyle

      public void addStyle(HtmlStyle style)
      Deprecated.
      Adds a style for the HTML tag.
      Parameters:
      style - style to be added
    • addContent

      public void addContent(Content tagContent)
      Deprecated.
      Adds content for the HTML tag.
      Specified by:
      addContent in class Content
      Parameters:
      tagContent - tag content to be added
    • addContent

      public void addContent(String stringContent)
      Deprecated.
      This method adds a string content to the htmltree. If the last content member added is a StringContent, append the string to that StringContent or else create a new StringContent and add it to the html tree.
      Specified by:
      addContent in class Content
      Parameters:
      stringContent - string content that needs to be added
    • charCount

      public int charCount()
      Deprecated.
      Description copied from class: Content
      Return the number of characters of plain text content in this object (optional operation.)
      Overrides:
      charCount in class Content
      Returns:
      the number of characters of plain text content in this
    • escapeHtmlChars

      private static String escapeHtmlChars(String s)
      Deprecated.
      Given a string, escape all special html characters and return the result.
      Parameters:
      s - The string to check.
      Returns:
      the original string with all of the HTML characters escaped.
    • encodeURL

      private static String encodeURL(String url)
      Deprecated.
    • A

      public static HtmlTree A(String ref, Content body)
      Deprecated.
      Generates an HTML anchor tag.
      Parameters:
      ref - reference url for the anchor tag
      body - content for the anchor tag
      Returns:
      an HtmlTree object
    • A

      public static HtmlTree A(HtmlVersion htmlVersion, String attr, Content body)
      Deprecated.
      Generates an HTML anchor tag with an id or a name attribute and content.
      Parameters:
      htmlVersion - the version of the generated HTML
      attr - name or id attribute for the anchor tag
      body - content for the anchor tag
      Returns:
      an HtmlTree object
    • A_ID

      public static HtmlTree A_ID(String id, Content body)
      Deprecated.
      Generates an HTML anchor tag with id attribute and a body.
      Parameters:
      id - id for the anchor tag
      body - body for the anchor tag
      Returns:
      an HtmlTree object
    • CAPTION

      public static HtmlTree CAPTION(Content body)
      Deprecated.
      Generates a CAPTION tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the CAPTION tag
    • CODE

      public static HtmlTree CODE(Content body)
      Deprecated.
      Generates a CODE tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the CODE tag
    • DD

      public static HtmlTree DD(Content body)
      Deprecated.
      Generates a DD tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the DD tag
    • DL

      public static HtmlTree DL(Content body)
      Deprecated.
      Generates a DL tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the DL tag
    • DIV

      public static HtmlTree DIV(HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a DIV tag with the style class attributes. It also encloses a content.
      Parameters:
      styleClass - stylesheet class for the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the DIV tag
    • DIV

      public static HtmlTree DIV(Content body)
      Deprecated.
      Generates a DIV tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the DIV tag
    • DT

      public static HtmlTree DT(Content body)
      Deprecated.
      Generates a DT tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the DT tag
    • FOOTER

      public static HtmlTree FOOTER()
      Deprecated.
      Generates a FOOTER tag with role attribute.
      Returns:
      an HtmlTree object for the FOOTER tag
    • HEADER

      public static HtmlTree HEADER()
      Deprecated.
      Generates a HEADER tag with role attribute.
      Returns:
      an HtmlTree object for the HEADER tag
    • HEADING

      public static HtmlTree HEADING(HtmlTag headingTag, boolean printTitle, HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a heading tag (h1 to h6) with the title and style class attributes. It also encloses a content.
      Parameters:
      headingTag - the heading tag to be generated
      printTitle - true if title for the tag needs to be printed else false
      styleClass - stylesheet class for the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the tag
    • HEADING

      public static HtmlTree HEADING(HtmlTag headingTag, HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a heading tag (h1 to h6) with style class attribute. It also encloses a content.
      Parameters:
      headingTag - the heading tag to be generated
      styleClass - stylesheet class for the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the tag
    • HEADING

      public static HtmlTree HEADING(HtmlTag headingTag, boolean printTitle, Content body)
      Deprecated.
      Generates a heading tag (h1 to h6) with the title attribute. It also encloses a content.
      Parameters:
      headingTag - the heading tag to be generated
      printTitle - true if the title for the tag needs to be printed else false
      body - content for the tag
      Returns:
      an HtmlTree object for the tag
    • HEADING

      public static HtmlTree HEADING(HtmlTag headingTag, Content body)
      Deprecated.
      Generates a heading tag (h1 to h6) with some content.
      Parameters:
      headingTag - the heading tag to be generated
      body - content for the tag
      Returns:
      an HtmlTree object for the tag
    • HTML

      public static HtmlTree HTML(String lang, Content head, Content body)
      Deprecated.
      Generates an HTML tag with lang attribute. It also adds head and body content to the HTML tree.
      Parameters:
      lang - language for the HTML document
      head - head for the HTML tag
      body - body for the HTML tag
      Returns:
      an HtmlTree object for the HTML tag
    • IFRAME

      public static HtmlTree IFRAME(String src, String name, String title)
      Deprecated.
      Generates a IFRAME tag.
      Parameters:
      src - the url of the document to be shown in the frame
      name - specifies the name of the frame
      title - the title for the frame
      Returns:
      an HtmlTree object for the IFRAME tag
    • INPUT

      public static HtmlTree INPUT(String type, String id)
      Deprecated.
      Generates a INPUT tag with some id.
      Parameters:
      type - the type of input
      id - id for the tag
      Returns:
      an HtmlTree object for the INPUT tag
    • LI

      public static HtmlTree LI(Content body)
      Deprecated.
      Generates a LI tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the LI tag
    • LI

      public static HtmlTree LI(HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a LI tag with some content.
      Parameters:
      styleClass - style for the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the LI tag
    • LINK

      public static HtmlTree LINK(String rel, String type, String href, String title)
      Deprecated.
      Generates a LINK tag with the rel, type, href and title attributes.
      Parameters:
      rel - relevance of the link
      type - type of link
      href - the path for the link
      title - title for the link
      Returns:
      an HtmlTree object for the LINK tag
    • MAIN

      public static HtmlTree MAIN()
      Deprecated.
      Generates a MAIN tag with role attribute.
      Returns:
      an HtmlTree object for the MAIN tag
    • MAIN

      public static HtmlTree MAIN(Content body)
      Deprecated.
      Generates a MAIN tag with role attribute and some content.
      Parameters:
      body - content of the MAIN tag
      Returns:
      an HtmlTree object for the MAIN tag
    • MAIN

      public static HtmlTree MAIN(HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a MAIN tag with role attribute, style attribute and some content.
      Parameters:
      styleClass - style of the MAIN tag
      body - content of the MAIN tag
      Returns:
      an HtmlTree object for the MAIN tag
    • META

      public static HtmlTree META(String httpEquiv, String content, String charSet)
      Deprecated.
      Generates a META tag with the http-equiv, content and charset attributes.
      Parameters:
      httpEquiv - http equiv attribute for the META tag
      content - type of content
      charSet - character set used
      Returns:
      an HtmlTree object for the META tag
    • META

      public static HtmlTree META(String name, String content)
      Deprecated.
      Generates a META tag with the name and content attributes.
      Parameters:
      name - name attribute
      content - type of content
      Returns:
      an HtmlTree object for the META tag
    • NOSCRIPT

      public static HtmlTree NOSCRIPT(Content body)
      Deprecated.
      Generates a NOSCRIPT tag with some content.
      Parameters:
      body - content of the noscript tag
      Returns:
      an HtmlTree object for the NOSCRIPT tag
    • P

      public static HtmlTree P(Content body)
      Deprecated.
      Generates a P tag with some content.
      Parameters:
      body - content of the Paragraph tag
      Returns:
      an HtmlTree object for the P tag
    • P

      public static HtmlTree P(HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a P tag with some content.
      Parameters:
      styleClass - style of the Paragraph tag
      body - content of the Paragraph tag
      Returns:
      an HtmlTree object for the P tag
    • SCRIPT

      public static HtmlTree SCRIPT(String src)
      Deprecated.
      Generates a SCRIPT tag with the type and src attributes.
      Parameters:
      type - type of link
      src - the path for the script
      Returns:
      an HtmlTree object for the SCRIPT tag
    • SCRIPT

      public static HtmlTree SCRIPT()
      Deprecated.
      Generates a SCRIPT tag with the type attribute.
      Returns:
      an HtmlTree object for the SCRIPT tag
    • SECTION

      public static HtmlTree SECTION()
      Deprecated.
      Generates a SECTION tag with role attribute.
      Returns:
      an HtmlTree object for the SECTION tag
    • SECTION

      public static HtmlTree SECTION(Content body)
      Deprecated.
      Generates a SECTION tag with role attribute and some content.
      Parameters:
      body - content of the section tag
      Returns:
      an HtmlTree object for the SECTION tag
    • SMALL

      public static HtmlTree SMALL(Content body)
      Deprecated.
      Generates a SMALL tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the SMALL tag
    • SPAN

      public static HtmlTree SPAN(Content body)
      Deprecated.
      Generates a SPAN tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the SPAN tag
    • SPAN

      public static HtmlTree SPAN(HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a SPAN tag with style class attribute and some content.
      Parameters:
      styleClass - style class for the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the SPAN tag
    • SPAN

      public static HtmlTree SPAN(String id, HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a SPAN tag with id and style class attributes. It also encloses a content.
      Parameters:
      id - the id for the tag
      styleClass - stylesheet class for the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the SPAN tag
    • TABLE

      public static HtmlTree TABLE(HtmlStyle styleClass, String summary, Content body)
      Deprecated.
      Generates a Table tag with style class and summary attributes and some content.
      Parameters:
      styleClass - style of the table
      summary - summary for the table
      body - content for the table
      Returns:
      an HtmlTree object for the TABLE tag
    • TABLE

      public static HtmlTree TABLE(HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a Table tag with style class attribute and some content.
      Parameters:
      styleClass - style of the table
      body - content for the table
      Returns:
      an HtmlTree object for the TABLE tag
    • TD

      public static HtmlTree TD(HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a TD tag with style class attribute and some content.
      Parameters:
      styleClass - style for the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the TD tag
    • TD

      public static HtmlTree TD(Content body)
      Deprecated.
      Generates a TD tag for an HTML table with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the TD tag
    • TH

      public static HtmlTree TH(HtmlStyle styleClass, String scope, Content body)
      Deprecated.
      Generates a TH tag with style class and scope attributes and some content.
      Parameters:
      styleClass - style for the tag
      scope - scope of the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the TH tag
    • TH

      public static HtmlTree TH(String scope, Content body)
      Deprecated.
      Generates a TH tag with scope attribute and some content.
      Parameters:
      scope - scope of the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the TH tag
    • TITLE

      public static HtmlTree TITLE(Content body)
      Deprecated.
      Generates a TITLE tag with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the TITLE tag
    • TR

      public static HtmlTree TR(Content body)
      Deprecated.
      Generates a TR tag for an HTML table with some content.
      Parameters:
      body - content for the tag
      Returns:
      an HtmlTree object for the TR tag
    • UL

      public static HtmlTree UL(HtmlStyle styleClass, Content body)
      Deprecated.
      Generates a UL tag with the style class attribute and some content.
      Parameters:
      styleClass - style for the tag
      body - content for the tag
      Returns:
      an HtmlTree object for the UL tag
    • isEmpty

      public boolean isEmpty()
      Deprecated.
      Returns true if the content is empty.
      Specified by:
      isEmpty in class Content
      Returns:
      true if no content to be displayed else return false
    • hasContent

      public boolean hasContent()
      Deprecated.
      Returns true if the HTML tree has content.
      Returns:
      true if the HTML tree has content else return false
    • hasAttrs

      public boolean hasAttrs()
      Deprecated.
      Returns true if the HTML tree has attributes.
      Returns:
      true if the HTML tree has attributes else return false
    • hasAttr

      public boolean hasAttr(HtmlAttr attrName)
      Deprecated.
      Returns true if the HTML tree has a specific attribute.
      Parameters:
      attrName - name of the attribute to check within the HTML tree
      Returns:
      true if the HTML tree has the specified attribute else return false
    • isValid

      public boolean isValid()
      Deprecated.
      Returns true if the HTML tree is valid. This check is more specific to standard doclet and not exactly similar to W3C specifications. But it ensures HTML validation.
      Overrides:
      isValid in class Content
      Returns:
      true if the HTML tree is valid
    • isInline

      public boolean isInline()
      Deprecated.
      Returns true if the element is an inline element.
      Returns:
      true if the HTML tag is an inline element
    • write

      public boolean write(Writer out, boolean atNewline) throws IOException
      Deprecated.
      Writes content to a writer.
      Specified by:
      write in class Content
      Throws:
      IOException
    • stripHtml

      private static String stripHtml(Content body)
      Deprecated.
      Given a Content node, strips all html characters and return the result.
      Parameters:
      body - The content node to check.
      Returns:
      the plain text from the content node