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 CombinatorConditioncreateAndCondition(Condition first, Condition second)Creates an and conditionAttributeConditioncreateAttributeCondition(java.lang.String localName, java.lang.String namespaceURI, boolean specified, java.lang.String value)Creates an attribute conditionAttributeConditioncreateBeginHyphenAttributeCondition(java.lang.String localName, java.lang.String namespaceURI, boolean specified, java.lang.String value)Creates a "begin hyphen" attribute conditionAttributeConditioncreateClassCondition(java.lang.String namespaceURI, java.lang.String value)Creates a class conditionContentConditioncreateContentCondition(java.lang.String data)Creates a content conditionAttributeConditioncreateIdCondition(java.lang.String value)Creates an id conditionLangConditioncreateLangCondition(java.lang.String lang)Creates a lang conditionNegativeConditioncreateNegativeCondition(Condition condition)Creates a negative conditionAttributeConditioncreateOneOfAttributeCondition(java.lang.String localName, java.lang.String namespaceURI, boolean specified, java.lang.String value)Creates a "one of" attribute conditionConditioncreateOnlyChildCondition()Creates a "only one" child conditionConditioncreateOnlyTypeCondition()Creates a "only one" type conditionCombinatorConditioncreateOrCondition(Condition first, Condition second)Creates an or conditionPositionalConditioncreatePositionalCondition(int position, boolean typeNode, boolean type)Creates a positional conditionAttributeConditioncreatePseudoClassCondition(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:ConditionFactoryCreates an and condition- Specified by:
createAndConditionin 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:ConditionFactoryCreates an or condition- Specified by:
createOrConditionin 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:ConditionFactoryCreates a negative condition- Specified by:
createNegativeConditionin 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:ConditionFactoryCreates a positional condition- Specified by:
createPositionalConditionin interfaceConditionFactory- Parameters:
position- the position of the node in the list.typeNode-trueif the list should contain only nodes of the same type (element, text node, ...).type-truetrue 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:ConditionFactoryCreates an attribute condition- Specified by:
createAttributeConditionin interfaceConditionFactory- Parameters:
localName- the localName of the attributenamespaceURI- the namespace URI of the attributespecified-trueif 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:ConditionFactoryCreates an id condition- Specified by:
createIdConditionin 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:ConditionFactoryCreates a lang condition- Specified by:
createLangConditionin 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:ConditionFactoryCreates a "one of" attribute condition- Specified by:
createOneOfAttributeConditionin interfaceConditionFactory- Parameters:
localName- the localName of the attributenamespaceURI- the namespace URI of the attributespecified-trueif 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:ConditionFactoryCreates a "begin hyphen" attribute condition- Specified by:
createBeginHyphenAttributeConditionin interfaceConditionFactory- Parameters:
localName- the localName of the attributenamespaceURI- the namespace URI of the attributespecified-trueif 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:ConditionFactoryCreates a class condition- Specified by:
createClassConditionin 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:ConditionFactoryCreates a pseudo class condition- Specified by:
createPseudoClassConditionin 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:ConditionFactoryCreates a "only one" child condition- Specified by:
createOnlyChildConditionin 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:ConditionFactoryCreates a "only one" type condition- Specified by:
createOnlyTypeConditionin 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:ConditionFactoryCreates a content condition- Specified by:
createContentConditionin interfaceConditionFactory- Parameters:
data- the data in the content- Returns:
- A content condition
- Throws:
CSSException- if this exception is not supported.
-
-