1 14 package org.w3c.flute.parser.selectors; 15 16 import org.w3c.css.sac.CSSException; 17 import org.w3c.css.sac.Condition; 18 import org.w3c.css.sac.AttributeCondition; 19 import org.w3c.css.sac.LangCondition; 20 import org.w3c.css.sac.ContentCondition; 21 import org.w3c.css.sac.CombinatorCondition; 22 import org.w3c.css.sac.PositionalCondition; 23 import org.w3c.css.sac.NegativeCondition; 24 import org.w3c.css.sac.ConditionFactory; 25 26 30 public class ConditionFactoryImpl implements ConditionFactory { 31 32 40 public CombinatorCondition createAndCondition(Condition first, 41 Condition second) 42 throws CSSException { 43 return new AndConditionImpl(first, second); 44 } 45 46 54 public CombinatorCondition createOrCondition(Condition first, 55 Condition second) 56 throws CSSException { 57 throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); 58 } 59 60 67 public NegativeCondition createNegativeCondition(Condition condition) 68 throws CSSException { 69 throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); 70 } 71 72 73 85 public PositionalCondition createPositionalCondition(int position, 86 boolean typeNode, 87 boolean type) 88 throws CSSException { 89 throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); 90 } 91 92 103 public AttributeCondition createAttributeCondition(String localName, 104 String namespaceURI, 105 boolean specified, 106 String value) 107 throws CSSException { 108 if ((namespaceURI != null) || specified) { 109 throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); 110 } else { 111 return new AttributeConditionImpl(localName, value); 112 } 113 } 114 115 122 public AttributeCondition createIdCondition(String value) 123 throws CSSException { 124 return new IdConditionImpl(value); 125 } 126 127 134 public LangCondition createLangCondition(String lang) 135 throws CSSException { 136 return new LangConditionImpl(lang); 137 } 138 139 150 public AttributeCondition createOneOfAttributeCondition(String localName, 151 String namespaceURI, 152 boolean specified, 153 String value) 154 throws CSSException { 155 if ((namespaceURI != null) || specified) { 156 throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); 157 } else { 158 return new OneOfAttributeConditionImpl(localName, value); 159 } 160 } 161 162 173 public AttributeCondition createBeginHyphenAttributeCondition(String localName, 174 String namespaceURI, 175 boolean specified, 176 String value) 177 throws CSSException { 178 if ((namespaceURI != null) || specified) { 179 throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); 180 } else { 181 return new BeginHyphenAttributeConditionImpl(localName, value); 182 } 183 } 184 185 196 public AttributeCondition createClassCondition(String namespaceURI, 197 String value) 198 throws CSSException { 199 return new ClassConditionImpl(value); 200 } 201 202 210 public AttributeCondition createPseudoClassCondition(String namespaceURI, 211 String value) 212 throws CSSException { 213 return new PseudoClassConditionImpl(value); 214 } 215 216 222 public Condition createOnlyChildCondition() throws CSSException { 223 throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); 224 } 225 226 232 public Condition createOnlyTypeCondition() throws CSSException { 233 throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); 234 } 235 236 243 public ContentCondition createContentCondition(String data) 244 throws CSSException { 245 throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); 246 } 247 } 248 | Popular Tags |