1 /* 2 * ################################################################ 3 * 4 * ProActive: The Java(TM) library for Parallel, Distributed, 5 * Concurrent computing with Security and Mobility 6 * 7 * Copyright (C) 1997-2002 INRIA/University of Nice-Sophia Antipolis 8 * Contact: proactive-support@inria.fr 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License as published by the Free Software Foundation; either 13 * version 2.1 of the License, or any later version. 14 * 15 * This library is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 * Lesser General Public License for more details. 19 * 20 * You should have received a copy of the GNU Lesser General Public 21 * License along with this library; if not, write to the Free Software 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 * USA 24 * 25 * Initial developer(s): The ProActive Team 26 * http://www.inria.fr/oasis/ProActive/contacts.html 27 * Contributor(s): 28 * 29 * ################################################################ 30 */ 31 package org.objectweb.proactive.core.xml.io; 32 33 /** 34 * 35 * A class implementing this interface is a wrapper of the attribute of an XML element. 36 * It is used to wrap both SAX and DOM attributes in an independant manner. 37 * 38 * @author Lionel Mestre 39 * @version 0.91 40 * 41 */ 42 public interface Attributes { 43 44 /** 45 * Looks up an attribute's value by index. 46 * @param index The attribute index (zero-based). 47 * @return The attribute's value as a string, or null if the index is out of range. 48 */ 49 public String getValue(int index); 50 51 52 /** 53 * Looks up an attribute's value by XML 1.0 qualified name. 54 * @param qName The qualified (prefixed) name. 55 * @return The attribute value as a string, or null if the attribute is not in the list or if 56 * qualified names are not available. 57 */ 58 public String getValue(String qName); 59 60 61 /** 62 * Looks up the index of an attribute by Namespace name. 63 * @param uri The Namespace URI, or the empty string if the name has no Namespace URI. 64 * @param localName The attribute's local name. 65 * @return The attribute value as a string, or null if the attribute is not in the list. 66 */ 67 public String getValue(String uri, String localPart); 68 69 70 /** 71 * Returns the number of attributes in the list. 72 */ 73 public int getLength(); 74 75 76 }