Java 类javax.swing.text.ChangedCharSetException 实例源码

项目:javify    文件:Parser.java   
/**
 * A hooks for operations, preceeding call to handleEmptyTag().
 * Handle the tag with no content, like <br>. As no any
 * nested tags are expected, the tag validator is not involved.
 * @param tag The tag being handled.
 */
private void _handleEmptyTag(TagElement tag)
{
  try
    {
      validator.validateTag(tag, attributes);
      handleEmptyTag(tag);
      HTML.Tag h = tag.getHTMLTag();
      // When a block tag is closed, consume whitespace that follows after
      // it.
      // For some unknown reason a FRAME tag is not treated as block element.
      // However in this case it should be treated as such.
      if (isBlock(h))
        optional(WS);
    }
  catch (ChangedCharSetException ex)
    {
      error("Changed charset exception:", ex.getMessage());
    }
}
项目:jvm-stm    文件:Parser.java   
/**
 * A hooks for operations, preceeding call to handleEmptyTag().
 * Handle the tag with no content, like <br>. As no any
 * nested tags are expected, the tag validator is not involved.
 * @param tag The tag being handled.
 */
private void _handleEmptyTag(TagElement tag)
{
  try
    {
      validator.validateTag(tag, attributes);
      handleEmptyTag(tag);
      HTML.Tag h = tag.getHTMLTag();
      // When a block tag is closed, consume whitespace that follows after
      // it.
      // For some unknown reason a FRAME tag is not treated as block element.
      // However in this case it should be treated as such.
      if (isBlock(h))
        optional(WS);
    }
  catch (ChangedCharSetException ex)
    {
      error("Changed charset exception:", ex.getMessage());
    }
}
项目:swingbox-javahelp-viewer    文件:BrowserPane.java   
void read(InputStream in, Document doc) throws IOException
{
    EditorKit kit = getEditorKit();

    try
    {
        kit.read(in, doc, 0);

    } catch (ChangedCharSetException ccse)
    {
        // ignored, may be in the future will be processed
        throw ccse;
    } catch (BadLocationException ble)
    {
        throw new IOException(ble);
    }

}
项目:cn1    文件:DocumentParser.java   
protected void handleEmptyTag(final TagElement tag)
        throws ChangedCharSetException {
    if (!ignoreCharSet && (tag.getHTMLTag() == HTML.Tag.META)) {
        String httpEquivValue = (String) getAttributes().getAttribute(HTTP_EQUIV);
        String contentValue = (String) getAttributes().getAttribute(CONTENT);

        if (httpEquivValue != null && contentValue != null &&
                httpEquivValue.equalsIgnoreCase(CONTENT_TYPE) &&
                contentValue.toLowerCase().contains(CHARSET)) {
            // notice that always here ignoreCharSet will be false 
            throw new ChangedCharSetException(contentValue, ignoreCharSet); 
        }
    }
    callback.handleSimpleTag(
            tag.getHTMLTag(), getAttributes(), getCurrentPos());
}
项目:JamVM-PH    文件:Parser.java   
/**
 * A hooks for operations, preceeding call to handleEmptyTag().
 * Handle the tag with no content, like <br>. As no any
 * nested tags are expected, the tag validator is not involved.
 * @param tag The tag being handled.
 */
private void _handleEmptyTag(TagElement tag)
{
  try
    {
      validator.validateTag(tag, attributes);
      handleEmptyTag(tag);
      HTML.Tag h = tag.getHTMLTag();
      // When a block tag is closed, consume whitespace that follows after
      // it.
      // For some unknown reason a FRAME tag is not treated as block element.
      // However in this case it should be treated as such.
      if (isBlock(h))
        optional(WS);
    }
  catch (ChangedCharSetException ex)
    {
      error("Changed charset exception:", ex.getMessage());
    }
}
项目:SwingBox    文件:BrowserPane.java   
void read(InputStream in, Document doc) throws IOException
{
    EditorKit kit = getEditorKit();

    try
    {
        kit.read(in, doc, 0);

    } catch (ChangedCharSetException ccse)
    {
        // ignored, may be in the future will be processed
        throw ccse;
    } catch (BadLocationException ble)
    {
        throw new IOException(ble);
    }

}
项目:classpath    文件:Parser.java   
/**
 * A hooks for operations, preceeding call to handleEmptyTag().
 * Handle the tag with no content, like <br>. As no any
 * nested tags are expected, the tag validator is not involved.
 * @param tag The tag being handled.
 */
private void _handleEmptyTag(TagElement tag)
{
  try
    {
      validator.validateTag(tag, attributes);
      handleEmptyTag(tag);
      HTML.Tag h = tag.getHTMLTag();
      // When a block tag is closed, consume whitespace that follows after
      // it.
      // For some unknown reason a FRAME tag is not treated as block element.
      // However in this case it should be treated as such.
      if (isBlock(h))
        optional(WS);
    }
  catch (ChangedCharSetException ex)
    {
      error("Changed charset exception:", ex.getMessage());
    }
}
项目:freeVM    文件:DocumentParser.java   
protected void handleEmptyTag(final TagElement tag)
        throws ChangedCharSetException {
    if (!ignoreCharSet && (tag.getHTMLTag() == HTML.Tag.META)) {
        String httpEquivValue = (String) getAttributes().getAttribute(HTTP_EQUIV);
        String contentValue = (String) getAttributes().getAttribute(CONTENT);

        if (httpEquivValue != null && contentValue != null &&
                httpEquivValue.equalsIgnoreCase(CONTENT_TYPE) &&
                contentValue.toLowerCase().contains(CHARSET)) {
            // notice that always here ignoreCharSet will be false 
            throw new ChangedCharSetException(contentValue, ignoreCharSet); 
        }
    }
    callback.handleSimpleTag(
            tag.getHTMLTag(), getAttributes(), getCurrentPos());
}
项目:freeVM    文件:DocumentParser.java   
protected void handleEmptyTag(final TagElement tag)
        throws ChangedCharSetException {
    if (!ignoreCharSet && (tag.getHTMLTag() == HTML.Tag.META)) {
        String httpEquivValue = (String) getAttributes().getAttribute(HTTP_EQUIV);
        String contentValue = (String) getAttributes().getAttribute(CONTENT);

        if (httpEquivValue != null && contentValue != null &&
                httpEquivValue.equalsIgnoreCase(CONTENT_TYPE) &&
                contentValue.toLowerCase().contains(CHARSET)) {
            // notice that always here ignoreCharSet will be false 
            throw new ChangedCharSetException(contentValue, ignoreCharSet); 
        }
    }
    callback.handleSimpleTag(
            tag.getHTMLTag(), getAttributes(), getCurrentPos());
}
项目:lexml-swing-editorhtml    文件:EkitCore.java   
private void openDocument(File whatFile, HTMLEditorKit.ParserCallback cb)
        throws IOException, BadLocationException {
    if (whatFile == null) {
        whatFile = getFileFromChooser(".", JFileChooser.OPEN_DIALOG,
                extsHTML, Translatrix.getTranslationString("FiletypeHTML"));
    }
    if (whatFile != null) {
        try {
            loadDocument(whatFile, null, cb);
        } catch (ChangedCharSetException ccse) {
            String charsetType = ccse.getCharSetSpec().toLowerCase();
            int pos = charsetType.indexOf("charset");
            if (pos == -1) {
                throw ccse;
            }
            while (pos < charsetType.length()
                    && charsetType.charAt(pos) != '=') {
                pos++;
            }
            pos++; // Places file cursor past the equals sign (=)
            String whatEncoding = charsetType.substring(pos).trim();
            loadDocument(whatFile, whatEncoding, cb);
        }
    }
    refreshOnUpdate();
}
项目:OpenJSharp    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:OpenJSharp    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:jdk8u-jdk    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:jdk8u-jdk    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:openjdk-jdk10    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:openjdk-jdk10    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:openjdk9    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:openjdk9    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:Java8CN    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:Java8CN    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:jdk8u_jdk    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:jdk8u_jdk    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:lookaside_java-1.8.0-openjdk    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:javify    文件:Parser.java   
/**
 * This should fire additional actions in response to the
 * ChangedCharSetException.  The current implementation
 * does nothing.
 * @param tag
 */
private void startingTag(TagElement tag)
{
  try
    {
      startTag(tag);
    }
  catch (ChangedCharSetException cax)
    {
      error("Invalid change of charset");
    }
}
项目:jvm-stm    文件:Parser.java   
/**
 * This should fire additional actions in response to the
 * ChangedCharSetException.  The current implementation
 * does nothing.
 * @param tag
 */
private void startingTag(TagElement tag)
{
  try
    {
      startTag(tag);
    }
  catch (ChangedCharSetException cax)
    {
      error("Invalid change of charset");
    }
}
项目:Convert-For-Each-Loop-to-Lambda-Expression-Eclipse-Plugin    文件:A.java   
void m() throws IOException {
    Collection c = null;
    for (Object object : c) {
        try{
            throw new IOException();
        }catch(ChangedCharSetException e){

        }
    }
}
项目:infobip-open-jdk-8    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:infobip-open-jdk-8    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:jdk8u-dev-jdk    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:jdk8u-dev-jdk    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:jdk7-jdk    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:jdk7-jdk    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:openjdk-source-code-learn    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:openjdk-source-code-learn    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:OLD-OpenJDK8    文件:Parser.java   
/**
 * Create a legal context for a tag.
 */
void legalTagContext(TagElement tag) throws ChangedCharSetException {
    if (legalElementContext(tag.getElement())) {
        markFirstTime(tag.getElement());
        return;
    }

    // Avoid putting a block tag in a flow tag.
    if (tag.breaksFlow() && (stack != null) && !stack.tag.breaksFlow()) {
        endTag(true);
        legalTagContext(tag);
        return;
    }

    // Avoid putting something wierd in the head of the document.
    for (TagStack s = stack ; s != null ; s = s.next) {
        if (s.tag.getElement() == dtd.head) {
            while (stack != s) {
                endTag(true);
            }
            endTag(true);
            legalTagContext(tag);
            return;
        }
    }

    // Everything failed
    error("tag.unexpected", tag.getElement().getName());
}
项目:OLD-OpenJDK8    文件:Parser.java   
/**
 * Error context. Something went wrong, make sure we are in
 * the document's body context
 */
void errorContext() throws ChangedCharSetException {
    for (; (stack != null) && (stack.tag.getElement() != dtd.body) ; stack = stack.next) {
        handleEndTag(stack.tag);
    }
    if (stack == null) {
        legalElementContext(dtd.body);
        startTag(makeTag(dtd.body, true));
    }
}
项目:cn1    文件:HTMLParser.java   
@Override
protected void handleEmptyTag(TagElement tag) throws ChangedCharSetException {

    HTML.Tag htmlTag = tag.getHTMLTag();
    if (appletInfo != null && htmlTag == HTML.Tag.PARAM) {
        SimpleAttributeSet attributes = getAttributes();
        appletInfo.setParameter((String)attributes.getAttribute(HTML.Attribute.NAME), 
            (String)attributes.getAttribute(HTML.Attribute.VALUE));
    }

}
项目:cn1    文件:Parser.java   
protected void startTag(final TagElement tag)
        throws ChangedCharSetException {

    if (isCurrentTagSimple) {
        handleEmptyTag(tag);
    } else {
        handleStartTag(tag);
    }

}
项目:cn1    文件:Parser.java   
/**
 * This method is called by the lexer, when a token that looks like
 * a closing tag is found in the parsed stream.
 * 
 * @param htmlTag a {@link HTMLTag} element that contains all the
 * information related to the closing tag, that was found in the parsed
 * stream.
 * 
 */
public void iHaveNewEndTag(final HTMLTag htmlTag) {
    currentLine = htmlTag.getLine() + 1;
    String tagName = htmlTag.getName();
    Element element = dtd.elementHash.get(tagName);
    TagElement currentTag;
    if (element != null) {
        currentTag = new TagElement(element);
        flushHtmlText(currentTag.breaksFlow());
    } else {
        handleUnrecognizedError(htmlTag);
        element = new Element(
                -1, tagName, false, false, null, null, -1, null, null, null);
        currentTag = new TagElement(element);
        flushHtmlText(currentTag.breaksFlow());
        try {
            attributes.addAttribute("endtag", Boolean.TRUE);
            handleEmptyTag(currentTag);
        } catch (ChangedCharSetException e) {
            // this shouldn't happen
            throw new AssertionError();
        }
    }

    currentStartPos = htmlTag.getOffset();
    currentEndPos = htmlTag.getEndPos();

    boolean mustBeReported = 
        manageEndElement(element);

    if (mustBeReported) {
        handleEndTag(currentTag);
    }
}