Package org.attoparser.select
Class MarkupSelectorItem
- java.lang.Object
-
- org.attoparser.select.MarkupSelectorItem
-
- All Implemented Interfaces:
IMarkupSelectorItem
final class MarkupSelectorItem extends java.lang.Object implements IMarkupSelectorItem
- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classMarkupSelectorItem.AttributeCondition(package private) static classMarkupSelectorItem.AttributeConditionRelation(package private) static interfaceMarkupSelectorItem.IAttributeCondition(package private) static classMarkupSelectorItem.IndexCondition
-
Field Summary
Fields Modifier and Type Field Description private booleananyLevelprivate MarkupSelectorItem.IAttributeConditionattributeCondition(package private) static java.lang.StringCDATA_SECTION_SELECTORprivate booleancdataSectionSelector(package private) static java.lang.StringCLASS_ATTRIBUTE_NAME(package private) static java.lang.StringCLASS_MODIFIER_SEPARATOR(package private) static java.lang.StringCOMMENT_SELECTORprivate booleancommentSelector(package private) static java.lang.StringCONTENT_SELECTORprivate booleancontentSelector(package private) static java.lang.StringDOC_TYPE_CLAUSE_SELECTORprivate booleandocTypeClauseSelector(package private) static java.lang.StringEVEN_SELECTORprivate booleanhtml(package private) static java.lang.StringID_ATTRIBUTE_NAME(package private) static java.lang.StringID_MODIFIER_SEPARATORprivate MarkupSelectorItem.IndexConditionindex(package private) static java.lang.StringODD_SELECTOR(package private) static java.lang.StringPROCESSING_INSTRUCTION_SELECTORprivate booleanprocessingInstructionSelector(package private) static java.lang.StringREFERENCE_MODIFIER_SEPARATORprivate booleanrequiresAttributesInElementprivate java.lang.StringselectorPathprivate intselectorPathLen(package private) static java.lang.StringTEXT_SELECTORprivate booleantextSelector(package private) static java.lang.StringXML_DECLARATION_SELECTORprivate booleanxmlDeclarationSelector
-
Constructor Summary
Constructors Constructor Description MarkupSelectorItem(boolean html, boolean anyLevel, boolean contentSelector, boolean textSelector, boolean commentSelector, boolean cdataSectionSelector, boolean docTypeClauseSelector, boolean xmlDeclarationSelector, boolean processingInstructionSelector, java.lang.String selectorPath, MarkupSelectorItem.IndexCondition index, MarkupSelectorItem.IAttributeCondition attributeCondition)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleananyLevel()private static booleancomputeRequiresAttributesInElement(MarkupSelectorItem.IAttributeCondition attributeCondition)private static booleanisEmptyOrWhitespace(java.lang.String target)private static booleanmatchesAttribute(boolean html, SelectorElementBuffer elementBuffer, java.lang.String attrName, MarkupSelectorItem.AttributeCondition.Operator attrOperator, java.lang.String attrValue)private static booleanmatchesAttributeCondition(boolean html, SelectorElementBuffer elementBuffer, MarkupSelectorItem.IAttributeCondition attributeCondition)private static booleanmatchesAttributeValue(MarkupSelectorItem.AttributeCondition.Operator attrOperator, java.lang.String attrValue, char[] elementAttrValueBuffer, int elementAttrValueOffset, int elementAttrValueLen)booleanmatchesCDATASection(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)private static booleanmatchesClassAttributeValue(MarkupSelectorItem.AttributeCondition.Operator attrOperator, java.lang.String attrValue, char[] elementAttrValueBuffer, int elementAttrValueOffset, int elementAttrValueLen)booleanmatchesComment(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)booleanmatchesDocTypeClause(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)booleanmatchesElement(int markupBlockIndex, SelectorElementBuffer elementBuffer, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)private static booleanmatchesIndex(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter, MarkupSelectorItem.IndexCondition indexCondition)booleanmatchesProcessingInstruction(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)booleanmatchesText(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)booleanmatchesXmlDeclaration(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)java.lang.StringtoString()private static java.lang.StringtoStringAttributeCondition(MarkupSelectorItem.IAttributeCondition attributeCondition, boolean outputParenthesis)
-
-
-
Field Detail
-
CONTENT_SELECTOR
static final java.lang.String CONTENT_SELECTOR
- See Also:
- Constant Field Values
-
TEXT_SELECTOR
static final java.lang.String TEXT_SELECTOR
- See Also:
- Constant Field Values
-
COMMENT_SELECTOR
static final java.lang.String COMMENT_SELECTOR
- See Also:
- Constant Field Values
-
CDATA_SECTION_SELECTOR
static final java.lang.String CDATA_SECTION_SELECTOR
- See Also:
- Constant Field Values
-
DOC_TYPE_CLAUSE_SELECTOR
static final java.lang.String DOC_TYPE_CLAUSE_SELECTOR
- See Also:
- Constant Field Values
-
XML_DECLARATION_SELECTOR
static final java.lang.String XML_DECLARATION_SELECTOR
- See Also:
- Constant Field Values
-
PROCESSING_INSTRUCTION_SELECTOR
static final java.lang.String PROCESSING_INSTRUCTION_SELECTOR
- See Also:
- Constant Field Values
-
ID_MODIFIER_SEPARATOR
static final java.lang.String ID_MODIFIER_SEPARATOR
- See Also:
- Constant Field Values
-
CLASS_MODIFIER_SEPARATOR
static final java.lang.String CLASS_MODIFIER_SEPARATOR
- See Also:
- Constant Field Values
-
REFERENCE_MODIFIER_SEPARATOR
static final java.lang.String REFERENCE_MODIFIER_SEPARATOR
- See Also:
- Constant Field Values
-
ID_ATTRIBUTE_NAME
static final java.lang.String ID_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
CLASS_ATTRIBUTE_NAME
static final java.lang.String CLASS_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
ODD_SELECTOR
static final java.lang.String ODD_SELECTOR
- See Also:
- Constant Field Values
-
EVEN_SELECTOR
static final java.lang.String EVEN_SELECTOR
- See Also:
- Constant Field Values
-
html
private final boolean html
-
anyLevel
private final boolean anyLevel
-
contentSelector
private final boolean contentSelector
-
textSelector
private final boolean textSelector
-
commentSelector
private final boolean commentSelector
-
cdataSectionSelector
private final boolean cdataSectionSelector
-
docTypeClauseSelector
private final boolean docTypeClauseSelector
-
xmlDeclarationSelector
private final boolean xmlDeclarationSelector
-
processingInstructionSelector
private final boolean processingInstructionSelector
-
selectorPath
private final java.lang.String selectorPath
-
selectorPathLen
private final int selectorPathLen
-
index
private final MarkupSelectorItem.IndexCondition index
-
attributeCondition
private final MarkupSelectorItem.IAttributeCondition attributeCondition
-
requiresAttributesInElement
private final boolean requiresAttributesInElement
-
-
Constructor Detail
-
MarkupSelectorItem
MarkupSelectorItem(boolean html, boolean anyLevel, boolean contentSelector, boolean textSelector, boolean commentSelector, boolean cdataSectionSelector, boolean docTypeClauseSelector, boolean xmlDeclarationSelector, boolean processingInstructionSelector, java.lang.String selectorPath, MarkupSelectorItem.IndexCondition index, MarkupSelectorItem.IAttributeCondition attributeCondition)
-
-
Method Detail
-
computeRequiresAttributesInElement
private static boolean computeRequiresAttributesInElement(MarkupSelectorItem.IAttributeCondition attributeCondition)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStringAttributeCondition
private static java.lang.String toStringAttributeCondition(MarkupSelectorItem.IAttributeCondition attributeCondition, boolean outputParenthesis)
-
anyLevel
public boolean anyLevel()
- Specified by:
anyLevelin interfaceIMarkupSelectorItem
-
matchesText
public boolean matchesText(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)- Specified by:
matchesTextin interfaceIMarkupSelectorItem
-
matchesComment
public boolean matchesComment(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)- Specified by:
matchesCommentin interfaceIMarkupSelectorItem
-
matchesCDATASection
public boolean matchesCDATASection(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)- Specified by:
matchesCDATASectionin interfaceIMarkupSelectorItem
-
matchesDocTypeClause
public boolean matchesDocTypeClause(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)- Specified by:
matchesDocTypeClausein interfaceIMarkupSelectorItem
-
matchesXmlDeclaration
public boolean matchesXmlDeclaration(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)- Specified by:
matchesXmlDeclarationin interfaceIMarkupSelectorItem
-
matchesProcessingInstruction
public boolean matchesProcessingInstruction(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)- Specified by:
matchesProcessingInstructionin interfaceIMarkupSelectorItem
-
matchesElement
public boolean matchesElement(int markupBlockIndex, SelectorElementBuffer elementBuffer, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)- Specified by:
matchesElementin interfaceIMarkupSelectorItem
-
matchesAttributeCondition
private static boolean matchesAttributeCondition(boolean html, SelectorElementBuffer elementBuffer, MarkupSelectorItem.IAttributeCondition attributeCondition)
-
matchesAttribute
private static boolean matchesAttribute(boolean html, SelectorElementBuffer elementBuffer, java.lang.String attrName, MarkupSelectorItem.AttributeCondition.Operator attrOperator, java.lang.String attrValue)
-
matchesAttributeValue
private static boolean matchesAttributeValue(MarkupSelectorItem.AttributeCondition.Operator attrOperator, java.lang.String attrValue, char[] elementAttrValueBuffer, int elementAttrValueOffset, int elementAttrValueLen)
-
matchesClassAttributeValue
private static boolean matchesClassAttributeValue(MarkupSelectorItem.AttributeCondition.Operator attrOperator, java.lang.String attrValue, char[] elementAttrValueBuffer, int elementAttrValueOffset, int elementAttrValueLen)
-
matchesIndex
private static boolean matchesIndex(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter, MarkupSelectorItem.IndexCondition indexCondition)
-
isEmptyOrWhitespace
private static boolean isEmptyOrWhitespace(java.lang.String target)
-
-