org.attoparser.ParseStatus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of attoparser Show documentation
Show all versions of attoparser Show documentation
Powerful, fast and easy to use HTML and XML parser for Java
/*
* =============================================================================
*
* Copyright (c) 2012-2014, The ATTOPARSER team (http://www.attoparser.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
package org.attoparser;
/**
*
* Class used for reporting the status of current parsing operations to handlers.
*
*
* Instances of this class operate at a very low level, and are only useful in very specific scenarios,
* so most {@link org.attoparser.IMarkupHandler} implementations should just ignore its existence and
* consider it only for internal use.
*
*
* @author Daniel Fernández
*
* @since 2.0.0
*
*/
public final class ParseStatus {
int offset;
int line;
int col;
boolean inStructure;
boolean shouldDisableParsing; // This is meant to be modified only inside CDATA elements (disabling can depend on an attribute)
boolean parsingDisabled;
char[] parsingDisabledLimitSequence;
boolean avoidStacking;
// These attributes instruct the event processor to make sure an element is correctly stacked inside the elements
// it needs to. For example, a element will ask for the auto-opening of a element as its
// parent, but it will specify as limits also and because these two elements are also valid
// parents for it (just not default).
// The limits array will be used for specifying: if not null, the IMMEDIATE parents that will be considered
// valid. If not null, that the parent element sequence should only be considered from the document root, and
// that it should be completed if something is missing (e.g. there is but no ).
// When in HTML, the auto-open elements will be:
//
// *
// RULE: if (parent != && parent != && parent != ) -> AUTO-OPEN
// PARENTS: (tbody) LIMITS: (tbody,tfoot,thead)
//
// *
// RULE: if (parent != ) -> AUTO-OPEN
// PARENTS: (colgroup) LIMITS: (colgroup)
//
// * , ,