001: /*
002: * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.xml.internal.ws.streaming;
027:
028: import javax.xml.namespace.QName;
029:
030: /**
031: * <p> The Attributes interface is essentially a version of the
032: * org.xml.sax.Attributes interface modified to use the JAX-WS QName class.</p>
033: *
034: * <p> Although namespace declarations can appear in the attribute list, the
035: * actual values of the local name and URI properties are
036: * implementation-specific. </p>
037: *
038: * <p> Applications that need to iterate through all the attributes can use the
039: * {@link #isNamespaceDeclaration} method to identify namespace declarations
040: * and skip them. </p>
041: *
042: * <p> Also, the URI property of an attribute will never be null. The value
043: * "" (empty string) is used for the URI of non-qualified attributes. </p>
044: *
045: * @author WS Development Team
046: */
047: public interface Attributes {
048:
049: /**
050: * Return the number of attributes in the list.
051: *
052: */
053: public int getLength();
054:
055: /**
056: * Return true if the attribute at the given index is a namespace
057: * declaration.
058: *
059: * <p> Implementations are encouraged to optimize this method by taking into
060: * account their internal representations of attributes. </p>
061: *
062: */
063: public boolean isNamespaceDeclaration(int index);
064:
065: /**
066: * Look up an attribute's QName by index.
067: *
068: */
069: public QName getName(int index);
070:
071: /**
072: * Look up an attribute's URI by index.
073: *
074: */
075: public String getURI(int index);
076:
077: /**
078: * Look up an attribute's local name by index.
079: * If attribute is a namespace declaration, result
080: * is expected including "xmlns:".
081: */
082: public String getLocalName(int index);
083:
084: /**
085: * Look up an attribute's prefix by index.
086: *
087: */
088: public String getPrefix(int index);
089:
090: /**
091: * Look up an attribute's value by index.
092: *
093: */
094: public String getValue(int index);
095:
096: /**
097: * Look up the index of an attribute by QName.
098: *
099: */
100: public int getIndex(QName name);
101:
102: /**
103: * Look up the index of an attribute by URI and local name.
104: *
105: */
106: public int getIndex(String uri, String localName);
107:
108: /**
109: * Look up the index of an attribute by local name.
110: *
111: */
112: public int getIndex(String localName);
113:
114: /**
115: * Look up the value of an attribute by QName.
116: *
117: */
118: public String getValue(QName name);
119:
120: /**
121: * Look up the value of an attribute by URI and local name.
122: *
123: */
124: public String getValue(String uri, String localName);
125:
126: /**
127: * Look up the value of an attribute by local name.
128: *
129: */
130: public String getValue(String localName);
131: }
|