Class ConditionFactoryImpl
- java.lang.Object
-
- com.steadystate.css.parser.selectors.ConditionFactoryImpl
-
- All Implemented Interfaces:
ConditionFactory
public class ConditionFactoryImpl extends java.lang.Object implements ConditionFactory
-
-
Constructor Summary
Constructors Constructor Description ConditionFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CombinatorCondition
createAndCondition(Condition first, Condition second)
Creates an and conditionAttributeCondition
createAttributeCondition(java.lang.String localName, java.lang.String namespaceURI, boolean specified, java.lang.String value)
Creates an attribute conditionAttributeCondition
createBeginHyphenAttributeCondition(java.lang.String localName, java.lang.String namespaceURI, boolean specified, java.lang.String value)
Creates a "begin hyphen" attribute conditionAttributeCondition
createClassCondition(java.lang.String namespaceURI, java.lang.String value)
Creates a class conditionContentCondition
createContentCondition(java.lang.String data)
Creates a content conditionAttributeCondition
createIdCondition(java.lang.String value)
Creates an id conditionLangCondition
createLangCondition(java.lang.String lang)
Creates a lang conditionNegativeCondition
createNegativeCondition(Condition condition)
Creates a negative conditionAttributeCondition
createOneOfAttributeCondition(java.lang.String localName, java.lang.String namespaceURI, boolean specified, java.lang.String value)
Creates a "one of" attribute conditionCondition
createOnlyChildCondition()
Creates a "only one" child conditionCondition
createOnlyTypeCondition()
Creates a "only one" type conditionCombinatorCondition
createOrCondition(Condition first, Condition second)
Creates an or conditionPositionalCondition
createPositionalCondition(int position, boolean typeNode, boolean type)
Creates a positional conditionAttributeCondition
createPseudoClassCondition(java.lang.String namespaceURI, java.lang.String value)
Creates a pseudo class condition
-
-
-
Method Detail
-
createAndCondition
public CombinatorCondition createAndCondition(Condition first, Condition second) throws CSSException
Description copied from interface:ConditionFactory
Creates an and condition- Specified by:
createAndCondition
in interfaceConditionFactory
- Parameters:
first
- the first conditionsecond
- the second condition- Returns:
- A combinator condition
- Throws:
CSSException
- if this exception is not supported.
-
createOrCondition
public CombinatorCondition createOrCondition(Condition first, Condition second) throws CSSException
Description copied from interface:ConditionFactory
Creates an or condition- Specified by:
createOrCondition
in interfaceConditionFactory
- Parameters:
first
- the first conditionsecond
- the second condition- Returns:
- A combinator condition
- Throws:
CSSException
- if this exception is not supported.
-
createNegativeCondition
public NegativeCondition createNegativeCondition(Condition condition) throws CSSException
Description copied from interface:ConditionFactory
Creates a negative condition- Specified by:
createNegativeCondition
in interfaceConditionFactory
- Parameters:
condition
- the condition- Returns:
- A negative condition
- Throws:
CSSException
- if this exception is not supported.
-
createPositionalCondition
public PositionalCondition createPositionalCondition(int position, boolean typeNode, boolean type) throws CSSException
Description copied from interface:ConditionFactory
Creates a positional condition- Specified by:
createPositionalCondition
in interfaceConditionFactory
- Parameters:
position
- the position of the node in the list.typeNode
-true
if the list should contain only nodes of the same type (element, text node, ...).type
-true
true if the list should contain only nodes of the same node (for element, same localName and same namespaceURI).- Returns:
- A positional condition
- Throws:
CSSException
- if this exception is not supported.
-
createAttributeCondition
public AttributeCondition createAttributeCondition(java.lang.String localName, java.lang.String namespaceURI, boolean specified, java.lang.String value) throws CSSException
Description copied from interface:ConditionFactory
Creates an attribute condition- Specified by:
createAttributeCondition
in interfaceConditionFactory
- Parameters:
localName
- the localName of the attributenamespaceURI
- the namespace URI of the attributespecified
-true
if the attribute must be specified in the document.value
- the value of this attribute.- Returns:
- An attribute condition
- Throws:
CSSException
- if this exception is not supported.
-
createIdCondition
public AttributeCondition createIdCondition(java.lang.String value) throws CSSException
Description copied from interface:ConditionFactory
Creates an id condition- Specified by:
createIdCondition
in interfaceConditionFactory
- Parameters:
value
- the value of the id.- Returns:
- An Id condition
- Throws:
CSSException
- if this exception is not supported.
-
createLangCondition
public LangCondition createLangCondition(java.lang.String lang) throws CSSException
Description copied from interface:ConditionFactory
Creates a lang condition- Specified by:
createLangCondition
in interfaceConditionFactory
- Returns:
- A lang condition
- Throws:
CSSException
- if this exception is not supported.
-
createOneOfAttributeCondition
public AttributeCondition createOneOfAttributeCondition(java.lang.String localName, java.lang.String namespaceURI, boolean specified, java.lang.String value) throws CSSException
Description copied from interface:ConditionFactory
Creates a "one of" attribute condition- Specified by:
createOneOfAttributeCondition
in interfaceConditionFactory
- Parameters:
localName
- the localName of the attributenamespaceURI
- the namespace URI of the attributespecified
-true
if the attribute must be specified in the document.value
- the value of this attribute.- Returns:
- A "one of" attribute condition
- Throws:
CSSException
- if this exception is not supported.
-
createBeginHyphenAttributeCondition
public AttributeCondition createBeginHyphenAttributeCondition(java.lang.String localName, java.lang.String namespaceURI, boolean specified, java.lang.String value) throws CSSException
Description copied from interface:ConditionFactory
Creates a "begin hyphen" attribute condition- Specified by:
createBeginHyphenAttributeCondition
in interfaceConditionFactory
- Parameters:
localName
- the localName of the attributenamespaceURI
- the namespace URI of the attributespecified
-true
if the attribute must be specified in the document.value
- the value of this attribute.- Returns:
- A "begin hyphen" attribute condition
- Throws:
CSSException
- if this exception is not supported.
-
createClassCondition
public AttributeCondition createClassCondition(java.lang.String namespaceURI, java.lang.String value) throws CSSException
Description copied from interface:ConditionFactory
Creates a class condition- Specified by:
createClassCondition
in interfaceConditionFactory
- Parameters:
namespaceURI
- the namespace URI of the attributevalue
- the name of the class.- Returns:
- A class condition
- Throws:
CSSException
- if this exception is not supported.
-
createPseudoClassCondition
public AttributeCondition createPseudoClassCondition(java.lang.String namespaceURI, java.lang.String value) throws CSSException
Description copied from interface:ConditionFactory
Creates a pseudo class condition- Specified by:
createPseudoClassCondition
in interfaceConditionFactory
- Parameters:
namespaceURI
- the namespace URI of the attributevalue
- the name of the pseudo class- Returns:
- A pseudo class condition
- Throws:
CSSException
- if this exception is not supported.
-
createOnlyChildCondition
public Condition createOnlyChildCondition() throws CSSException
Description copied from interface:ConditionFactory
Creates a "only one" child condition- Specified by:
createOnlyChildCondition
in interfaceConditionFactory
- Returns:
- A "only one" child condition
- Throws:
CSSException
- if this exception is not supported.
-
createOnlyTypeCondition
public Condition createOnlyTypeCondition() throws CSSException
Description copied from interface:ConditionFactory
Creates a "only one" type condition- Specified by:
createOnlyTypeCondition
in interfaceConditionFactory
- Returns:
- A "only one" type condition
- Throws:
CSSException
- if this exception is not supported.
-
createContentCondition
public ContentCondition createContentCondition(java.lang.String data) throws CSSException
Description copied from interface:ConditionFactory
Creates a content condition- Specified by:
createContentCondition
in interfaceConditionFactory
- Parameters:
data
- the data in the content- Returns:
- A content condition
- Throws:
CSSException
- if this exception is not supported.
-
-