Package nu.validator.htmlparser.impl
Class TreeBuilder<T>
- java.lang.Object
-
- nu.validator.htmlparser.impl.TreeBuilder<T>
-
- All Implemented Interfaces:
TokenHandler,TreeBuilderState<T>
- Direct Known Subclasses:
CoalescingTreeBuilder,SAXStreamer,SAXTreeBuilder
public abstract class TreeBuilder<T> extends java.lang.Object implements TokenHandler, TreeBuilderState<T>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intA(package private) static intADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_NAV_OR_SECTION_OR_SUMMARYprivate static intAFTER_AFTER_BODYprivate static intAFTER_AFTER_FRAMESETprivate static intAFTER_BODYprivate static intAFTER_FRAMESETprivate static intAFTER_HEAD(package private) static intANNOTATION_XML(package private) static intAREA_OR_WBR(package private) static intB_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U(package private) static intBASEprivate static intBEFORE_HEADprivate static intBEFORE_HTML(package private) static intBODY(package private) static intBR(package private) static intBUTTON(package private) static intCAPTIONprotected char[]charBufferprotected intcharBufferLenprivate static intCHARSET_Aprivate static intCHARSET_Cprivate static intCHARSET_DOUBLE_QUOTEDprivate static intCHARSET_Eprivate static intCHARSET_EQUALSprivate static intCHARSET_Hprivate static intCHARSET_INITIALprivate static intCHARSET_Rprivate static intCHARSET_Sprivate static intCHARSET_SINGLE_QUOTEDprivate static intCHARSET_Tprivate static intCHARSET_UNQUOTED(package private) static intCOL(package private) static intCOLGROUP(package private) static intCOMMANDprivate java.lang.StringcontextNameprivate java.lang.StringcontextNamespaceprivate TcontextNodeprivate intcurrentPtr(package private) static intDD_OR_DTprivate TdeepTreeSurrogateParentUsed to work around Gecko limitations.(package private) static intDIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENUprivate DoctypeExpectationdoctypeExpectationprivate DocumentModeHandlerdocumentModeHandler(package private) static intEMBED_OR_IMGprotected org.xml.sax.ErrorHandlererrorHandler(package private) static intFIELDSETprivate LocatorImplfirstCommentLocation(package private) static intFONT(package private) static intFOREIGNOBJECT_OR_DESC(package private) static intFORMprivate TformPointerprivate booleanfragment(package private) static intFRAME(package private) static intFRAMESETprivate static intFRAMESET_OKprivate booleanframesetOkUsed only when moving back to IN_BODY.(package private) static intH1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6(package private) static intHEADprivate TheadPointer(package private) static intHR(package private) static intHTMLprivate static java.lang.StringHTML_LOCALprivate booleanhtml4private static java.lang.String[]HTML4_PUBLIC_IDSprivate java.util.Map<java.lang.String,LocatorImpl>idLocations(package private) static intIFRAME(package private) static intIMAGEprivate static intIN_BODYprivate static intIN_CAPTIONprivate static intIN_CELLprivate static intIN_COLUMN_GROUPprivate static intIN_FRAMESETprivate static intIN_HEADprivate static intIN_HEAD_NOSCRIPTprivate static intIN_ROWprivate static intIN_SELECTprivate static intIN_SELECT_IN_TABLEprivate static intIN_TABLEprivate static intIN_TABLE_BODYprivate static intINITIAL(package private) static intINPUT(package private) static intISINDEX(package private) static intKEYGEN(package private) static intLI(package private) static intLINK_OR_BASEFONT_OR_BGSOUNDprivate StackNode<T>[]listOfActiveFormattingElementsprivate intlistPtr(package private) static intMARQUEE_OR_APPLET(package private) static intMATH(package private) static intMENUITEM(package private) static intMETA(package private) static intMGLYPH_OR_MALIGNMARK(package private) static intMI_MO_MN_MS_MTEXTprivate intmodeprivate XmlViolationPolicynamePolicyprivate booleanneedToDropLF(package private) static intNOBR(package private) static intNOEMBED(package private) static intNOFRAMES(package private) static intNOSCRIPTprivate static intNOT_FOUND_ON_STACK(package private) static intOBJECT(package private) static intOPTGROUP(package private) static intOPTIONprivate intoriginalMode(package private) static intOTHER(package private) static intOUTPUT_OR_LABEL(package private) static intP(package private) static intPARAM_OR_SOURCE_OR_TRACK(package private) static intPLAINTEXT(package private) static intPRE_OR_LISTINGprivate booleanquirksprivate static java.lang.String[]QUIRKY_PUBLIC_IDSprivate static char[]REPLACEMENT_CHARACTERArray version of U+FFFD.private booleanreportingDoctype(package private) static intRT_OR_RP(package private) static intRUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR(package private) static intSCRIPTprivate booleanscriptingEnabled(package private) static intSELECTprivate StackNode<T>[]stack(package private) static intSTYLE(package private) static intSVG(package private) static intTABLE(package private) static intTBODY_OR_THEAD_OR_TFOOT(package private) static intTD_OR_THprivate static intTEXT(package private) static intTEXTAREA(package private) static intTITLEprotected Tokenizertokenizer(package private) static intTR(package private) static intUL_OR_OL_OR_DLprivate booleanwantingComments(package private) static intXMP
-
Constructor Summary
Constructors Modifier Constructor Description protectedTreeBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaccumulateCharacters(char[] buf, int start, int length)private voidaccumulateCharactersForced(char[] buf, int start, int length)private booleanaddAttributesToBody(HtmlAttributes attributes)Attempt to add attribute to the body element.protected abstract voidaddAttributesToElement(T element, HtmlAttributes attributes)private voidaddAttributesToHtml(HtmlAttributes attributes)private booleanadoptionAgencyEndTag(java.lang.String name)private booleanannotationXmlEncodingPermitsHtml(HtmlAttributes attributes)private voidappend(StackNode<T> node)protected abstract voidappendCharacters(T parent, char[] buf, int start, int length)protected abstract voidappendChildrenToNewParent(T oldParent, T newParent)protected abstract voidappendComment(T parent, char[] buf, int start, int length)protected abstract voidappendCommentToDocument(char[] buf, int start, int length)protected voidappendDoctypeToDocument(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier)protected abstract voidappendElement(T child, T newParent)private voidappendHtmlElementToDocumentAndPush()private voidappendHtmlElementToDocumentAndPush(HtmlAttributes attributes)protected abstract voidappendIsindexPrompt(T parent)private voidappendToCurrentNodeAndPushBodyElement()private voidappendToCurrentNodeAndPushBodyElement(HtmlAttributes attributes)private voidappendToCurrentNodeAndPushElement(ElementName elementName, HtmlAttributes attributes)private voidappendToCurrentNodeAndPushElementMayFoster(ElementName elementName, HtmlAttributes attributes)private voidappendToCurrentNodeAndPushElementMayFoster(ElementName elementName, HtmlAttributes attributes, T form)private voidappendToCurrentNodeAndPushElementMayFosterMathML(ElementName elementName, HtmlAttributes attributes)private voidappendToCurrentNodeAndPushElementMayFosterSVG(ElementName elementName, HtmlAttributes attributes)private voidappendToCurrentNodeAndPushFormattingElementMayFoster(ElementName elementName, HtmlAttributes attributes)private voidappendToCurrentNodeAndPushFormElementMayFoster(HtmlAttributes attributes)private voidappendToCurrentNodeAndPushHeadElement(HtmlAttributes attributes)private voidappendVoidElementToCurrent(java.lang.String name, HtmlAttributes attributes, T form)private voidappendVoidElementToCurrentMayFoster(java.lang.String name, HtmlAttributes attributes, T form)private voidappendVoidElementToCurrentMayFoster(ElementName elementName, HtmlAttributes attributes)private voidappendVoidElementToCurrentMayFosterMathML(ElementName elementName, HtmlAttributes attributes)private voidappendVoidElementToCurrentMayFosterSVG(ElementName elementName, HtmlAttributes attributes)private voidappendVoidFormToCurrent(HtmlAttributes attributes)booleancdataSectionAllowed()Checks if the CDATA sections are allowed.voidcharacters(char[] buf, int start, int length)Receive character tokens.private booleancharBufferContainsNonWhitespace()private voidcheckAttributes(HtmlAttributes attributes, java.lang.String ns)private voidcheckMetaCharset(HtmlAttributes attributes)private java.lang.StringcheckPopName(java.lang.String name)private booleanclearLastListSlot()private booleanclearLastStackSlot()private voidclearStackBackTo(int eltPos)private voidclearTheListOfActiveFormattingElementsUpToTheLastMarker()private voidcloseTheCell(int eltPos)voidcomment(char[] buf, int start, int length)Receive a comment token.protected abstract TcreateElement(java.lang.String ns, java.lang.String name, HtmlAttributes attributes)protected TcreateElement(java.lang.String ns, java.lang.String name, HtmlAttributes attributes, T form)protected abstract TcreateHtmlElementSetAsRoot(HtmlAttributes attributes)protected TcurrentNode()protected abstract voiddetachFromParent(T element)voiddoctype(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean forceQuirks)Receive a doctype token.protected voiddocumentMode(DocumentMode m, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean html4SpecificAdditionalErrorChecks)private voiddocumentModeInternal(DocumentMode m, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean html4SpecificAdditionalErrorChecks)protected voidelementPopped(java.lang.String ns, java.lang.String name, T node)protected voidelementPushed(java.lang.String ns, java.lang.String name, T node)protected voidend()voidendTag(ElementName elementName)Receive an end tag token.voidendTokenization()The perform final cleanup.voideof()The end-of-file token.(package private) voiderr(java.lang.String message)Reports a Parse Error.private voiderrAlmostStandardsDoctype()private voiderrBadStartTagInHead(java.lang.String name)private voiderrEndTagAfterBody()private voiderrEndTagBr()private voiderrEndTagDidNotMatchCurrentOpenElement(java.lang.String name, java.lang.String currOpenName)private voiderrEndTagSeenWithoutDoctype()private voiderrEndTagSeenWithSelectOpen(java.lang.String name)private voiderrEndTagViolatesNestingRules(java.lang.String name)private voiderrEndWithUnclosedElements(java.lang.String name)Reports arriving at/near end of document with unclosed elements remaining.private voiderrEofWithUnclosedElements()private voiderrFooBetweenHeadAndBody(java.lang.String name)private voiderrFooSeenWhenFooOpen(java.lang.String name)private voiderrFormWhenFormOpen()private voiderrFramesetStart()private voiderrGarbageInColgroup()private voiderrHeadingWhenHeadingOpen()private voiderrHtmlStartTagInForeignContext(java.lang.String name)private voiderrImage()private voiderrIsindex()private voiderrListUnclosedStartTags(int eltPos)private voiderrNoCellToClose()(package private) voiderrNoCheck(java.lang.String message)Reports a Parse Error without checking if an error handler is present.private voiderrNoCheckUnclosedElementsOnStack()private voiderrNoElementToCloseButEndTagSeen(java.lang.String name)private voiderrNonSpaceAfterBody()private voiderrNonSpaceAfterFrameset()private voiderrNonSpaceInColgroupInFragment()private voiderrNonSpaceInFrameset()private voiderrNonSpaceInNoscriptInHead()private voiderrNonSpaceInTable()private voiderrNonSpaceInTrailer()private voiderrNoSelectInTableScope()private voiderrNoTableRowToClose()private voiderrQuirkyDoctype()private voiderrSelfClosing()private voiderrStartSelectWhereEndSelectExpected()private voiderrStartTagInTable(java.lang.String name)private voiderrStartTagInTableBody(java.lang.String name)private voiderrStartTagSeenWithoutRuby(java.lang.String name)private voiderrStartTagWithoutDoctype()private voiderrStartTagWithSelectOpen(java.lang.String name)private voiderrStrayDoctype()private voiderrStrayEndTag(java.lang.String name)Reports a stray end tag.private voiderrStrayStartTag(java.lang.String name)Reports a stray start tag.private voiderrTableClosedWhileCaptionOpen()private voiderrTableSeenWhileTableOpen()private voiderrUnclosedChildrenInRuby()private voiderrUnclosedElements(int eltPos, java.lang.String name)Reports a state when elements expected to be closed were not.private voiderrUnclosedElementsCell(int eltPos)Reports a state when elements expected to be closed ahead of an implied table cell close.private voiderrUnclosedElementsImplied(int eltPos, java.lang.String name)Reports a state when elements expected to be closed ahead of an implied end tag but were not.static java.lang.StringextractCharsetFromContent(java.lang.String attributeValue)C++ memory note: The return value must be released.protected voidfatal()Reports an condition that would make the infoset incompatible with XML 1.0 as fatal.protected voidfatal(java.lang.Exception e)(package private) voidfatal(java.lang.String s)private intfindInArray(StackNode<T> node, StackNode<T>[] arr)private intfindInListOfActiveFormattingElements(StackNode<T> node)private intfindInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker(java.lang.String name)private intfindLast(java.lang.String name)private intfindLastInButtonScope(java.lang.String name)private intfindLastInListScope(java.lang.String name)private intfindLastInScope(java.lang.String name)private intfindLastInScopeHn()private intfindLastInTableScope(java.lang.String name)private intfindLastInTableScopeOrRootTbodyTheadTfoot()private intfindLastInTableScopeTdTh()private intfindLastOrRoot(int group)private intfindLastOrRoot(java.lang.String name)voidflushCharacters()Flushes the pending characters.private voidgenerateImpliedEndTags()private voidgenerateImpliedEndTagsExceptFor(java.lang.String name)TgetDeepTreeSurrogateParent()Returns the deepTreeSurrogateParent.org.xml.sax.ErrorHandlergetErrorHandler()Returns the errorHandler.TgetFormPointer()Returns the formPointer.TgetHeadPointer()Returns the headPointer.StackNode<T>[]getListOfActiveFormattingElements()Returns the listOfActiveFormattingElements.intgetListOfActiveFormattingElementsLength()Return the length of the list of active formatting elements.intgetMode()Returns the mode.intgetOriginalMode()Returns the originalMode.StackNode<T>[]getStack()Returns the stack.intgetStackLength()Return the length of the stack.protected abstract booleanhasChildren(T element)private voidimplicitlyCloseP()protected abstract voidinsertFosterParentedCharacters(char[] buf, int start, int length, T table, T stackParent)protected abstract voidinsertFosterParentedChild(T child, T table, T stackParent)private voidinsertIntoFosterParent(T child)private voidinsertIntoListOfActiveFormattingElements(StackNode<T> formattingClone, int bookmark)private voidinsertIntoStack(StackNode<T> node, int position)private voidinsertMarker()private booleanisAlmostStandards(java.lang.String publicIdentifier, java.lang.String systemIdentifier)private booleanisCurrent(java.lang.String name)booleanisFramesetOk()Returns the framesetOk.private booleanisHtml4Doctype(java.lang.String publicIdentifier)private booleanisInForeign()private booleanisInForeignButNotHtmlOrMathTextIntegrationPoint()private booleanisInStack(StackNode<T> node)booleanisNeedToDropLF()Returns the needToDropLF.booleanisQuirks()Returns the quirks.private booleanisQuirky(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean forceQuirks)booleanisScriptingEnabled()Returns the scriptingEnabled.private booleanisSecondOnStackBody()private booleanisSpecialParentInForeign(StackNode<T> stackNode)voidloadState(TreeBuilderState<T> snapshot, Interner interner)protected voidmarkMalformedIfScript(T elt)private voidmaybeForgetEarlierDuplicateFormattingElement(java.lang.String name, HtmlAttributes attributes)TreeBuilderState<T>newSnapshot()Creates a comparable snapshot of the tree builder state.private voidpop()private voidpopOnEof()private voidpush(StackNode<T> node)private voidpushHeadPointerOntoStack()private voidreconstructTheActiveFormattingElements()private voidremoveFromListOfActiveFormattingElements(int pos)private voidremoveFromStack(int pos)private voidremoveFromStack(StackNode<T> node)private voidreportUnclosedElementNameAndLocation(int pos)Reports the name and location of an unclosed element.protected voidrequestSuspension()private voidresetTheInsertionMode()voidsetDoctypeExpectation(DoctypeExpectation doctypeExpectation)Sets the doctypeExpectation.voidsetDocumentModeHandler(DocumentModeHandler documentModeHandler)Sets the documentModeHandler.voidsetErrorHandler(org.xml.sax.ErrorHandler errorHandler)Sets the errorHandler.voidsetFragmentContext(java.lang.String context)The argument MUST be an interned string ornull.voidsetFragmentContext(java.lang.String context, java.lang.String ns, T node, boolean quirks)The argument MUST be an interned string ornull.voidsetIgnoringComments(boolean ignoreComments)voidsetNamePolicy(XmlViolationPolicy namePolicy)voidsetReportingDoctype(boolean reportingDoctype)Sets the reportingDoctype.voidsetScriptingEnabled(boolean scriptingEnabled)Sets the scriptingEnabled.private voidsilentPop()private voidsilentPush(StackNode<T> node)booleansnapshotMatches(TreeBuilderState<T> snapshot)protected voidstart(boolean fragmentMode)voidstartTag(ElementName elementName, HtmlAttributes attributes, boolean selfClosing)Receive a start tag token.voidstartTokenization(Tokenizer self)This method is called at the start of tokenization before any other methods on this interface are called.booleanwantsComments()If this handler implementation cares about comments, returntrue.(package private) voidwarn(java.lang.String message)Reports a warning(package private) voidwarn(java.lang.String message, org.xml.sax.Locator locator)Reports a warning with an explicit locatorvoidzeroOriginatingReplacementCharacter()Reports a U+0000 that's being turned into a U+FFFD.
-
-
-
Field Detail
-
REPLACEMENT_CHARACTER
private static final char[] REPLACEMENT_CHARACTER
Array version of U+FFFD.
-
OTHER
static final int OTHER
- See Also:
- Constant Field Values
-
A
static final int A
- See Also:
- Constant Field Values
-
BASE
static final int BASE
- See Also:
- Constant Field Values
-
BODY
static final int BODY
- See Also:
- Constant Field Values
-
BR
static final int BR
- See Also:
- Constant Field Values
-
BUTTON
static final int BUTTON
- See Also:
- Constant Field Values
-
CAPTION
static final int CAPTION
- See Also:
- Constant Field Values
-
COL
static final int COL
- See Also:
- Constant Field Values
-
COLGROUP
static final int COLGROUP
- See Also:
- Constant Field Values
-
FORM
static final int FORM
- See Also:
- Constant Field Values
-
FRAME
static final int FRAME
- See Also:
- Constant Field Values
-
FRAMESET
static final int FRAMESET
- See Also:
- Constant Field Values
-
IMAGE
static final int IMAGE
- See Also:
- Constant Field Values
-
INPUT
static final int INPUT
- See Also:
- Constant Field Values
-
ISINDEX
static final int ISINDEX
- See Also:
- Constant Field Values
-
LI
static final int LI
- See Also:
- Constant Field Values
-
LINK_OR_BASEFONT_OR_BGSOUND
static final int LINK_OR_BASEFONT_OR_BGSOUND
- See Also:
- Constant Field Values
-
MATH
static final int MATH
- See Also:
- Constant Field Values
-
META
static final int META
- See Also:
- Constant Field Values
-
SVG
static final int SVG
- See Also:
- Constant Field Values
-
HEAD
static final int HEAD
- See Also:
- Constant Field Values
-
HR
static final int HR
- See Also:
- Constant Field Values
-
HTML
static final int HTML
- See Also:
- Constant Field Values
-
NOBR
static final int NOBR
- See Also:
- Constant Field Values
-
NOFRAMES
static final int NOFRAMES
- See Also:
- Constant Field Values
-
NOSCRIPT
static final int NOSCRIPT
- See Also:
- Constant Field Values
-
OPTGROUP
static final int OPTGROUP
- See Also:
- Constant Field Values
-
OPTION
static final int OPTION
- See Also:
- Constant Field Values
-
P
static final int P
- See Also:
- Constant Field Values
-
PLAINTEXT
static final int PLAINTEXT
- See Also:
- Constant Field Values
-
SCRIPT
static final int SCRIPT
- See Also:
- Constant Field Values
-
SELECT
static final int SELECT
- See Also:
- Constant Field Values
-
STYLE
static final int STYLE
- See Also:
- Constant Field Values
-
TABLE
static final int TABLE
- See Also:
- Constant Field Values
-
TEXTAREA
static final int TEXTAREA
- See Also:
- Constant Field Values
-
TITLE
static final int TITLE
- See Also:
- Constant Field Values
-
TR
static final int TR
- See Also:
- Constant Field Values
-
XMP
static final int XMP
- See Also:
- Constant Field Values
-
TBODY_OR_THEAD_OR_TFOOT
static final int TBODY_OR_THEAD_OR_TFOOT
- See Also:
- Constant Field Values
-
TD_OR_TH
static final int TD_OR_TH
- See Also:
- Constant Field Values
-
DD_OR_DT
static final int DD_OR_DT
- See Also:
- Constant Field Values
-
H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6
static final int H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6
- See Also:
- Constant Field Values
-
MARQUEE_OR_APPLET
static final int MARQUEE_OR_APPLET
- See Also:
- Constant Field Values
-
PRE_OR_LISTING
static final int PRE_OR_LISTING
- See Also:
- Constant Field Values
-
B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U
static final int B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U
- See Also:
- Constant Field Values
-
UL_OR_OL_OR_DL
static final int UL_OR_OL_OR_DL
- See Also:
- Constant Field Values
-
IFRAME
static final int IFRAME
- See Also:
- Constant Field Values
-
EMBED_OR_IMG
static final int EMBED_OR_IMG
- See Also:
- Constant Field Values
-
AREA_OR_WBR
static final int AREA_OR_WBR
- See Also:
- Constant Field Values
-
DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU
static final int DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU
- See Also:
- Constant Field Values
-
ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_NAV_OR_SECTION_OR_SUMMARY
static final int ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_NAV_OR_SECTION_OR_SUMMARY
- See Also:
- Constant Field Values
-
RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR
static final int RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR
- See Also:
- Constant Field Values
-
RT_OR_RP
static final int RT_OR_RP
- See Also:
- Constant Field Values
-
COMMAND
static final int COMMAND
- See Also:
- Constant Field Values
-
PARAM_OR_SOURCE_OR_TRACK
static final int PARAM_OR_SOURCE_OR_TRACK
- See Also:
- Constant Field Values
-
MGLYPH_OR_MALIGNMARK
static final int MGLYPH_OR_MALIGNMARK
- See Also:
- Constant Field Values
-
MI_MO_MN_MS_MTEXT
static final int MI_MO_MN_MS_MTEXT
- See Also:
- Constant Field Values
-
ANNOTATION_XML
static final int ANNOTATION_XML
- See Also:
- Constant Field Values
-
FOREIGNOBJECT_OR_DESC
static final int FOREIGNOBJECT_OR_DESC
- See Also:
- Constant Field Values
-
NOEMBED
static final int NOEMBED
- See Also:
- Constant Field Values
-
FIELDSET
static final int FIELDSET
- See Also:
- Constant Field Values
-
OUTPUT_OR_LABEL
static final int OUTPUT_OR_LABEL
- See Also:
- Constant Field Values
-
OBJECT
static final int OBJECT
- See Also:
- Constant Field Values
-
FONT
static final int FONT
- See Also:
- Constant Field Values
-
KEYGEN
static final int KEYGEN
- See Also:
- Constant Field Values
-
MENUITEM
static final int MENUITEM
- See Also:
- Constant Field Values
-
INITIAL
private static final int INITIAL
- See Also:
- Constant Field Values
-
BEFORE_HTML
private static final int BEFORE_HTML
- See Also:
- Constant Field Values
-
BEFORE_HEAD
private static final int BEFORE_HEAD
- See Also:
- Constant Field Values
-
IN_HEAD
private static final int IN_HEAD
- See Also:
- Constant Field Values
-
IN_HEAD_NOSCRIPT
private static final int IN_HEAD_NOSCRIPT
- See Also:
- Constant Field Values
-
AFTER_HEAD
private static final int AFTER_HEAD
- See Also:
- Constant Field Values
-
IN_BODY
private static final int IN_BODY
- See Also:
- Constant Field Values
-
IN_TABLE
private static final int IN_TABLE
- See Also:
- Constant Field Values
-
IN_CAPTION
private static final int IN_CAPTION
- See Also:
- Constant Field Values
-
IN_COLUMN_GROUP
private static final int IN_COLUMN_GROUP
- See Also:
- Constant Field Values
-
IN_TABLE_BODY
private static final int IN_TABLE_BODY
- See Also:
- Constant Field Values
-
IN_ROW
private static final int IN_ROW
- See Also:
- Constant Field Values
-
IN_CELL
private static final int IN_CELL
- See Also:
- Constant Field Values
-
IN_SELECT
private static final int IN_SELECT
- See Also:
- Constant Field Values
-
IN_SELECT_IN_TABLE
private static final int IN_SELECT_IN_TABLE
- See Also:
- Constant Field Values
-
AFTER_BODY
private static final int AFTER_BODY
- See Also:
- Constant Field Values
-
IN_FRAMESET
private static final int IN_FRAMESET
- See Also:
- Constant Field Values
-
AFTER_FRAMESET
private static final int AFTER_FRAMESET
- See Also:
- Constant Field Values
-
AFTER_AFTER_BODY
private static final int AFTER_AFTER_BODY
- See Also:
- Constant Field Values
-
AFTER_AFTER_FRAMESET
private static final int AFTER_AFTER_FRAMESET
- See Also:
- Constant Field Values
-
TEXT
private static final int TEXT
- See Also:
- Constant Field Values
-
FRAMESET_OK
private static final int FRAMESET_OK
- See Also:
- Constant Field Values
-
CHARSET_INITIAL
private static final int CHARSET_INITIAL
- See Also:
- Constant Field Values
-
CHARSET_C
private static final int CHARSET_C
- See Also:
- Constant Field Values
-
CHARSET_H
private static final int CHARSET_H
- See Also:
- Constant Field Values
-
CHARSET_A
private static final int CHARSET_A
- See Also:
- Constant Field Values
-
CHARSET_R
private static final int CHARSET_R
- See Also:
- Constant Field Values
-
CHARSET_S
private static final int CHARSET_S
- See Also:
- Constant Field Values
-
CHARSET_E
private static final int CHARSET_E
- See Also:
- Constant Field Values
-
CHARSET_T
private static final int CHARSET_T
- See Also:
- Constant Field Values
-
CHARSET_EQUALS
private static final int CHARSET_EQUALS
- See Also:
- Constant Field Values
-
CHARSET_SINGLE_QUOTED
private static final int CHARSET_SINGLE_QUOTED
- See Also:
- Constant Field Values
-
CHARSET_DOUBLE_QUOTED
private static final int CHARSET_DOUBLE_QUOTED
- See Also:
- Constant Field Values
-
CHARSET_UNQUOTED
private static final int CHARSET_UNQUOTED
- See Also:
- Constant Field Values
-
HTML4_PUBLIC_IDS
private static final java.lang.String[] HTML4_PUBLIC_IDS
-
QUIRKY_PUBLIC_IDS
private static final java.lang.String[] QUIRKY_PUBLIC_IDS
-
NOT_FOUND_ON_STACK
private static final int NOT_FOUND_ON_STACK
- See Also:
- Constant Field Values
-
HTML_LOCAL
private static final java.lang.String HTML_LOCAL
- See Also:
- Constant Field Values
-
mode
private int mode
-
originalMode
private int originalMode
-
framesetOk
private boolean framesetOk
Used only when moving back to IN_BODY.
-
tokenizer
protected Tokenizer tokenizer
-
errorHandler
protected org.xml.sax.ErrorHandler errorHandler
-
documentModeHandler
private DocumentModeHandler documentModeHandler
-
doctypeExpectation
private DoctypeExpectation doctypeExpectation
-
firstCommentLocation
private LocatorImpl firstCommentLocation
-
scriptingEnabled
private boolean scriptingEnabled
-
needToDropLF
private boolean needToDropLF
-
wantingComments
private boolean wantingComments
-
fragment
private boolean fragment
-
contextName
private java.lang.String contextName
-
contextNamespace
private java.lang.String contextNamespace
-
contextNode
private T contextNode
-
currentPtr
private int currentPtr
-
listPtr
private int listPtr
-
formPointer
private T formPointer
-
headPointer
private T headPointer
-
deepTreeSurrogateParent
private T deepTreeSurrogateParent
Used to work around Gecko limitations. Not used in Java.
-
charBuffer
protected char[] charBuffer
-
charBufferLen
protected int charBufferLen
-
quirks
private boolean quirks
-
reportingDoctype
private boolean reportingDoctype
-
namePolicy
private XmlViolationPolicy namePolicy
-
idLocations
private final java.util.Map<java.lang.String,LocatorImpl> idLocations
-
html4
private boolean html4
-
-
Method Detail
-
fatal
protected void fatal() throws org.xml.sax.SAXExceptionReports an condition that would make the infoset incompatible with XML 1.0 as fatal.- Throws:
org.xml.sax.SAXExceptionorg.xml.sax.SAXParseException
-
fatal
protected final void fatal(java.lang.Exception e) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
fatal
final void fatal(java.lang.String s) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
err
final void err(java.lang.String message) throws org.xml.sax.SAXExceptionReports a Parse Error.- Parameters:
message- the message- Throws:
org.xml.sax.SAXException
-
errNoCheck
final void errNoCheck(java.lang.String message) throws org.xml.sax.SAXExceptionReports a Parse Error without checking if an error handler is present.- Parameters:
message- the message- Throws:
org.xml.sax.SAXException
-
errListUnclosedStartTags
private void errListUnclosedStartTags(int eltPos) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
reportUnclosedElementNameAndLocation
private final void reportUnclosedElementNameAndLocation(int pos) throws org.xml.sax.SAXExceptionReports the name and location of an unclosed element.- Throws:
org.xml.sax.SAXException
-
warn
final void warn(java.lang.String message) throws org.xml.sax.SAXExceptionReports a warning- Parameters:
message- the message- Throws:
org.xml.sax.SAXException
-
warn
final void warn(java.lang.String message, org.xml.sax.Locator locator) throws org.xml.sax.SAXExceptionReports a warning with an explicit locator- Parameters:
message- the message- Throws:
org.xml.sax.SAXException
-
startTokenization
public final void startTokenization(Tokenizer self) throws org.xml.sax.SAXException
Description copied from interface:TokenHandlerThis method is called at the start of tokenization before any other methods on this interface are called. Implementations should hold the reference to theTokenizerin order to set the content model flag and in order to be able to query forLocatordata.- Specified by:
startTokenizationin interfaceTokenHandler- Parameters:
self- theTokenizer.- Throws:
org.xml.sax.SAXException- if something went wrong
-
doctype
public final void doctype(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean forceQuirks) throws org.xml.sax.SAXExceptionDescription copied from interface:TokenHandlerReceive a doctype token.- Specified by:
doctypein interfaceTokenHandler- Parameters:
name- the namepublicIdentifier- the public idsystemIdentifier- the system idforceQuirks- whether the token is correct- Throws:
org.xml.sax.SAXException- if something went wrong
-
isHtml4Doctype
private boolean isHtml4Doctype(java.lang.String publicIdentifier)
-
comment
public final void comment(char[] buf, int start, int length) throws org.xml.sax.SAXExceptionDescription copied from interface:TokenHandlerReceive a comment token. The data is junk if thewantsComments()returnedfalse.- Specified by:
commentin interfaceTokenHandler- Parameters:
buf- a buffer holding the datastart- the offset into the bufferlength- the number of code units to read- Throws:
org.xml.sax.SAXException- if something went wrong
-
characters
public final void characters(char[] buf, int start, int length) throws org.xml.sax.SAXExceptionDescription copied from interface:TokenHandlerReceive character tokens. This method has the same semantics as the SAX method of the same name.- Specified by:
charactersin interfaceTokenHandler- Parameters:
buf- a buffer holding the datastart- offset into the bufferlength- the number of code units to read- Throws:
org.xml.sax.SAXException- if something went wrong- See Also:
TokenHandler.characters(char[], int, int)
-
zeroOriginatingReplacementCharacter
public void zeroOriginatingReplacementCharacter() throws org.xml.sax.SAXExceptionDescription copied from interface:TokenHandlerReports a U+0000 that's being turned into a U+FFFD.- Specified by:
zeroOriginatingReplacementCharacterin interfaceTokenHandler- Throws:
org.xml.sax.SAXException- if something went wrong- See Also:
TokenHandler.zeroOriginatingReplacementCharacter()
-
eof
public final void eof() throws org.xml.sax.SAXExceptionDescription copied from interface:TokenHandlerThe end-of-file token.- Specified by:
eofin interfaceTokenHandler- Throws:
org.xml.sax.SAXException- if something went wrong
-
endTokenization
public final void endTokenization() throws org.xml.sax.SAXExceptionDescription copied from interface:TokenHandlerThe perform final cleanup.- Specified by:
endTokenizationin interfaceTokenHandler- Throws:
org.xml.sax.SAXException- if something went wrong- See Also:
TokenHandler.endTokenization()
-
startTag
public final void startTag(ElementName elementName, HtmlAttributes attributes, boolean selfClosing) throws org.xml.sax.SAXException
Description copied from interface:TokenHandlerReceive a start tag token.- Specified by:
startTagin interfaceTokenHandler- Parameters:
elementName- the tag nameattributes- the attributesselfClosing- TODO- Throws:
org.xml.sax.SAXException- if something went wrong
-
extractCharsetFromContent
public static java.lang.String extractCharsetFromContent(java.lang.String attributeValue)
C++ memory note: The return value must be released.
- Returns:
- Throws:
org.xml.sax.SAXExceptionStopSniffingException
-
checkMetaCharset
private void checkMetaCharset(HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
endTag
public final void endTag(ElementName elementName) throws org.xml.sax.SAXException
Description copied from interface:TokenHandlerReceive an end tag token.- Specified by:
endTagin interfaceTokenHandler- Parameters:
elementName- the tag name- Throws:
org.xml.sax.SAXException- if something went wrong
-
findLastInTableScopeOrRootTbodyTheadTfoot
private int findLastInTableScopeOrRootTbodyTheadTfoot()
-
findLast
private int findLast(java.lang.String name)
-
findLastInTableScope
private int findLastInTableScope(java.lang.String name)
-
findLastInButtonScope
private int findLastInButtonScope(java.lang.String name)
-
findLastInScope
private int findLastInScope(java.lang.String name)
-
findLastInListScope
private int findLastInListScope(java.lang.String name)
-
findLastInScopeHn
private int findLastInScopeHn()
-
generateImpliedEndTagsExceptFor
private void generateImpliedEndTagsExceptFor(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
generateImpliedEndTags
private void generateImpliedEndTags() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
isSecondOnStackBody
private boolean isSecondOnStackBody()
-
documentModeInternal
private void documentModeInternal(DocumentMode m, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
isAlmostStandards
private boolean isAlmostStandards(java.lang.String publicIdentifier, java.lang.String systemIdentifier)
-
isQuirky
private boolean isQuirky(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean forceQuirks)
-
closeTheCell
private void closeTheCell(int eltPos) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
findLastInTableScopeTdTh
private int findLastInTableScopeTdTh()
-
clearStackBackTo
private void clearStackBackTo(int eltPos) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
resetTheInsertionMode
private void resetTheInsertionMode()
-
implicitlyCloseP
private void implicitlyCloseP() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
clearLastStackSlot
private boolean clearLastStackSlot()
-
clearLastListSlot
private boolean clearLastListSlot()
-
push
private void push(StackNode<T> node) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
silentPush
private void silentPush(StackNode<T> node) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
insertMarker
private void insertMarker()
-
clearTheListOfActiveFormattingElementsUpToTheLastMarker
private void clearTheListOfActiveFormattingElementsUpToTheLastMarker()
-
isCurrent
private boolean isCurrent(java.lang.String name)
-
removeFromStack
private void removeFromStack(int pos) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
removeFromStack
private void removeFromStack(StackNode<T> node) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
removeFromListOfActiveFormattingElements
private void removeFromListOfActiveFormattingElements(int pos)
-
adoptionAgencyEndTag
private boolean adoptionAgencyEndTag(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
insertIntoStack
private void insertIntoStack(StackNode<T> node, int position) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
insertIntoListOfActiveFormattingElements
private void insertIntoListOfActiveFormattingElements(StackNode<T> formattingClone, int bookmark)
-
findInListOfActiveFormattingElements
private int findInListOfActiveFormattingElements(StackNode<T> node)
-
findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker
private int findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker(java.lang.String name)
-
maybeForgetEarlierDuplicateFormattingElement
private void maybeForgetEarlierDuplicateFormattingElement(java.lang.String name, HtmlAttributes attributes) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
findLastOrRoot
private int findLastOrRoot(java.lang.String name)
-
findLastOrRoot
private int findLastOrRoot(int group)
-
addAttributesToBody
private boolean addAttributesToBody(HtmlAttributes attributes) throws org.xml.sax.SAXException
Attempt to add attribute to the body element.- Parameters:
attributes- the attributes- Returns:
trueiff the attributes were added- Throws:
org.xml.sax.SAXException
-
addAttributesToHtml
private void addAttributesToHtml(HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
pushHeadPointerOntoStack
private void pushHeadPointerOntoStack() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
reconstructTheActiveFormattingElements
private void reconstructTheActiveFormattingElements() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
insertIntoFosterParent
private void insertIntoFosterParent(T child) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
pop
private void pop() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
silentPop
private void silentPop() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
popOnEof
private void popOnEof() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
checkAttributes
private void checkAttributes(HtmlAttributes attributes, java.lang.String ns) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
checkPopName
private java.lang.String checkPopName(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
appendHtmlElementToDocumentAndPush
private void appendHtmlElementToDocumentAndPush(HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendHtmlElementToDocumentAndPush
private void appendHtmlElementToDocumentAndPush() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
appendToCurrentNodeAndPushHeadElement
private void appendToCurrentNodeAndPushHeadElement(HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendToCurrentNodeAndPushBodyElement
private void appendToCurrentNodeAndPushBodyElement(HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendToCurrentNodeAndPushBodyElement
private void appendToCurrentNodeAndPushBodyElement() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
appendToCurrentNodeAndPushFormElementMayFoster
private void appendToCurrentNodeAndPushFormElementMayFoster(HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendToCurrentNodeAndPushFormattingElementMayFoster
private void appendToCurrentNodeAndPushFormattingElementMayFoster(ElementName elementName, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendToCurrentNodeAndPushElement
private void appendToCurrentNodeAndPushElement(ElementName elementName, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendToCurrentNodeAndPushElementMayFoster
private void appendToCurrentNodeAndPushElementMayFoster(ElementName elementName, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendToCurrentNodeAndPushElementMayFosterMathML
private void appendToCurrentNodeAndPushElementMayFosterMathML(ElementName elementName, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
annotationXmlEncodingPermitsHtml
private boolean annotationXmlEncodingPermitsHtml(HtmlAttributes attributes)
-
appendToCurrentNodeAndPushElementMayFosterSVG
private void appendToCurrentNodeAndPushElementMayFosterSVG(ElementName elementName, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendToCurrentNodeAndPushElementMayFoster
private void appendToCurrentNodeAndPushElementMayFoster(ElementName elementName, HtmlAttributes attributes, T form) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendVoidElementToCurrentMayFoster
private void appendVoidElementToCurrentMayFoster(java.lang.String name, HtmlAttributes attributes, T form) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
appendVoidElementToCurrentMayFoster
private void appendVoidElementToCurrentMayFoster(ElementName elementName, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendVoidElementToCurrentMayFosterSVG
private void appendVoidElementToCurrentMayFosterSVG(ElementName elementName, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendVoidElementToCurrentMayFosterMathML
private void appendVoidElementToCurrentMayFosterMathML(ElementName elementName, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendVoidElementToCurrent
private void appendVoidElementToCurrent(java.lang.String name, HtmlAttributes attributes, T form) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
appendVoidFormToCurrent
private void appendVoidFormToCurrent(HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
accumulateCharactersForced
private final void accumulateCharactersForced(char[] buf, int start, int length) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
accumulateCharacters
protected void accumulateCharacters(char[] buf, int start, int length) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
requestSuspension
protected final void requestSuspension()
-
createElement
protected abstract T createElement(java.lang.String ns, java.lang.String name, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
createElement
protected T createElement(java.lang.String ns, java.lang.String name, HtmlAttributes attributes, T form) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
createHtmlElementSetAsRoot
protected abstract T createHtmlElementSetAsRoot(HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
detachFromParent
protected abstract void detachFromParent(T element) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
hasChildren
protected abstract boolean hasChildren(T element) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendElement
protected abstract void appendElement(T child, T newParent) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendChildrenToNewParent
protected abstract void appendChildrenToNewParent(T oldParent, T newParent) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
insertFosterParentedChild
protected abstract void insertFosterParentedChild(T child, T table, T stackParent) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
insertFosterParentedCharacters
protected abstract void insertFosterParentedCharacters(char[] buf, int start, int length, T table, T stackParent) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
appendCharacters
protected abstract void appendCharacters(T parent, char[] buf, int start, int length) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendIsindexPrompt
protected abstract void appendIsindexPrompt(T parent) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendComment
protected abstract void appendComment(T parent, char[] buf, int start, int length) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
appendCommentToDocument
protected abstract void appendCommentToDocument(char[] buf, int start, int length) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
addAttributesToElement
protected abstract void addAttributesToElement(T element, HtmlAttributes attributes) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
markMalformedIfScript
protected void markMalformedIfScript(T elt) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
start
protected void start(boolean fragmentMode) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
end
protected void end() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
appendDoctypeToDocument
protected void appendDoctypeToDocument(java.lang.String name, java.lang.String publicIdentifier, java.lang.String systemIdentifier) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
elementPushed
protected void elementPushed(java.lang.String ns, java.lang.String name, T node) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
elementPopped
protected void elementPopped(java.lang.String ns, java.lang.String name, T node) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
documentMode
protected void documentMode(DocumentMode m, java.lang.String publicIdentifier, java.lang.String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
wantsComments
public boolean wantsComments()
Description copied from interface:TokenHandlerIf this handler implementation cares about comments, returntrue. If not, returnfalse.- Specified by:
wantsCommentsin interfaceTokenHandler- Returns:
- whether this handler wants comments
- See Also:
TokenHandler.wantsComments()
-
setIgnoringComments
public void setIgnoringComments(boolean ignoreComments)
-
setErrorHandler
public final void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Sets the errorHandler.- Parameters:
errorHandler- the errorHandler to set
-
getErrorHandler
public org.xml.sax.ErrorHandler getErrorHandler()
Returns the errorHandler.- Returns:
- the errorHandler
-
setFragmentContext
public final void setFragmentContext(java.lang.String context)
The argument MUST be an interned string ornull.- Parameters:
context-
-
cdataSectionAllowed
public boolean cdataSectionAllowed() throws org.xml.sax.SAXExceptionDescription copied from interface:TokenHandlerChecks if the CDATA sections are allowed.- Specified by:
cdataSectionAllowedin interfaceTokenHandler- Returns:
trueif CDATA sections are allowed- Throws:
org.xml.sax.SAXException- if something went wrong- See Also:
TokenHandler.cdataSectionAllowed()
-
isInForeign
private boolean isInForeign()
-
isInForeignButNotHtmlOrMathTextIntegrationPoint
private boolean isInForeignButNotHtmlOrMathTextIntegrationPoint()
-
setFragmentContext
public final void setFragmentContext(java.lang.String context, java.lang.String ns, T node, boolean quirks)The argument MUST be an interned string ornull.- Parameters:
context-
-
currentNode
protected final T currentNode()
-
isScriptingEnabled
public boolean isScriptingEnabled()
Returns the scriptingEnabled.- Returns:
- the scriptingEnabled
-
setScriptingEnabled
public void setScriptingEnabled(boolean scriptingEnabled)
Sets the scriptingEnabled.- Parameters:
scriptingEnabled- the scriptingEnabled to set
-
setDoctypeExpectation
public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation)
Sets the doctypeExpectation.- Parameters:
doctypeExpectation- the doctypeExpectation to set
-
setNamePolicy
public void setNamePolicy(XmlViolationPolicy namePolicy)
-
setDocumentModeHandler
public void setDocumentModeHandler(DocumentModeHandler documentModeHandler)
Sets the documentModeHandler.- Parameters:
documentModeHandler- the documentModeHandler to set
-
setReportingDoctype
public void setReportingDoctype(boolean reportingDoctype)
Sets the reportingDoctype.- Parameters:
reportingDoctype- the reportingDoctype to set
-
flushCharacters
public final void flushCharacters() throws org.xml.sax.SAXExceptionFlushes the pending characters. Public for document.write use cases only.- Throws:
org.xml.sax.SAXException
-
charBufferContainsNonWhitespace
private boolean charBufferContainsNonWhitespace()
-
newSnapshot
public TreeBuilderState<T> newSnapshot() throws org.xml.sax.SAXException
Creates a comparable snapshot of the tree builder state. Snapshot creation is only supported immediately after a script end tag has been processed. In C++ the caller is responsible for callingdeleteon the returned object.- Returns:
- a snapshot.
- Throws:
org.xml.sax.SAXException
-
snapshotMatches
public boolean snapshotMatches(TreeBuilderState<T> snapshot)
-
loadState
public void loadState(TreeBuilderState<T> snapshot, Interner interner) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
getFormPointer
public T getFormPointer()
Description copied from interface:TreeBuilderStateReturns the formPointer.- Specified by:
getFormPointerin interfaceTreeBuilderState<T>- Returns:
- the formPointer
- See Also:
TreeBuilderState.getFormPointer()
-
getHeadPointer
public T getHeadPointer()
Returns the headPointer.- Specified by:
getHeadPointerin interfaceTreeBuilderState<T>- Returns:
- the headPointer
-
getDeepTreeSurrogateParent
public T getDeepTreeSurrogateParent()
Returns the deepTreeSurrogateParent.- Specified by:
getDeepTreeSurrogateParentin interfaceTreeBuilderState<T>- Returns:
- the deepTreeSurrogateParent
-
getListOfActiveFormattingElements
public StackNode<T>[] getListOfActiveFormattingElements()
Description copied from interface:TreeBuilderStateReturns the listOfActiveFormattingElements.- Specified by:
getListOfActiveFormattingElementsin interfaceTreeBuilderState<T>- Returns:
- the listOfActiveFormattingElements
- See Also:
TreeBuilderState.getListOfActiveFormattingElements()
-
getStack
public StackNode<T>[] getStack()
Description copied from interface:TreeBuilderStateReturns the stack.- Specified by:
getStackin interfaceTreeBuilderState<T>- Returns:
- the stack
- See Also:
TreeBuilderState.getStack()
-
getMode
public int getMode()
Returns the mode.- Specified by:
getModein interfaceTreeBuilderState<T>- Returns:
- the mode
-
getOriginalMode
public int getOriginalMode()
Returns the originalMode.- Specified by:
getOriginalModein interfaceTreeBuilderState<T>- Returns:
- the originalMode
-
isFramesetOk
public boolean isFramesetOk()
Returns the framesetOk.- Specified by:
isFramesetOkin interfaceTreeBuilderState<T>- Returns:
- the framesetOk
-
isNeedToDropLF
public boolean isNeedToDropLF()
Returns the needToDropLF.- Specified by:
isNeedToDropLFin interfaceTreeBuilderState<T>- Returns:
- the needToDropLF
-
isQuirks
public boolean isQuirks()
Returns the quirks.- Specified by:
isQuirksin interfaceTreeBuilderState<T>- Returns:
- the quirks
-
getListOfActiveFormattingElementsLength
public int getListOfActiveFormattingElementsLength()
Description copied from interface:TreeBuilderStateReturn the length of the list of active formatting elements.- Specified by:
getListOfActiveFormattingElementsLengthin interfaceTreeBuilderState<T>- Returns:
- the length of the list of active formatting elements.
- See Also:
TreeBuilderState.getListOfActiveFormattingElementsLength()
-
getStackLength
public int getStackLength()
Description copied from interface:TreeBuilderStateReturn the length of the stack.- Specified by:
getStackLengthin interfaceTreeBuilderState<T>- Returns:
- the length of the stack.
- See Also:
TreeBuilderState.getStackLength()
-
errStrayStartTag
private void errStrayStartTag(java.lang.String name) throws org.xml.sax.SAXExceptionReports a stray start tag.- Parameters:
name- the name of the stray tag- Throws:
org.xml.sax.SAXException
-
errStrayEndTag
private void errStrayEndTag(java.lang.String name) throws org.xml.sax.SAXExceptionReports a stray end tag.- Parameters:
name- the name of the stray tag- Throws:
org.xml.sax.SAXException
-
errUnclosedElements
private void errUnclosedElements(int eltPos, java.lang.String name) throws org.xml.sax.SAXExceptionReports a state when elements expected to be closed were not.- Parameters:
eltPos- the position of the start tag on the stack of the element being closed.name- the name of the end tag- Throws:
org.xml.sax.SAXException
-
errUnclosedElementsImplied
private void errUnclosedElementsImplied(int eltPos, java.lang.String name) throws org.xml.sax.SAXExceptionReports a state when elements expected to be closed ahead of an implied end tag but were not.- Parameters:
eltPos- the position of the start tag on the stack of the element being closed.name- the name of the end tag- Throws:
org.xml.sax.SAXException
-
errUnclosedElementsCell
private void errUnclosedElementsCell(int eltPos) throws org.xml.sax.SAXExceptionReports a state when elements expected to be closed ahead of an implied table cell close.- Parameters:
eltPos- the position of the start tag on the stack of the element being closed.- Throws:
org.xml.sax.SAXException
-
errStrayDoctype
private void errStrayDoctype() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errAlmostStandardsDoctype
private void errAlmostStandardsDoctype() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errQuirkyDoctype
private void errQuirkyDoctype() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNonSpaceInTrailer
private void errNonSpaceInTrailer() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNonSpaceAfterFrameset
private void errNonSpaceAfterFrameset() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNonSpaceInFrameset
private void errNonSpaceInFrameset() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNonSpaceAfterBody
private void errNonSpaceAfterBody() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNonSpaceInColgroupInFragment
private void errNonSpaceInColgroupInFragment() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNonSpaceInNoscriptInHead
private void errNonSpaceInNoscriptInHead() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errFooBetweenHeadAndBody
private void errFooBetweenHeadAndBody(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errStartTagWithoutDoctype
private void errStartTagWithoutDoctype() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNoSelectInTableScope
private void errNoSelectInTableScope() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errStartSelectWhereEndSelectExpected
private void errStartSelectWhereEndSelectExpected() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errStartTagWithSelectOpen
private void errStartTagWithSelectOpen(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errBadStartTagInHead
private void errBadStartTagInHead(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errImage
private void errImage() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errIsindex
private void errIsindex() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errFooSeenWhenFooOpen
private void errFooSeenWhenFooOpen(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errHeadingWhenHeadingOpen
private void errHeadingWhenHeadingOpen() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errFramesetStart
private void errFramesetStart() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNoCellToClose
private void errNoCellToClose() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errStartTagInTable
private void errStartTagInTable(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errFormWhenFormOpen
private void errFormWhenFormOpen() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errTableSeenWhileTableOpen
private void errTableSeenWhileTableOpen() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errStartTagInTableBody
private void errStartTagInTableBody(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errEndTagSeenWithoutDoctype
private void errEndTagSeenWithoutDoctype() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errEndTagAfterBody
private void errEndTagAfterBody() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errEndTagSeenWithSelectOpen
private void errEndTagSeenWithSelectOpen(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errGarbageInColgroup
private void errGarbageInColgroup() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errEndTagBr
private void errEndTagBr() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNoElementToCloseButEndTagSeen
private void errNoElementToCloseButEndTagSeen(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errHtmlStartTagInForeignContext
private void errHtmlStartTagInForeignContext(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errTableClosedWhileCaptionOpen
private void errTableClosedWhileCaptionOpen() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNoTableRowToClose
private void errNoTableRowToClose() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNonSpaceInTable
private void errNonSpaceInTable() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errUnclosedChildrenInRuby
private void errUnclosedChildrenInRuby() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errStartTagSeenWithoutRuby
private void errStartTagSeenWithoutRuby(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errSelfClosing
private void errSelfClosing() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errNoCheckUnclosedElementsOnStack
private void errNoCheckUnclosedElementsOnStack() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errEndTagDidNotMatchCurrentOpenElement
private void errEndTagDidNotMatchCurrentOpenElement(java.lang.String name, java.lang.String currOpenName) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errEndTagViolatesNestingRules
private void errEndTagViolatesNestingRules(java.lang.String name) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errEofWithUnclosedElements
private void errEofWithUnclosedElements() throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
errEndWithUnclosedElements
private void errEndWithUnclosedElements(java.lang.String name) throws org.xml.sax.SAXExceptionReports arriving at/near end of document with unclosed elements remaining.- Parameters:
message- the message- Throws:
org.xml.sax.SAXException
-
-