1 18 package org.apache.batik.css.engine.sac; 19 20 import org.w3c.dom.Element ; 21 22 28 public class CSSElementSelector extends AbstractElementSelector { 29 30 33 public CSSElementSelector(String uri, String name) { 34 super(uri, name); 35 } 36 37 41 public short getSelectorType() { 42 return SAC_ELEMENT_NODE_SELECTOR; 43 } 44 45 48 public boolean match(Element e, String pseudoE) { 49 String name = getLocalName(); 50 if (name == null) { 51 return true; 52 } 53 String eName; 54 if (e.getPrefix() == null) eName = e.getNodeName(); 55 else eName = e.getLocalName(); 56 return eName.equals(name); 59 } 62 63 66 public int getSpecificity() { 67 return (getLocalName() == null) ? 0 : 1; 68 } 69 70 73 public String toString() { 74 String name = getLocalName(); 75 if (name == null) { 76 return "*"; 77 } 78 return name; 79 } 80 } 81 | Popular Tags |