001 /*
002 * Copyright (c) 2000 World Wide Web Consortium,
003 * (Massachusetts Institute of Technology, Institut National de
004 * Recherche en Informatique et en Automatique, Keio University). All
005 * Rights Reserved. This program is distributed under the W3C's Software
006 * Intellectual Property License. This program is distributed in the
007 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009 * PURPOSE.
010 * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011 *
012 * $Id: OneOfAttributeConditionImpl.java,v 1.1.1.1 2006/04/23 14:51:57 taqua Exp $
013 */
014 package org.w3c.flute.parser.selectors;
015
016 import org.w3c.css.sac.AttributeCondition;
017 import org.w3c.css.sac.Condition;
018
019 /**
020 * @version $Revision: 1.1.1.1 $
021 * @author Philippe Le Hegaret
022 */
023 public class OneOfAttributeConditionImpl implements AttributeCondition {
024
025 String localName;
026 String value;
027
028 /**
029 * Creates a new AttributeConditionImpl
030 */
031 public OneOfAttributeConditionImpl(String localName, String value) {
032 this.localName = localName;
033 this.value = value;
034 }
035
036 /**
037 * An integer indicating the type of <code>Condition</code>.
038 */
039 public short getConditionType() {
040 return Condition.SAC_ONE_OF_ATTRIBUTE_CONDITION;
041 }
042
043 /**
044 * Returns the
045 * <a href="http://www.w3.org/TR/REC-xml-names/#dt-NSName">namespace
046 * URI</a> of this attribute condition.
047 * <p><code>NULL</code> if :
048 * <ul>
049 * <li>this attribute condition can match any namespace.
050 * <li>this attribute is an id attribute.
051 * </ul>
052 */
053 public String getNamespaceURI() {
054 return null;
055 }
056
057 /**
058 * Returns the
059 * <a href="http://www.w3.org/TR/REC-xml-names/#NT-LocalPart">local part</a>
060 * of the
061 * <a href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">qualified
062 * name</a> of this attribute.
063 * <p><code>NULL</code> if :
064 * <ul>
065 * <li><p>this attribute condition can match any attribute.
066 * <li><p>this attribute is a class attribute.
067 * <li><p>this attribute is an id attribute.
068 * <li><p>this attribute is a pseudo-class attribute.
069 * </ul>
070 */
071 public String getLocalName() {
072 return localName;
073 }
074
075 /**
076 * Returns <code>true</code> if the attribute must have an explicit value
077 * in the original document, <code>false</code> otherwise.
078 */
079 public boolean getSpecified() {
080 return false;
081 }
082
083 /**
084 * Returns the value of the attribute.
085 * If this attribute is a class or a pseudo class attribute, you'll get
086 * the class name (or psedo class name) without the '.' or ':'.
087 */
088 public String getValue() {
089 return value;
090 }
091 }
092