1 18 package org.apache.batik.css.engine.sac; 19 20 import org.w3c.css.sac.AttributeCondition; 21 import org.w3c.css.sac.CSSException; 22 import org.w3c.css.sac.CombinatorCondition; 23 import org.w3c.css.sac.Condition; 24 import org.w3c.css.sac.ConditionFactory; 25 import org.w3c.css.sac.ContentCondition; 26 import org.w3c.css.sac.LangCondition; 27 import org.w3c.css.sac.NegativeCondition; 28 import org.w3c.css.sac.PositionalCondition; 29 30 31 38 public class CSSConditionFactory implements ConditionFactory { 39 40 43 protected String classNamespaceURI; 44 45 48 protected String classLocalName; 49 50 53 protected String idNamespaceURI; 54 55 58 protected String idLocalName; 59 60 63 public CSSConditionFactory(String cns, String cln, 64 String idns, String idln) { 65 classNamespaceURI = cns; 66 classLocalName = cln; 67 idNamespaceURI = idns; 68 idLocalName = idln; 69 } 70 71 75 public CombinatorCondition createAndCondition(Condition first, 76 Condition second) 77 throws CSSException { 78 return new CSSAndCondition(first, second); 79 } 80 81 85 public CombinatorCondition createOrCondition(Condition first, 86 Condition second) 87 throws CSSException { 88 throw new CSSException("Not implemented in CSS2"); 89 } 90 91 95 public NegativeCondition createNegativeCondition(Condition condition) 96 throws CSSException { 97 throw new CSSException("Not implemented in CSS2"); 98 } 99 100 104 public PositionalCondition createPositionalCondition(int position, 105 boolean typeNode, 106 boolean type) 107 throws CSSException { 108 throw new CSSException("Not implemented in CSS2"); 109 } 110 111 115 public AttributeCondition createAttributeCondition(String localName, 116 String namespaceURI, 117 boolean specified, 118 String value) 119 throws CSSException { 120 return new CSSAttributeCondition(localName, namespaceURI, specified, 121 value); 122 } 123 124 128 public AttributeCondition createIdCondition(String value) 129 throws CSSException { 130 return new CSSIdCondition(idNamespaceURI, idLocalName, value); 131 } 132 133 137 public LangCondition createLangCondition(String lang) throws CSSException { 138 return new CSSLangCondition(lang); 139 } 140 141 145 public AttributeCondition createOneOfAttributeCondition(String localName, 146 String nsURI, 147 boolean specified, 148 String value) 149 throws CSSException { 150 return new CSSOneOfAttributeCondition(localName, nsURI, specified, 151 value); 152 } 153 154 158 public AttributeCondition createBeginHyphenAttributeCondition 159 (String localName, 160 String namespaceURI, 161 boolean specified, 162 String value) 163 throws CSSException { 164 return new CSSBeginHyphenAttributeCondition 165 (localName, namespaceURI, specified, value); 166 } 167 168 172 public AttributeCondition createClassCondition(String namespaceURI, 173 String value) 174 throws CSSException { 175 return new CSSClassCondition(classLocalName, classNamespaceURI, value); 176 } 177 178 182 public AttributeCondition createPseudoClassCondition(String namespaceURI, 183 String value) 184 throws CSSException { 185 return new CSSPseudoClassCondition(namespaceURI, value); 186 } 187 188 192 public Condition createOnlyChildCondition() throws CSSException { 193 throw new CSSException("Not implemented in CSS2"); 194 } 195 196 200 public Condition createOnlyTypeCondition() throws CSSException { 201 throw new CSSException("Not implemented in CSS2"); 202 } 203 204 208 public ContentCondition createContentCondition(String data) 209 throws CSSException { 210 throw new CSSException("Not implemented in CSS2"); 211 } 212 } 213 | Popular Tags |