/** * <b>SAC</b>: Implements {@link * org.w3c.css.sac.ConditionFactory#createClassCondition(String,String)}. */ public AttributeCondition createClassCondition(String namespaceURI, String value) throws CSSException { return new CSSClassCondition(classLocalName, classNamespaceURI, value); }
/** * Returns a text representation of this object. */ public String toString() { return '.' + getValue(); } }
/** * Returns a text representation of this object. */ public String toString() { return '.' + getValue(); } }
/** * <b>SAC</b>: Implements {@link * org.w3c.css.sac.ConditionFactory#createClassCondition(String,String)}. */ public AttributeCondition createClassCondition(String namespaceURI, String value) throws CSSException { return new CSSClassCondition(classLocalName, classNamespaceURI, value); }
/** * Returns a text representation of this object. */ public String toString() { return '.' + getValue(); } }
/** * <b>SAC</b>: Implements {@link * org.w3c.css.sac.ConditionFactory#createClassCondition(String,String)}. */ public AttributeCondition createClassCondition(String namespaceURI, String value) throws CSSException { return new CSSClassCondition(classLocalName, classNamespaceURI, value); }
/** * Returns a text representation of this object. */ public String toString() { return "." + getValue(); } }
/** * <b>SAC</b>: Implements {@link * org.w3c.css.sac.ConditionFactory#createClassCondition(String,String)}. */ public AttributeCondition createClassCondition(String namespaceURI, String value) throws CSSException { return new CSSClassCondition(classLocalName, classNamespaceURI, value); }
/** * Tests whether this condition matches the given element. */ public boolean match(Element e, String pseudoE) { String attr = e.getAttribute("class"); if(attr == null) { return false; } String val = getValue(); int i = attr.indexOf(val); if (i == -1) { return false; } if (i != 0 && !Character.isSpaceChar(attr.charAt(i - 1))) { return false; } int j = i + val.length(); return (j == attr.length() || (j < attr.length() && Character.isSpaceChar(attr.charAt(j)))); }
/** * Tests whether this condition matches the given element. */ public boolean match(Element e, String pseudoE) { if (!(e instanceof CSSStylableElement)) return false; // Can't match an unstylable element. String attr = ((CSSStylableElement)e).getCSSClass(); String val = getValue(); int attrLen = attr.length(); int valLen = val.length(); int i = attr.indexOf(val); while (i != -1) { if (i == 0 || Character.isSpaceChar(attr.charAt(i - 1))) { if (i + valLen == attrLen || Character.isSpaceChar(attr.charAt(i + valLen))) { return true; } } i = attr.indexOf(val, i + valLen); } return false; }
/** * Tests whether this condition matches the given element. */ public boolean match(Element e, String pseudoE) { if (!(e instanceof CSSStylableElement)) return false; // Can't match an unstylable element. String attr = ((CSSStylableElement)e).getCSSClass(); String val = getValue(); int attrLen = attr.length(); int valLen = val.length(); int i = attr.indexOf(val); while (i != -1) { if (i == 0 || Character.isSpaceChar(attr.charAt(i - 1))) { if (i + valLen == attrLen || Character.isSpaceChar(attr.charAt(i + valLen))) { return true; } } i = attr.indexOf(val, i + valLen); } return false; }
/** * Tests whether this condition matches the given element. */ public boolean match(Element e, String pseudoE) { if (!(e instanceof CSSStylableElement)) return false; // Can't match an unstylable element. String attr = ((CSSStylableElement)e).getCSSClass(); String val = getValue(); int attrLen = attr.length(); int valLen = val.length(); int i = attr.indexOf(val); while (i != -1) { if (i == 0 || Character.isSpaceChar(attr.charAt(i - 1))) { if (i + valLen == attrLen || Character.isSpaceChar(attr.charAt(i + valLen))) { return true; } } i = attr.indexOf(val, i + valLen); } return false; }