au.id.jericho.lib.html
Class EndTag

java.lang.Object
  extended byau.id.jericho.lib.html.Segment
      extended byau.id.jericho.lib.html.Tag
          extended byau.id.jericho.lib.html.EndTag
All Implemented Interfaces:
java.lang.CharSequence, java.lang.Comparable

public final class EndTag
extends Tag

Represents the end tag of an Element.

Created using the StartTag.findEndTag(), Source.findPreviousEndTag(int pos, String name) or Source.findNextEndTag(int pos, String name) method.

See also the XML 1.0 specification for end tags.

See Also:
StartTag, Element

Field Summary
 
Fields inherited from class au.id.jericho.lib.html.Tag
A, ABBR, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, DD, DEL, DFN, DIR, DIV, DL, DOCTYPE_DECLARATION, DT, EM, FIELDSET, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IFRAME, IMG, INPUT, INS, ISINDEX, KBD, LABEL, LEGEND, LI, LINK, MAP, MENU, META, NOFRAMES, NOSCRIPT, OBJECT, OL, OPTGROUP, OPTION, P, PARAM, PRE, PROCESSING_INSTRUCTION, Q, S, SAMP, SCRIPT, SELECT, SERVER_COMMON, SERVER_MASON_COMPONENT_CALL, SERVER_MASON_COMPONENT_CALLED_WITH_CONTENT, SERVER_MASON_NAMED_BLOCK, SERVER_PHP, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XML_DECLARATION
 
Method Summary
static java.lang.String generateHTML(java.lang.String tagName)
          Generates the HTML text of an end tag with the specified tag name.
 java.lang.String getDebugInfo()
          Returns a string representation of this object useful for debugging purposes.
static boolean isForbidden(java.lang.String name)
          Indicates whether an end tag of the given name is forbidden according to the HTML specification.
static boolean isOptional(java.lang.String name)
          Indicates whether an end tag of the given name is optional according to the HTML specification.
static boolean isRequired(java.lang.String name)
          Indicates whether an end tag of the given name is required according to the HTML specification.
 
Methods inherited from class au.id.jericho.lib.html.Tag
getName
 
Methods inherited from class au.id.jericho.lib.html.Segment
charAt, compareTo, encloses, encloses, equals, findAllCharacterReferences, findAllComments, findAllElements, findAllElements, findAllStartTags, findAllStartTags, findAllStartTags, findFormControls, findFormFields, findWords, getBegin, getEnd, getSourceText, getSourceTextNoWhitespace, hashCode, ignoreWhenParsing, isComment, isWhiteSpace, length, parseAttributes, subSequence, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

isForbidden

public static boolean isForbidden(java.lang.String name)
Indicates whether an end tag of the given name is forbidden according to the HTML specification.

An overview of this information for all tags can be found in the HTML index of elements.

Returns:
true if an end tag of the given name is forbidden, otherwise false.

isOptional

public static boolean isOptional(java.lang.String name)
Indicates whether an end tag of the given name is optional according to the HTML specification.

An overview of this information for all tags can be found in the HTML index of elements.

Returns:
true if an end tag of the given name is optional, otherwise false.

isRequired

public static boolean isRequired(java.lang.String name)
Indicates whether an end tag of the given name is required according to the HTML specification.

An overview of this information for all tags can be found in the HTML index of elements. It is assumed that an end tag is required if it is not forbidden or optional.

Returns:
true if an end tag of the given name is required, otherwise false.

generateHTML

public static java.lang.String generateHTML(java.lang.String tagName)
Generates the HTML text of an end tag with the specified tag name.

Example:

The following method call:

EndTag.generateHTML("INPUT")

returns the following output:

</INPUT>

Parameters:
tagName - the name of the start tag.
Returns:
the HTML text of an end tag with the specified tag name.
See Also:
StartTag.generateHTML(String tagName, Map attributesMap, boolean emptyElementTag)

getDebugInfo

public java.lang.String getDebugInfo()
Description copied from class: Segment
Returns a string representation of this object useful for debugging purposes.

Overrides:
getDebugInfo in class Segment
Returns:
a string representation of this object useful for debugging purposes.