Class SelectorFactoryImpl
java.lang.Object
com.steadystate.css.parser.selectors.SelectorFactoryImpl
- All Implemented Interfaces:
SelectorFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates an any node selector.Creates a cdata section node selector.createChildSelector
(Selector parent, SimpleSelector child) Creates a child selector.createCommentSelector
(String data) Creates a comment node selector.createConditionalSelector
(SimpleSelector selector, Condition condition) Creates a conditional selector.createDescendantSelector
(Selector parent, SimpleSelector descendant) Creates a descendant selector.createDirectAdjacentSelector
(short nodeType, Selector child, SimpleSelector directAdjacent) Creates a sibling selector.createElementSelector
(String namespaceURI, String localName) Creates an element selector.createNegativeSelector
(SimpleSelector selector) Creates an negative selector.createProcessingInstructionSelector
(String target, String data) Creates a processing instruction node selector.createPseudoElementSelector
(String namespaceURI, String pseudoName) Creates a pseudo element selector.Creates an root node selector.createTextNodeSelector
(String data) Creates a text node selector.
-
Constructor Details
-
SelectorFactoryImpl
public SelectorFactoryImpl()
-
-
Method Details
-
createConditionalSelector
public ConditionalSelector createConditionalSelector(SimpleSelector selector, Condition condition) throws CSSException Description copied from interface:SelectorFactory
Creates a conditional selector.- Specified by:
createConditionalSelector
in interfaceSelectorFactory
- Parameters:
selector
- a selector.condition
- a condition- Returns:
- the conditional selector.
- Throws:
CSSException
- If this selector is not supported.
-
createAnyNodeSelector
Description copied from interface:SelectorFactory
Creates an any node selector.- Specified by:
createAnyNodeSelector
in interfaceSelectorFactory
- Returns:
- the any node selector.
- Throws:
CSSException
- If this selector is not supported.
-
createRootNodeSelector
Description copied from interface:SelectorFactory
Creates an root node selector.- Specified by:
createRootNodeSelector
in interfaceSelectorFactory
- Returns:
- the root node selector.
- Throws:
CSSException
- If this selector is not supported.
-
createNegativeSelector
Description copied from interface:SelectorFactory
Creates an negative selector.- Specified by:
createNegativeSelector
in interfaceSelectorFactory
- Parameters:
selector
- a selector.- Returns:
- the negative selector.
- Throws:
CSSException
- If this selector is not supported.
-
createElementSelector
public ElementSelector createElementSelector(String namespaceURI, String localName) throws CSSException Description copied from interface:SelectorFactory
Creates an element selector.- Specified by:
createElementSelector
in interfaceSelectorFactory
- Parameters:
namespaceURI
- the namespace URI of the element selector.localName
- the local part of the element name.NULL
if this element selector can match any element.- Returns:
- the element selector
- Throws:
CSSException
- If this selector is not supported.
-
createTextNodeSelector
Description copied from interface:SelectorFactory
Creates a text node selector.- Specified by:
createTextNodeSelector
in interfaceSelectorFactory
- Parameters:
data
- the data- Returns:
- the text node selector
- Throws:
CSSException
- If this selector is not supported.
-
createCDataSectionSelector
Description copied from interface:SelectorFactory
Creates a cdata section node selector.- Specified by:
createCDataSectionSelector
in interfaceSelectorFactory
- Parameters:
data
- the data- Returns:
- the cdata section node selector
- Throws:
CSSException
- If this selector is not supported.
-
createProcessingInstructionSelector
public ProcessingInstructionSelector createProcessingInstructionSelector(String target, String data) throws CSSException Description copied from interface:SelectorFactory
Creates a processing instruction node selector.- Specified by:
createProcessingInstructionSelector
in interfaceSelectorFactory
- Parameters:
target
- the targetdata
- the data- Returns:
- the processing instruction node selector
- Throws:
CSSException
- If this selector is not supported.
-
createCommentSelector
Description copied from interface:SelectorFactory
Creates a comment node selector.- Specified by:
createCommentSelector
in interfaceSelectorFactory
- Parameters:
data
- the data- Returns:
- the comment node selector
- Throws:
CSSException
- If this selector is not supported.
-
createPseudoElementSelector
public ElementSelector createPseudoElementSelector(String namespaceURI, String pseudoName) throws CSSException Description copied from interface:SelectorFactory
Creates a pseudo element selector.- Specified by:
createPseudoElementSelector
in interfaceSelectorFactory
pseudoName
- the pseudo element name.NULL
if this element selector can match any pseudo element.- Returns:
- the element selector
- Throws:
CSSException
- If this selector is not supported.
-
createDescendantSelector
public DescendantSelector createDescendantSelector(Selector parent, SimpleSelector descendant) throws CSSException Description copied from interface:SelectorFactory
Creates a descendant selector.- Specified by:
createDescendantSelector
in interfaceSelectorFactory
- Parameters:
parent
- the parent selectordescendant
- the descendant selector- Returns:
- the combinator selector.
- Throws:
CSSException
- If this selector is not supported.
-
createChildSelector
public DescendantSelector createChildSelector(Selector parent, SimpleSelector child) throws CSSException Description copied from interface:SelectorFactory
Creates a child selector.- Specified by:
createChildSelector
in interfaceSelectorFactory
- Parameters:
parent
- the parent selectorchild
- the child selector- Returns:
- the combinator selector.
- Throws:
CSSException
- If this selector is not supported.
-
createDirectAdjacentSelector
public SiblingSelector createDirectAdjacentSelector(short nodeType, Selector child, SimpleSelector directAdjacent) throws CSSException Description copied from interface:SelectorFactory
Creates a sibling selector.- Specified by:
createDirectAdjacentSelector
in interfaceSelectorFactory
- Parameters:
nodeType
- the type of nodes in the siblings list.child
- the child selector- Returns:
- the sibling selector with nodeType equals to org.w3c.dom.Node.ELEMENT_NODE
- Throws:
CSSException
- If this selector is not supported.
-