Source for org.w3c.flute.parser.selectors.AttributeConditionImpl

   1: /*
   2:  * Copyright (c) 2000 World Wide Web Consortium,
   3:  * (Massachusetts Institute of Technology, Institut National de
   4:  * Recherche en Informatique et en Automatique, Keio University). All
   5:  * Rights Reserved. This program is distributed under the W3C's Software
   6:  * Intellectual Property License. This program is distributed in the
   7:  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
   8:  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
   9:  * PURPOSE.
  10:  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11:  *
  12:  * $Id: AttributeConditionImpl.java,v 1.1.1.1 2006/04/23 14:51:55 taqua Exp $
  13:  */
  14: package org.w3c.flute.parser.selectors;
  15: 
  16: import org.w3c.css.sac.AttributeCondition;
  17: import org.w3c.css.sac.Condition;
  18: 
  19: /**
  20:  * @version $Revision: 1.1.1.1 $
  21:  * @author  Philippe Le Hegaret
  22:  */
  23: public class AttributeConditionImpl implements AttributeCondition {
  24: 
  25:     String localName;
  26:     String value;
  27:     
  28:     /**
  29:      * Creates a new AttributeConditionImpl
  30:      */
  31:     public AttributeConditionImpl(String localName, String value) {
  32:         this.localName = localName;
  33:     this.value     = value;
  34:     }
  35:     
  36:     /**
  37:      * An integer indicating the type of <code>Condition</code>.
  38:      */    
  39:     public short getConditionType() {
  40:     return Condition.SAC_ATTRIBUTE_CONDITION;
  41:     }
  42: 
  43:     /**
  44:      * Returns the
  45:      * <a href="http://www.w3.org/TR/REC-xml-names/#dt-NSName">namespace
  46:      * URI</a> of this attribute condition.
  47:      * <p><code>NULL</code> if :
  48:      * <ul>
  49:      * <li>this attribute condition can match any namespace.
  50:      * <li>this attribute is an id attribute.
  51:      * </ul>
  52:      */    
  53:     public String getNamespaceURI() {
  54:     return null;
  55:     }
  56: 
  57:     /**
  58:      * Returns the
  59:      * <a href="http://www.w3.org/TR/REC-xml-names/#NT-LocalPart">local part</a>
  60:      * of the
  61:      * <a href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">qualified
  62:      * name</a> of this attribute.
  63:      * <p><code>NULL</code> if :
  64:      * <ul>
  65:      * <li><p>this attribute condition can match any attribute.
  66:      * <li><p>this attribute is a class attribute.
  67:      * <li><p>this attribute is an id attribute.
  68:      * <li><p>this attribute is a pseudo-class attribute.
  69:      * </ul>
  70:      */
  71:     public String getLocalName() {
  72:     return localName;
  73:     }
  74: 
  75:     /**
  76:      * Returns <code>true</code> if the attribute must have an explicit value
  77:      * in the original document, <code>false</code> otherwise.
  78:      */
  79:     public boolean getSpecified() {
  80:     return false;
  81:     }
  82: 
  83:     /**
  84:      * Returns the value of the attribute.
  85:      * If this attribute is a class or a pseudo class attribute, you'll get
  86:      * the class name (or psedo class name) without the '.' or ':'.
  87:      */
  88:     public String getValue() {
  89:     return value;
  90:     }
  91: }
  92: