/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Class for generating HTML tree for javadoc output.
*
* @author Bhavesh Patel
*/
/**
* Constructor to construct HtmlTree object.
*
* @param tag HTML tag for the HtmlTree object
*/
}
/**
* Constructor to construct HtmlTree object.
*
* @param tag HTML tag for the HtmlTree object
* @param contents contents to be added to the tree
*/
this(tag);
}
/**
* Adds an attribute for the HTML tag.
*
* @param attrName name of the attribute
* @param attrValue value of the attribute
*/
}
/**
* Adds a style for the HTML tag.
*
* @param style style to be added
*/
}
/**
* Adds content for the HTML tag.
*
* @param tagContent tag content to be added
*/
}
}
/**
* 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.
*
* @param stringContent string content that needs to be added
*/
if (lastContent instanceof StringContent)
else
}
else
}
/**
* Generates an HTML anchor tag.
*
* @param ref reference url for the anchor tag
* @param body content for the anchor tag
* @return an HtmlTree object
*/
return htmltree;
}
/**
* Generates an HTML anchor tag with name attribute and content.
*
* @param name name for the anchor tag
* @param body content for the anchor tag
* @return an HtmlTree object
*/
return htmltree;
}
/**
* Generates an HTML anchor tag with name attribute.
*
* @param name name for the anchor tag
* @return an HtmlTree object
*/
return htmltree;
}
/**
* Generates a CAPTION tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the CAPTION tag
*/
return htmltree;
}
/**
* Generates a CODE tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the CODE tag
*/
return htmltree;
}
/**
* Generates a DD tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the DD tag
*/
return htmltree;
}
/**
* Generates a DL tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the DL tag
*/
return htmltree;
}
/**
* Generates a DIV tag with the style class attributes. It also encloses
* a content.
*
* @param styleClass stylesheet class for the tag
* @param body content for the tag
* @return an HtmlTree object for the DIV tag
*/
if (styleClass != null)
return htmltree;
}
/**
* Generates a DIV tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the DIV tag
*/
}
/**
* Generates a DT tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the DT tag
*/
return htmltree;
}
/**
* Generates a EM tag with some content.
*
* @param body content to be added to the tag
* @return an HtmlTree object for the EM tag
*/
return htmltree;
}
/**
* Generates a FRAME tag.
*
* @param src the url of the document to be shown in the frame
* @param name specifies the name of the frame
* @param title the title for the frame
* @param scrolling specifies whether to display scrollbars in the frame
* @return an HtmlTree object for the FRAME tag
*/
return htmltree;
}
/**
* Generates a Frame tag.
*
* @param src the url of the document to be shown in the frame
* @param name specifies the name of the frame
* @param title the title for the frame
* @return an HtmlTree object for the SPAN tag
*/
}
/**
* Generates a FRAMESET tag.
*
* @param cols the size of columns in the frameset
* @param rows the size of rows in the frameset
* @param title the title for the frameset
* @param onload the script to run when the document loads
* @return an HtmlTree object for the FRAMESET tag
*/
return htmltree;
}
/**
* Generates a heading tag (h1 to h6) with the title and style class attributes. It also encloses
* a content.
*
* @param headingTag the heading tag to be generated
* @param printTitle true if title for the tag needs to be printed else false
* @param styleClass stylesheet class for the tag
* @param body content for the tag
* @return an HtmlTree object for the tag
*/
if (printTitle)
if (styleClass != null)
return htmltree;
}
/**
* Generates a heading tag (h1 to h6) with style class attribute. It also encloses
* a content.
*
* @param headingTag the heading tag to be generated
* @param styleClass stylesheet class for the tag
* @param body content for the tag
* @return an HtmlTree object for the tag
*/
}
/**
* Generates a heading tag (h1 to h6) with the title attribute. It also encloses
* a content.
*
* @param headingTag the heading tag to be generated
* @param printTitle true if the title for the tag needs to be printed else false
* @param body content for the tag
* @return an HtmlTree object for the tag
*/
}
/**
* Generates a heading tag (h1 to h6) with some content.
*
* @param headingTag the heading tag to be generated
* @param body content for the tag
* @return an HtmlTree object for the tag
*/
}
/**
* Generates an HTML tag with lang attribute. It also adds head and body
* content to the HTML tree.
*
* @param lang language for the HTML document
* @param head head for the HTML tag
* @param body body for the HTML tag
* @return an HtmlTree object for the HTML tag
*/
return htmltree;
}
/**
* Generates a I tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the I tag
*/
return htmltree;
}
/**
* Generates a LI tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the LI tag
*/
}
/**
* Generates a LI tag with some content.
*
* @param styleClass style for the tag
* @param body content for the tag
* @return an HtmlTree object for the LI tag
*/
if (styleClass != null)
return htmltree;
}
/**
* Generates a LINK tag with the rel, type, href and title attributes.
*
* @param rel relevance of the link
* @param type type of link
* @param href the path for the link
* @param title title for the link
* @return an HtmlTree object for the LINK tag
*/
return htmltree;
}
/**
* Generates a META tag with the http-equiv, content and charset attributes.
*
* @param http-equiv http equiv attribute for the META tag
* @param content type of content
* @param charset character set used
* @return an HtmlTree object for the META tag
*/
return htmltree;
}
/**
* Generates a META tag with the name and content attributes.
*
* @param name name attribute
* @param content type of content
* @return an HtmlTree object for the META tag
*/
return htmltree;
}
/**
* Generates a NOSCRIPT tag with some content.
*
* @param body content of the noscript tag
* @return an HtmlTree object for the NOSCRIPT tag
*/
return htmltree;
}
/**
* Generates a P tag with some content.
*
* @param body content of the Paragraph tag
* @return an HtmlTree object for the P tag
*/
}
/**
* Generates a P tag with some content.
*
* @param styleClass style of the Paragraph tag
* @param body content of the Paragraph tag
* @return an HtmlTree object for the P tag
*/
if (styleClass != null)
return htmltree;
}
/**
* Generates a SMALL tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the SMALL tag
*/
return htmltree;
}
/**
* Generates a STRONG tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the STRONG tag
*/
return htmltree;
}
/**
* Generates a SPAN tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the SPAN tag
*/
}
/**
* Generates a SPAN tag with style class attribute and some content.
*
* @param styleClass style class for the tag
* @param body content for the tag
* @return an HtmlTree object for the SPAN tag
*/
if (styleClass != null)
return htmltree;
}
/**
* Generates a Table tag with border, width and summary attributes and
* some content.
*
* @param border border for the table
* @param width width of the table
* @param summary summary for the table
* @param body content for the table
* @return an HtmlTree object for the TABLE tag
*/
return htmltree;
}
/**
* Generates a Table tag with style class, border, cell padding,
* cellspacing and summary attributes and some content.
*
* @param styleClass style of the table
* @param border border for the table
* @param cellPadding cell padding for the table
* @param cellSpacing cell spacing for the table
* @param summary summary for the table
* @param body content for the table
* @return an HtmlTree object for the TABLE tag
*/
if (styleClass != null)
return htmltree;
}
/**
* Generates a Table tag with border, cell padding,
* cellspacing and summary attributes and some content.
*
* @param border border for the table
* @param cellPadding cell padding for the table
* @param cellSpacing cell spacing for the table
* @param summary summary for the table
* @param body content for the table
* @return an HtmlTree object for the TABLE tag
*/
}
/**
* Generates a TD tag with style class attribute and some content.
*
* @param styleClass style for the tag
* @param body content for the tag
* @return an HtmlTree object for the TD tag
*/
if (styleClass != null)
return htmltree;
}
/**
* Generates a TD tag for an HTML table with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the TD tag
*/
}
/**
* Generates a TH tag with style class and scope attributes and some content.
*
* @param styleClass style for the tag
* @param scope scope of the tag
* @param body content for the tag
* @return an HtmlTree object for the TH tag
*/
if (styleClass != null)
return htmltree;
}
/**
* Generates a TH tag with scope attribute and some content.
*
* @param scope scope of the tag
* @param body content for the tag
* @return an HtmlTree object for the TH tag
*/
}
/**
* Generates a TITLE tag with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the TITLE tag
*/
return htmltree;
}
/**
* Generates a TR tag for an HTML table with some content.
*
* @param body content for the tag
* @return an HtmlTree object for the TR tag
*/
return htmltree;
}
/**
* Generates a UL tag with the style class attribute and some content.
*
* @param styleClass style for the tag
* @param body content for the tag
* @return an HtmlTree object for the UL tag
*/
return htmltree;
}
/**
* {@inheritDoc}
*/
public boolean isEmpty() {
return (!hasContent() && !hasAttrs());
}
/**
* Returns true if the HTML tree has content.
*
* @return true if the HTML tree has content else return false
*/
public boolean hasContent() {
}
/**
* Returns true if the HTML tree has attributes.
*
* @return true if the HTML tree has attributes else return false
*/
public boolean hasAttrs() {
}
/**
* Returns true if the HTML tree has a specific attribute.
*
* @param attrName name of the attribute to check within the HTML tree
* @return true if the HTML tree has the specified attribute else return false
*/
}
/**
* 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.
*
* @return true if the HTML tree is valid
*/
public boolean isValid() {
switch (htmlTag) {
case A :
case BR :
case FRAME :
case HR :
return (!hasContent());
case IMG :
case LINK :
case META :
default :
return hasContent();
}
}
/**
* Returns true if the element is an inline element.
*
* @return true if the HTML tag is an inline element
*/
public boolean isInline() {
}
/**
* {@inheritDoc}
*/
}
}
c.write(contentBuilder);
if (htmlTag.endTagRequired()) {
}
if (!isInline())
}
}