org.cyberneko.html
public class HTMLTagBalancer extends Object implements XMLDocumentFilter, HTMLComponent
This component recognizes the following features:
This component recognizes the following properties:
Version: $Id: HTMLTagBalancer.java,v 1.20 2005/02/14 04:06:22 andyc Exp $
Nested Class Summary | |
---|---|
static class | HTMLTagBalancer.Info
Element info for each start element. |
static class | HTMLTagBalancer.InfoStack Unsynchronized stack of element information. |
Field Summary | |
---|---|
protected static String | AUGMENTATIONS Include infoset augmentations. |
protected static String | DOCUMENT_FRAGMENT Document fragment balancing only. |
protected static String | DOCUMENT_FRAGMENT_DEPRECATED Document fragment balancing only (deprecated). |
protected static String | ERROR_REPORTER Error reporter. |
protected boolean | fAugmentations Include infoset augmentations. |
protected boolean | fDocumentFragment Document fragment balancing only. |
protected XMLDocumentHandler | fDocumentHandler The document handler. |
protected XMLDocumentSource | fDocumentSource The document source. |
protected HTMLTagBalancer.InfoStack | fElementStack The element stack. |
protected HTMLErrorReporter | fErrorReporter Error reporter. |
protected boolean | fIgnoreOutsideContent Ignore outside content. |
protected HTMLTagBalancer.InfoStack | fInlineStack The inline stack. |
protected short | fNamesAttrs Modify HTML attribute names. |
protected short | fNamesElems Modify HTML element names. |
protected boolean | fNamespaces Namespaces. |
protected boolean | fReportErrors Report errors. |
protected boolean | fSeenAnything True if seen anything. |
protected boolean | fSeenBodyElement True if seen <body< element. |
protected boolean | fSeenDoctype True if root element has been seen. |
protected boolean | fSeenHeadElement True if seen <head< element. |
protected boolean | fSeenRootElement True if root element has been seen. |
protected boolean | fSeenRootElementEnd
True if seen the end of the document element. |
protected static String | IGNORE_OUTSIDE_CONTENT Ignore outside content. |
protected static String | NAMESPACES Namespaces. |
protected static String | NAMES_ATTRS Modify HTML attribute names: { "upper", "lower", "default" }. |
protected static String | NAMES_ELEMS Modify HTML element names: { "upper", "lower", "default" }. |
protected static short | NAMES_LOWERCASE Lowercase HTML names. |
protected static short | NAMES_MATCH Match HTML element names. |
protected static short | NAMES_NO_CHANGE Don't modify HTML names. |
protected static short | NAMES_UPPERCASE Uppercase HTML names. |
protected static String | REPORT_ERRORS Report errors. |
protected static HTMLEventInfo | SYNTHESIZED_ITEM Synthesized event info item. |
Method Summary | |
---|---|
protected void | callEndElement(QName element, Augmentations augs) Call document handler end element. |
protected void | callStartElement(QName element, XMLAttributes attrs, Augmentations augs) Call document handler start element. |
void | characters(XMLString text, Augmentations augs) Characters. |
void | comment(XMLString text, Augmentations augs) Comment. |
void | doctypeDecl(String rootElementName, String publicId, String systemId, Augmentations augs) Doctype declaration. |
protected XMLAttributes | emptyAttributes() Returns a set of empty attributes. |
void | emptyElement(QName elem, XMLAttributes attrs, Augmentations augs) Empty element. |
void | endCDATA(Augmentations augs) End CDATA section. |
void | endDocument(Augmentations augs) End document. |
void | endElement(QName element, Augmentations augs) End element. |
void | endGeneralEntity(String name, Augmentations augs) End entity. |
void | endPrefixMapping(String prefix, Augmentations augs) End prefix mapping. |
XMLDocumentHandler | getDocumentHandler() Returns the document handler. |
XMLDocumentSource | getDocumentSource() Returns the document source. |
protected HTMLElements.Element | getElement(String name) Returns an HTML element. |
protected int | getElementDepth(HTMLElements.Element element)
Returns the depth of the open tag associated with the specified
element name or -1 if no matching element is found.
|
Boolean | getFeatureDefault(String featureId) Returns the default state for a feature. |
protected static short | getNamesValue(String value)
Converts HTML names string value to constant value.
|
protected int | getParentDepth(HTMLElements.Element[] parents, short bounds)
Returns the depth of the open tag associated with the specified
element parent names or -1 if no matching element is found.
|
Object | getPropertyDefault(String propertyId) Returns the default state for a property. |
String[] | getRecognizedFeatures() Returns recognized features. |
String[] | getRecognizedProperties() Returns recognized properties. |
void | ignorableWhitespace(XMLString text, Augmentations augs) Ignorable whitespace. |
protected static String | modifyName(String name, short mode) Modifies the given name based on the specified mode. |
void | processingInstruction(String target, XMLString data, Augmentations augs) Processing instruction. |
void | reset(XMLComponentManager manager) Resets the component. |
void | setDocumentHandler(XMLDocumentHandler handler) Sets the document handler. |
void | setDocumentSource(XMLDocumentSource source) Sets the document source. |
void | setFeature(String featureId, boolean state) Sets a feature. |
void | setProperty(String propertyId, Object value) Sets a property. |
void | startCDATA(Augmentations augs) Start CDATA section. |
void | startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) Start document. |
void | startDocument(XMLLocator locator, String encoding, Augmentations augs) Start document. |
void | startElement(QName elem, XMLAttributes attrs, Augmentations augs) Start element. |
void | startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs) Start entity. |
void | startPrefixMapping(String prefix, String uri, Augmentations augs) Start prefix mapping. |
protected Augmentations | synthesizedAugs() Returns an augmentations object with a synthesized item added. |
void | textDecl(String version, String encoding, Augmentations augs) Text declaration. |
void | xmlDecl(String version, String encoding, String standalone, Augmentations augs) XML declaration. |
Parameters: element The element.
See Also: NAMES_NO_CHANGE NAMES_LOWERCASE NAMES_UPPERCASE
Parameters: parents The parent elements.