Class SelectorFactoryImpl
- java.lang.Object
-
- com.steadystate.css.parser.selectors.SelectorFactoryImpl
-
- All Implemented Interfaces:
SelectorFactory
public class SelectorFactoryImpl extends java.lang.Object implements SelectorFactory
-
-
Constructor Summary
Constructors Constructor Description SelectorFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleSelectorcreateAnyNodeSelector()Creates an any node selector.CharacterDataSelectorcreateCDataSectionSelector(java.lang.String data)Creates a cdata section node selector.DescendantSelectorcreateChildSelector(Selector parent, SimpleSelector child)Creates a child selector.CharacterDataSelectorcreateCommentSelector(java.lang.String data)Creates a comment node selector.ConditionalSelectorcreateConditionalSelector(SimpleSelector selector, Condition condition)Creates a conditional selector.DescendantSelectorcreateDescendantSelector(Selector parent, SimpleSelector descendant)Creates a descendant selector.SiblingSelectorcreateDirectAdjacentSelector(short nodeType, Selector child, SimpleSelector directAdjacent)Creates a sibling selector.ElementSelectorcreateElementSelector(java.lang.String namespaceURI, java.lang.String localName)Creates an element selector.NegativeSelectorcreateNegativeSelector(SimpleSelector selector)Creates an negative selector.ProcessingInstructionSelectorcreateProcessingInstructionSelector(java.lang.String target, java.lang.String data)Creates a processing instruction node selector.ElementSelectorcreatePseudoElementSelector(java.lang.String namespaceURI, java.lang.String pseudoName)Creates a pseudo element selector.SimpleSelectorcreateRootNodeSelector()Creates an root node selector.CharacterDataSelectorcreateTextNodeSelector(java.lang.String data)Creates a text node selector.
-
-
-
Method Detail
-
createConditionalSelector
public ConditionalSelector createConditionalSelector(SimpleSelector selector, Condition condition) throws CSSException
Description copied from interface:SelectorFactoryCreates a conditional selector.- Specified by:
createConditionalSelectorin interfaceSelectorFactory- Parameters:
selector- a selector.condition- a condition- Returns:
- the conditional selector.
- Throws:
CSSException- If this selector is not supported.
-
createAnyNodeSelector
public SimpleSelector createAnyNodeSelector() throws CSSException
Description copied from interface:SelectorFactoryCreates an any node selector.- Specified by:
createAnyNodeSelectorin interfaceSelectorFactory- Returns:
- the any node selector.
- Throws:
CSSException- If this selector is not supported.
-
createRootNodeSelector
public SimpleSelector createRootNodeSelector() throws CSSException
Description copied from interface:SelectorFactoryCreates an root node selector.- Specified by:
createRootNodeSelectorin interfaceSelectorFactory- Returns:
- the root node selector.
- Throws:
CSSException- If this selector is not supported.
-
createNegativeSelector
public NegativeSelector createNegativeSelector(SimpleSelector selector) throws CSSException
Description copied from interface:SelectorFactoryCreates an negative selector.- Specified by:
createNegativeSelectorin interfaceSelectorFactory- Parameters:
selector- a selector.- Returns:
- the negative selector.
- Throws:
CSSException- If this selector is not supported.
-
createElementSelector
public ElementSelector createElementSelector(java.lang.String namespaceURI, java.lang.String localName) throws CSSException
Description copied from interface:SelectorFactoryCreates an element selector.- Specified by:
createElementSelectorin interfaceSelectorFactory- Parameters:
namespaceURI- the namespace URI of the element selector.localName- the local part of the element name.NULLif this element selector can match any element.- Returns:
- the element selector
- Throws:
CSSException- If this selector is not supported.
-
createTextNodeSelector
public CharacterDataSelector createTextNodeSelector(java.lang.String data) throws CSSException
Description copied from interface:SelectorFactoryCreates a text node selector.- Specified by:
createTextNodeSelectorin interfaceSelectorFactory- Parameters:
data- the data- Returns:
- the text node selector
- Throws:
CSSException- If this selector is not supported.
-
createCDataSectionSelector
public CharacterDataSelector createCDataSectionSelector(java.lang.String data) throws CSSException
Description copied from interface:SelectorFactoryCreates a cdata section node selector.- Specified by:
createCDataSectionSelectorin interfaceSelectorFactory- Parameters:
data- the data- Returns:
- the cdata section node selector
- Throws:
CSSException- If this selector is not supported.
-
createProcessingInstructionSelector
public ProcessingInstructionSelector createProcessingInstructionSelector(java.lang.String target, java.lang.String data) throws CSSException
Description copied from interface:SelectorFactoryCreates a processing instruction node selector.- Specified by:
createProcessingInstructionSelectorin interfaceSelectorFactory- Parameters:
target- the targetdata- the data- Returns:
- the processing instruction node selector
- Throws:
CSSException- If this selector is not supported.
-
createCommentSelector
public CharacterDataSelector createCommentSelector(java.lang.String data) throws CSSException
Description copied from interface:SelectorFactoryCreates a comment node selector.- Specified by:
createCommentSelectorin interfaceSelectorFactory- Parameters:
data- the data- Returns:
- the comment node selector
- Throws:
CSSException- If this selector is not supported.
-
createPseudoElementSelector
public ElementSelector createPseudoElementSelector(java.lang.String namespaceURI, java.lang.String pseudoName) throws CSSException
Description copied from interface:SelectorFactoryCreates a pseudo element selector.- Specified by:
createPseudoElementSelectorin interfaceSelectorFactorypseudoName- the pseudo element name.NULLif 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:SelectorFactoryCreates a descendant selector.- Specified by:
createDescendantSelectorin 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:SelectorFactoryCreates a child selector.- Specified by:
createChildSelectorin 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:SelectorFactoryCreates a sibling selector.- Specified by:
createDirectAdjacentSelectorin 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.
-
-