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 class
MarkupSelectorItem.AttributeCondition
(package private) static class
MarkupSelectorItem.AttributeConditionRelation
(package private) static interface
MarkupSelectorItem.IAttributeCondition
(package private) static class
MarkupSelectorItem.IndexCondition
-
Field Summary
Fields Modifier and Type Field Description private boolean
anyLevel
private MarkupSelectorItem.IAttributeCondition
attributeCondition
(package private) static java.lang.String
CDATA_SECTION_SELECTOR
private boolean
cdataSectionSelector
(package private) static java.lang.String
CLASS_ATTRIBUTE_NAME
(package private) static java.lang.String
CLASS_MODIFIER_SEPARATOR
(package private) static java.lang.String
COMMENT_SELECTOR
private boolean
commentSelector
(package private) static java.lang.String
CONTENT_SELECTOR
private boolean
contentSelector
(package private) static java.lang.String
DOC_TYPE_CLAUSE_SELECTOR
private boolean
docTypeClauseSelector
(package private) static java.lang.String
EVEN_SELECTOR
private boolean
html
(package private) static java.lang.String
ID_ATTRIBUTE_NAME
(package private) static java.lang.String
ID_MODIFIER_SEPARATOR
private MarkupSelectorItem.IndexCondition
index
(package private) static java.lang.String
ODD_SELECTOR
(package private) static java.lang.String
PROCESSING_INSTRUCTION_SELECTOR
private boolean
processingInstructionSelector
(package private) static java.lang.String
REFERENCE_MODIFIER_SEPARATOR
private boolean
requiresAttributesInElement
private java.lang.String
selectorPath
private int
selectorPathLen
(package private) static java.lang.String
TEXT_SELECTOR
private boolean
textSelector
(package private) static java.lang.String
XML_DECLARATION_SELECTOR
private boolean
xmlDeclarationSelector
-
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 boolean
anyLevel()
private static boolean
computeRequiresAttributesInElement(MarkupSelectorItem.IAttributeCondition attributeCondition)
private static boolean
isEmptyOrWhitespace(java.lang.String target)
private static boolean
matchesAttribute(boolean html, SelectorElementBuffer elementBuffer, java.lang.String attrName, MarkupSelectorItem.AttributeCondition.Operator attrOperator, java.lang.String attrValue)
private static boolean
matchesAttributeCondition(boolean html, SelectorElementBuffer elementBuffer, MarkupSelectorItem.IAttributeCondition attributeCondition)
private static boolean
matchesAttributeValue(MarkupSelectorItem.AttributeCondition.Operator attrOperator, java.lang.String attrValue, char[] elementAttrValueBuffer, int elementAttrValueOffset, int elementAttrValueLen)
boolean
matchesCDATASection(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
private static boolean
matchesClassAttributeValue(MarkupSelectorItem.AttributeCondition.Operator attrOperator, java.lang.String attrValue, char[] elementAttrValueBuffer, int elementAttrValueOffset, int elementAttrValueLen)
boolean
matchesComment(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
boolean
matchesDocTypeClause(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
boolean
matchesElement(int markupBlockIndex, SelectorElementBuffer elementBuffer, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
private static boolean
matchesIndex(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter, MarkupSelectorItem.IndexCondition indexCondition)
boolean
matchesProcessingInstruction(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
boolean
matchesText(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
boolean
matchesXmlDeclaration(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
java.lang.String
toString()
private static java.lang.String
toStringAttributeCondition(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:
toString
in classjava.lang.Object
-
toStringAttributeCondition
private static java.lang.String toStringAttributeCondition(MarkupSelectorItem.IAttributeCondition attributeCondition, boolean outputParenthesis)
-
anyLevel
public boolean anyLevel()
- Specified by:
anyLevel
in interfaceIMarkupSelectorItem
-
matchesText
public boolean matchesText(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
- Specified by:
matchesText
in interfaceIMarkupSelectorItem
-
matchesComment
public boolean matchesComment(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
- Specified by:
matchesComment
in interfaceIMarkupSelectorItem
-
matchesCDATASection
public boolean matchesCDATASection(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
- Specified by:
matchesCDATASection
in interfaceIMarkupSelectorItem
-
matchesDocTypeClause
public boolean matchesDocTypeClause(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
- Specified by:
matchesDocTypeClause
in interfaceIMarkupSelectorItem
-
matchesXmlDeclaration
public boolean matchesXmlDeclaration(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
- Specified by:
matchesXmlDeclaration
in interfaceIMarkupSelectorItem
-
matchesProcessingInstruction
public boolean matchesProcessingInstruction(int markupBlockIndex, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
- Specified by:
matchesProcessingInstruction
in interfaceIMarkupSelectorItem
-
matchesElement
public boolean matchesElement(int markupBlockIndex, SelectorElementBuffer elementBuffer, MarkupSelectorFilter.MarkupBlockMatchingCounter markupBlockMatchingCounter)
- Specified by:
matchesElement
in 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)
-
-