1 18 package org.apache.batik.css.parser; 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 39 public class DefaultConditionFactory implements ConditionFactory { 40 41 44 public final static ConditionFactory INSTANCE = 45 new DefaultConditionFactory(); 46 47 50 protected DefaultConditionFactory() { 51 } 52 53 57 public CombinatorCondition createAndCondition(Condition first, 58 Condition second) 59 throws CSSException { 60 return new DefaultAndCondition(first, second); 61 } 62 63 67 public CombinatorCondition createOrCondition(Condition first, 68 Condition second) 69 throws CSSException { 70 throw new CSSException("Not implemented in CSS2"); 71 } 72 73 77 public NegativeCondition createNegativeCondition(Condition condition) 78 throws CSSException { 79 throw new CSSException("Not implemented in CSS2"); 80 } 81 82 86 public PositionalCondition createPositionalCondition(int position, 87 boolean typeNode, 88 boolean type) 89 throws CSSException { 90 throw new CSSException("Not implemented in CSS2"); 91 } 92 93 97 public AttributeCondition createAttributeCondition(String localName, 98 String namespaceURI, 99 boolean specified, 100 String value) 101 throws CSSException { 102 return new DefaultAttributeCondition(localName, namespaceURI, 103 specified, value); 104 } 105 106 110 public AttributeCondition createIdCondition(String value) 111 throws CSSException { 112 return new DefaultIdCondition(value); 113 } 114 115 119 public LangCondition createLangCondition(String lang) throws CSSException { 120 return new DefaultLangCondition(lang); 121 } 122 123 127 public AttributeCondition createOneOfAttributeCondition(String localName, 128 String nsURI, 129 boolean specified, 130 String value) 131 throws CSSException { 132 return new DefaultOneOfAttributeCondition(localName, nsURI, specified, 133 value); 134 } 135 136 140 public AttributeCondition createBeginHyphenAttributeCondition 141 (String localName, 142 String namespaceURI, 143 boolean specified, 144 String value) 145 throws CSSException { 146 return new DefaultBeginHyphenAttributeCondition 147 (localName, namespaceURI, specified, value); 148 } 149 150 154 public AttributeCondition createClassCondition(String namespaceURI, 155 String value) 156 throws CSSException { 157 return new DefaultClassCondition(namespaceURI, value); 158 } 159 160 164 public AttributeCondition createPseudoClassCondition(String namespaceURI, 165 String value) 166 throws CSSException { 167 return new DefaultPseudoClassCondition(namespaceURI, value); 168 } 169 170 174 public Condition createOnlyChildCondition() throws CSSException { 175 throw new CSSException("Not implemented in CSS2"); 176 } 177 178 182 public Condition createOnlyTypeCondition() throws CSSException { 183 throw new CSSException("Not implemented in CSS2"); 184 } 185 186 190 public ContentCondition createContentCondition(String data) 191 throws CSSException { 192 throw new CSSException("Not implemented in CSS2"); 193 } 194 } 195 | Popular Tags |