com.sun.xml.ws.streaming.Attributes Maven / Gradle / Ivy
Show all versions of rt Show documentation
/*
* Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package com.sun.xml.ws.streaming;
import javax.xml.namespace.QName;
/**
* The Attributes interface is essentially a version of the
* org.xml.sax.Attributes interface modified to use the JAX-WS QName class.
*
* Although namespace declarations can appear in the attribute list, the
* actual values of the local name and URI properties are
* implementation-specific.
*
* Applications that need to iterate through all the attributes can use the
* {@link #isNamespaceDeclaration} method to identify namespace declarations
* and skip them.
*
* Also, the URI property of an attribute will never be null. The value
* "" (empty string) is used for the URI of non-qualified attributes.
*
* @author WS Development Team
*/
public interface Attributes {
/**
* Return the number of attributes in the list.
*
*/
int getLength();
/**
* Return true if the attribute at the given index is a namespace
* declaration.
*
* Implementations are encouraged to optimize this method by taking into
* account their internal representations of attributes.
*
*/
boolean isNamespaceDeclaration(int index);
/**
* Look up an attribute's QName by index.
*
*/
QName getName(int index);
/**
* Look up an attribute's URI by index.
*
*/
String getURI(int index);
/**
* Look up an attribute's local name by index.
* If attribute is a namespace declaration, result
* is expected including "xmlns:".
*/
String getLocalName(int index);
/**
* Look up an attribute's prefix by index.
*
*/
String getPrefix(int index);
/**
* Look up an attribute's value by index.
*
*/
String getValue(int index);
/**
* Look up the index of an attribute by QName.
*
*/
int getIndex(QName name);
/**
* Look up the index of an attribute by URI and local name.
*
*/
int getIndex(String uri, String localName);
/**
* Look up the index of an attribute by local name.
*
*/
int getIndex(String localName);
/**
* Look up the value of an attribute by QName.
*
*/
String getValue(QName name);
/**
* Look up the value of an attribute by URI and local name.
*
*/
String getValue(String uri, String localName);
/**
* Look up the value of an attribute by local name.
*
*/
String getValue(String localName);
}