Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/org/xml/sax/helpers/ParserAdapter.java
48576 views
/*1* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425// ParserAdapter.java - adapt a SAX1 Parser to a SAX2 XMLReader.26// http://www.saxproject.org27// Written by David Megginson28// NO WARRANTY! This class is in the public domain.29// $Id: ParserAdapter.java,v 1.3 2004/11/03 22:53:09 jsuttor Exp $3031package org.xml.sax.helpers;3233import java.io.IOException;34import java.util.Enumeration;35import java.util.Vector;3637import org.xml.sax.Parser; // deprecated38import org.xml.sax.InputSource;39import org.xml.sax.Locator;40import org.xml.sax.AttributeList; // deprecated41import org.xml.sax.EntityResolver;42import org.xml.sax.DTDHandler;43import org.xml.sax.DocumentHandler; // deprecated44import org.xml.sax.ErrorHandler;45import org.xml.sax.SAXException;46import org.xml.sax.SAXParseException;4748import org.xml.sax.XMLReader;49import org.xml.sax.Attributes;50import org.xml.sax.ContentHandler;51import org.xml.sax.SAXNotRecognizedException;52import org.xml.sax.SAXNotSupportedException;535455/**56* Adapt a SAX1 Parser as a SAX2 XMLReader.57*58* <blockquote>59* <em>This module, both source code and documentation, is in the60* Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>61* See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>62* for further information.63* </blockquote>64*65* <p>This class wraps a SAX1 {@link org.xml.sax.Parser Parser}66* and makes it act as a SAX2 {@link org.xml.sax.XMLReader XMLReader},67* with feature, property, and Namespace support. Note68* that it is not possible to report {@link org.xml.sax.ContentHandler#skippedEntity69* skippedEntity} events, since SAX1 does not make that information available.</p>70*71* <p>This adapter does not test for duplicate Namespace-qualified72* attribute names.</p>73*74* @since SAX 2.075* @author David Megginson76* @version 2.0.1 (sax2r2)77* @see org.xml.sax.helpers.XMLReaderAdapter78* @see org.xml.sax.XMLReader79* @see org.xml.sax.Parser80*/81public class ParserAdapter implements XMLReader, DocumentHandler82{83private static SecuritySupport ss = new SecuritySupport();8485////////////////////////////////////////////////////////////////////86// Constructors.87////////////////////////////////////////////////////////////////////888990/**91* Construct a new parser adapter.92*93* <p>Use the "org.xml.sax.parser" property to locate the94* embedded SAX1 driver.</p>95*96* @exception SAXException If the embedded driver97* cannot be instantiated or if the98* org.xml.sax.parser property is not specified.99*/100public ParserAdapter ()101throws SAXException102{103super();104105String driver = ss.getSystemProperty("org.xml.sax.parser");106107try {108setup(ParserFactory.makeParser());109} catch (ClassNotFoundException e1) {110throw new111SAXException("Cannot find SAX1 driver class " +112driver, e1);113} catch (IllegalAccessException e2) {114throw new115SAXException("SAX1 driver class " +116driver +117" found but cannot be loaded", e2);118} catch (InstantiationException e3) {119throw new120SAXException("SAX1 driver class " +121driver +122" loaded but cannot be instantiated", e3);123} catch (ClassCastException e4) {124throw new125SAXException("SAX1 driver class " +126driver +127" does not implement org.xml.sax.Parser");128} catch (NullPointerException e5) {129throw new130SAXException("System property org.xml.sax.parser not specified");131}132}133134135/**136* Construct a new parser adapter.137*138* <p>Note that the embedded parser cannot be changed once the139* adapter is created; to embed a different parser, allocate140* a new ParserAdapter.</p>141*142* @param parser The SAX1 parser to embed.143* @exception java.lang.NullPointerException If the parser parameter144* is null.145*/146public ParserAdapter (Parser parser)147{148super();149setup(parser);150}151152153/**154* Internal setup method.155*156* @param parser The embedded parser.157* @exception java.lang.NullPointerException If the parser parameter158* is null.159*/160private void setup (Parser parser)161{162if (parser == null) {163throw new164NullPointerException("Parser argument must not be null");165}166this.parser = parser;167atts = new AttributesImpl();168nsSupport = new NamespaceSupport();169attAdapter = new AttributeListAdapter();170}171172173174////////////////////////////////////////////////////////////////////175// Implementation of org.xml.sax.XMLReader.176////////////////////////////////////////////////////////////////////177178179//180// Internal constants for the sake of convenience.181//182private final static String FEATURES = "http://xml.org/sax/features/";183private final static String NAMESPACES = FEATURES + "namespaces";184private final static String NAMESPACE_PREFIXES = FEATURES + "namespace-prefixes";185private final static String XMLNS_URIs = FEATURES + "xmlns-uris";186187188/**189* Set a feature flag for the parser.190*191* <p>The only features recognized are namespaces and192* namespace-prefixes.</p>193*194* @param name The feature name, as a complete URI.195* @param value The requested feature value.196* @exception SAXNotRecognizedException If the feature197* can't be assigned or retrieved.198* @exception SAXNotSupportedException If the feature199* can't be assigned that value.200* @see org.xml.sax.XMLReader#setFeature201*/202public void setFeature (String name, boolean value)203throws SAXNotRecognizedException, SAXNotSupportedException204{205if (name.equals(NAMESPACES)) {206checkNotParsing("feature", name);207namespaces = value;208if (!namespaces && !prefixes) {209prefixes = true;210}211} else if (name.equals(NAMESPACE_PREFIXES)) {212checkNotParsing("feature", name);213prefixes = value;214if (!prefixes && !namespaces) {215namespaces = true;216}217} else if (name.equals(XMLNS_URIs)) {218checkNotParsing("feature", name);219uris = value;220} else {221throw new SAXNotRecognizedException("Feature: " + name);222}223}224225226/**227* Check a parser feature flag.228*229* <p>The only features recognized are namespaces and230* namespace-prefixes.</p>231*232* @param name The feature name, as a complete URI.233* @return The current feature value.234* @exception SAXNotRecognizedException If the feature235* value can't be assigned or retrieved.236* @exception SAXNotSupportedException If the237* feature is not currently readable.238* @see org.xml.sax.XMLReader#setFeature239*/240public boolean getFeature (String name)241throws SAXNotRecognizedException, SAXNotSupportedException242{243if (name.equals(NAMESPACES)) {244return namespaces;245} else if (name.equals(NAMESPACE_PREFIXES)) {246return prefixes;247} else if (name.equals(XMLNS_URIs)) {248return uris;249} else {250throw new SAXNotRecognizedException("Feature: " + name);251}252}253254255/**256* Set a parser property.257*258* <p>No properties are currently recognized.</p>259*260* @param name The property name.261* @param value The property value.262* @exception SAXNotRecognizedException If the property263* value can't be assigned or retrieved.264* @exception SAXNotSupportedException If the property265* can't be assigned that value.266* @see org.xml.sax.XMLReader#setProperty267*/268public void setProperty (String name, Object value)269throws SAXNotRecognizedException, SAXNotSupportedException270{271throw new SAXNotRecognizedException("Property: " + name);272}273274275/**276* Get a parser property.277*278* <p>No properties are currently recognized.</p>279*280* @param name The property name.281* @return The property value.282* @exception SAXNotRecognizedException If the property283* value can't be assigned or retrieved.284* @exception SAXNotSupportedException If the property285* value is not currently readable.286* @see org.xml.sax.XMLReader#getProperty287*/288public Object getProperty (String name)289throws SAXNotRecognizedException, SAXNotSupportedException290{291throw new SAXNotRecognizedException("Property: " + name);292}293294295/**296* Set the entity resolver.297*298* @param resolver The new entity resolver.299* @see org.xml.sax.XMLReader#setEntityResolver300*/301public void setEntityResolver (EntityResolver resolver)302{303entityResolver = resolver;304}305306307/**308* Return the current entity resolver.309*310* @return The current entity resolver, or null if none was supplied.311* @see org.xml.sax.XMLReader#getEntityResolver312*/313public EntityResolver getEntityResolver ()314{315return entityResolver;316}317318319/**320* Set the DTD handler.321*322* @param handler the new DTD handler323* @see org.xml.sax.XMLReader#setEntityResolver324*/325public void setDTDHandler (DTDHandler handler)326{327dtdHandler = handler;328}329330331/**332* Return the current DTD handler.333*334* @return the current DTD handler, or null if none was supplied335* @see org.xml.sax.XMLReader#getEntityResolver336*/337public DTDHandler getDTDHandler ()338{339return dtdHandler;340}341342343/**344* Set the content handler.345*346* @param handler the new content handler347* @see org.xml.sax.XMLReader#setEntityResolver348*/349public void setContentHandler (ContentHandler handler)350{351contentHandler = handler;352}353354355/**356* Return the current content handler.357*358* @return The current content handler, or null if none was supplied.359* @see org.xml.sax.XMLReader#getEntityResolver360*/361public ContentHandler getContentHandler ()362{363return contentHandler;364}365366367/**368* Set the error handler.369*370* @param handler The new error handler.371* @see org.xml.sax.XMLReader#setEntityResolver372*/373public void setErrorHandler (ErrorHandler handler)374{375errorHandler = handler;376}377378379/**380* Return the current error handler.381*382* @return The current error handler, or null if none was supplied.383* @see org.xml.sax.XMLReader#getEntityResolver384*/385public ErrorHandler getErrorHandler ()386{387return errorHandler;388}389390391/**392* Parse an XML document.393*394* @param systemId The absolute URL of the document.395* @exception java.io.IOException If there is a problem reading396* the raw content of the document.397* @exception SAXException If there is a problem398* processing the document.399* @see #parse(org.xml.sax.InputSource)400* @see org.xml.sax.Parser#parse(java.lang.String)401*/402public void parse (String systemId)403throws IOException, SAXException404{405parse(new InputSource(systemId));406}407408409/**410* Parse an XML document.411*412* @param input An input source for the document.413* @exception java.io.IOException If there is a problem reading414* the raw content of the document.415* @exception SAXException If there is a problem416* processing the document.417* @see #parse(java.lang.String)418* @see org.xml.sax.Parser#parse(org.xml.sax.InputSource)419*/420public void parse (InputSource input)421throws IOException, SAXException422{423if (parsing) {424throw new SAXException("Parser is already in use");425}426setupParser();427parsing = true;428try {429parser.parse(input);430} finally {431parsing = false;432}433parsing = false;434}435436437438////////////////////////////////////////////////////////////////////439// Implementation of org.xml.sax.DocumentHandler.440////////////////////////////////////////////////////////////////////441442443/**444* Adapter implementation method; do not call.445* Adapt a SAX1 document locator event.446*447* @param locator A document locator.448* @see org.xml.sax.ContentHandler#setDocumentLocator449*/450public void setDocumentLocator (Locator locator)451{452this.locator = locator;453if (contentHandler != null) {454contentHandler.setDocumentLocator(locator);455}456}457458459/**460* Adapter implementation method; do not call.461* Adapt a SAX1 start document event.462*463* @exception SAXException The client may raise a464* processing exception.465* @see org.xml.sax.DocumentHandler#startDocument466*/467public void startDocument ()468throws SAXException469{470if (contentHandler != null) {471contentHandler.startDocument();472}473}474475476/**477* Adapter implementation method; do not call.478* Adapt a SAX1 end document event.479*480* @exception SAXException The client may raise a481* processing exception.482* @see org.xml.sax.DocumentHandler#endDocument483*/484public void endDocument ()485throws SAXException486{487if (contentHandler != null) {488contentHandler.endDocument();489}490}491492493/**494* Adapter implementation method; do not call.495* Adapt a SAX1 startElement event.496*497* <p>If necessary, perform Namespace processing.</p>498*499* @param qName The qualified (prefixed) name.500* @param qAtts The XML attribute list (with qnames).501* @exception SAXException The client may raise a502* processing exception.503*/504public void startElement (String qName, AttributeList qAtts)505throws SAXException506{507// These are exceptions from the508// first pass; they should be509// ignored if there's a second pass,510// but reported otherwise.511Vector exceptions = null;512513// If we're not doing Namespace514// processing, dispatch this quickly.515if (!namespaces) {516if (contentHandler != null) {517attAdapter.setAttributeList(qAtts);518contentHandler.startElement("", "", qName.intern(),519attAdapter);520}521return;522}523524525// OK, we're doing Namespace processing.526nsSupport.pushContext();527int length = qAtts.getLength();528529// First pass: handle NS decls530for (int i = 0; i < length; i++) {531String attQName = qAtts.getName(i);532533if (!attQName.startsWith("xmlns"))534continue;535// Could be a declaration...536String prefix;537int n = attQName.indexOf(':');538539// xmlns=...540if (n == -1 && attQName.length () == 5) {541prefix = "";542} else if (n != 5) {543// XML namespaces spec doesn't discuss "xmlnsf:oo"544// (and similarly named) attributes ... at most, warn545continue;546} else // xmlns:foo=...547prefix = attQName.substring(n+1);548549String value = qAtts.getValue(i);550if (!nsSupport.declarePrefix(prefix, value)) {551reportError("Illegal Namespace prefix: " + prefix);552continue;553}554if (contentHandler != null)555contentHandler.startPrefixMapping(prefix, value);556}557558// Second pass: copy all relevant559// attributes into the SAX2 AttributeList560// using updated prefix bindings561atts.clear();562for (int i = 0; i < length; i++) {563String attQName = qAtts.getName(i);564String type = qAtts.getType(i);565String value = qAtts.getValue(i);566567// Declaration?568if (attQName.startsWith("xmlns")) {569String prefix;570int n = attQName.indexOf(':');571572if (n == -1 && attQName.length () == 5) {573prefix = "";574} else if (n != 5) {575// XML namespaces spec doesn't discuss "xmlnsf:oo"576// (and similarly named) attributes ... ignore577prefix = null;578} else {579prefix = attQName.substring(6);580}581// Yes, decl: report or prune582if (prefix != null) {583if (prefixes) {584if (uris)585// note funky case: localname can be null586// when declaring the default prefix, and587// yet the uri isn't null.588atts.addAttribute (nsSupport.XMLNS, prefix,589attQName.intern(), type, value);590else591atts.addAttribute ("", "",592attQName.intern(), type, value);593}594continue;595}596}597598// Not a declaration -- report599try {600String attName[] = processName(attQName, true, true);601atts.addAttribute(attName[0], attName[1], attName[2],602type, value);603} catch (SAXException e) {604if (exceptions == null)605exceptions = new Vector();606exceptions.addElement(e);607atts.addAttribute("", attQName, attQName, type, value);608}609}610611// now handle the deferred exception reports612if (exceptions != null && errorHandler != null) {613for (int i = 0; i < exceptions.size(); i++)614errorHandler.error((SAXParseException)615(exceptions.elementAt(i)));616}617618// OK, finally report the event.619if (contentHandler != null) {620String name[] = processName(qName, false, false);621contentHandler.startElement(name[0], name[1], name[2], atts);622}623}624625626/**627* Adapter implementation method; do not call.628* Adapt a SAX1 end element event.629*630* @param qName The qualified (prefixed) name.631* @exception SAXException The client may raise a632* processing exception.633* @see org.xml.sax.DocumentHandler#endElement634*/635public void endElement (String qName)636throws SAXException637{638// If we're not doing Namespace639// processing, dispatch this quickly.640if (!namespaces) {641if (contentHandler != null) {642contentHandler.endElement("", "", qName.intern());643}644return;645}646647// Split the name.648String names[] = processName(qName, false, false);649if (contentHandler != null) {650contentHandler.endElement(names[0], names[1], names[2]);651Enumeration prefixes = nsSupport.getDeclaredPrefixes();652while (prefixes.hasMoreElements()) {653String prefix = (String)prefixes.nextElement();654contentHandler.endPrefixMapping(prefix);655}656}657nsSupport.popContext();658}659660661/**662* Adapter implementation method; do not call.663* Adapt a SAX1 characters event.664*665* @param ch An array of characters.666* @param start The starting position in the array.667* @param length The number of characters to use.668* @exception SAXException The client may raise a669* processing exception.670* @see org.xml.sax.DocumentHandler#characters671*/672public void characters (char ch[], int start, int length)673throws SAXException674{675if (contentHandler != null) {676contentHandler.characters(ch, start, length);677}678}679680681/**682* Adapter implementation method; do not call.683* Adapt a SAX1 ignorable whitespace event.684*685* @param ch An array of characters.686* @param start The starting position in the array.687* @param length The number of characters to use.688* @exception SAXException The client may raise a689* processing exception.690* @see org.xml.sax.DocumentHandler#ignorableWhitespace691*/692public void ignorableWhitespace (char ch[], int start, int length)693throws SAXException694{695if (contentHandler != null) {696contentHandler.ignorableWhitespace(ch, start, length);697}698}699700701/**702* Adapter implementation method; do not call.703* Adapt a SAX1 processing instruction event.704*705* @param target The processing instruction target.706* @param data The remainder of the processing instruction707* @exception SAXException The client may raise a708* processing exception.709* @see org.xml.sax.DocumentHandler#processingInstruction710*/711public void processingInstruction (String target, String data)712throws SAXException713{714if (contentHandler != null) {715contentHandler.processingInstruction(target, data);716}717}718719720721////////////////////////////////////////////////////////////////////722// Internal utility methods.723////////////////////////////////////////////////////////////////////724725726/**727* Initialize the parser before each run.728*/729private void setupParser ()730{731// catch an illegal "nonsense" state.732if (!prefixes && !namespaces)733throw new IllegalStateException ();734735nsSupport.reset();736if (uris)737nsSupport.setNamespaceDeclUris (true);738739if (entityResolver != null) {740parser.setEntityResolver(entityResolver);741}742if (dtdHandler != null) {743parser.setDTDHandler(dtdHandler);744}745if (errorHandler != null) {746parser.setErrorHandler(errorHandler);747}748parser.setDocumentHandler(this);749locator = null;750}751752753/**754* Process a qualified (prefixed) name.755*756* <p>If the name has an undeclared prefix, use only the qname757* and make an ErrorHandler.error callback in case the app is758* interested.</p>759*760* @param qName The qualified (prefixed) name.761* @param isAttribute true if this is an attribute name.762* @return The name split into three parts.763* @exception SAXException The client may throw764* an exception if there is an error callback.765*/766private String [] processName (String qName, boolean isAttribute,767boolean useException)768throws SAXException769{770String parts[] = nsSupport.processName(qName, nameParts,771isAttribute);772if (parts == null) {773if (useException)774throw makeException("Undeclared prefix: " + qName);775reportError("Undeclared prefix: " + qName);776parts = new String[3];777parts[0] = parts[1] = "";778parts[2] = qName.intern();779}780return parts;781}782783784/**785* Report a non-fatal error.786*787* @param message The error message.788* @exception SAXException The client may throw789* an exception.790*/791void reportError (String message)792throws SAXException793{794if (errorHandler != null)795errorHandler.error(makeException(message));796}797798799/**800* Construct an exception for the current context.801*802* @param message The error message.803*/804private SAXParseException makeException (String message)805{806if (locator != null) {807return new SAXParseException(message, locator);808} else {809return new SAXParseException(message, null, null, -1, -1);810}811}812813814/**815* Throw an exception if we are parsing.816*817* <p>Use this method to detect illegal feature or818* property changes.</p>819*820* @param type The type of thing (feature or property).821* @param name The feature or property name.822* @exception SAXNotSupportedException If a823* document is currently being parsed.824*/825private void checkNotParsing (String type, String name)826throws SAXNotSupportedException827{828if (parsing) {829throw new SAXNotSupportedException("Cannot change " +830type + ' ' +831name + " while parsing");832833}834}835836837838////////////////////////////////////////////////////////////////////839// Internal state.840////////////////////////////////////////////////////////////////////841842private NamespaceSupport nsSupport;843private AttributeListAdapter attAdapter;844845private boolean parsing = false;846private String nameParts[] = new String[3];847848private Parser parser = null;849850private AttributesImpl atts = null;851852// Features853private boolean namespaces = true;854private boolean prefixes = false;855private boolean uris = false;856857// Properties858859// Handlers860Locator locator;861862EntityResolver entityResolver = null;863DTDHandler dtdHandler = null;864ContentHandler contentHandler = null;865ErrorHandler errorHandler = null;866867868869////////////////////////////////////////////////////////////////////870// Inner class to wrap an AttributeList when not doing NS proc.871////////////////////////////////////////////////////////////////////872873874/**875* Adapt a SAX1 AttributeList as a SAX2 Attributes object.876*877* <p>This class is in the Public Domain, and comes with NO878* WARRANTY of any kind.</p>879*880* <p>This wrapper class is used only when Namespace support881* is disabled -- it provides pretty much a direct mapping882* from SAX1 to SAX2, except that names and types are883* interned whenever requested.</p>884*/885final class AttributeListAdapter implements Attributes886{887888/**889* Construct a new adapter.890*/891AttributeListAdapter ()892{893}894895896/**897* Set the embedded AttributeList.898*899* <p>This method must be invoked before any of the others900* can be used.</p>901*902* @param The SAX1 attribute list (with qnames).903*/904void setAttributeList (AttributeList qAtts)905{906this.qAtts = qAtts;907}908909910/**911* Return the length of the attribute list.912*913* @return The number of attributes in the list.914* @see org.xml.sax.Attributes#getLength915*/916public int getLength ()917{918return qAtts.getLength();919}920921922/**923* Return the Namespace URI of the specified attribute.924*925* @param The attribute's index.926* @return Always the empty string.927* @see org.xml.sax.Attributes#getURI928*/929public String getURI (int i)930{931return "";932}933934935/**936* Return the local name of the specified attribute.937*938* @param The attribute's index.939* @return Always the empty string.940* @see org.xml.sax.Attributes#getLocalName941*/942public String getLocalName (int i)943{944return "";945}946947948/**949* Return the qualified (prefixed) name of the specified attribute.950*951* @param The attribute's index.952* @return The attribute's qualified name, internalized.953*/954public String getQName (int i)955{956return qAtts.getName(i).intern();957}958959960/**961* Return the type of the specified attribute.962*963* @param The attribute's index.964* @return The attribute's type as an internalized string.965*/966public String getType (int i)967{968return qAtts.getType(i).intern();969}970971972/**973* Return the value of the specified attribute.974*975* @param The attribute's index.976* @return The attribute's value.977*/978public String getValue (int i)979{980return qAtts.getValue(i);981}982983984/**985* Look up an attribute index by Namespace name.986*987* @param uri The Namespace URI or the empty string.988* @param localName The local name.989* @return The attributes index, or -1 if none was found.990* @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String)991*/992public int getIndex (String uri, String localName)993{994return -1;995}996997998/**999* Look up an attribute index by qualified (prefixed) name.1000*1001* @param qName The qualified name.1002* @return The attributes index, or -1 if none was found.1003* @see org.xml.sax.Attributes#getIndex(java.lang.String)1004*/1005public int getIndex (String qName)1006{1007int max = atts.getLength();1008for (int i = 0; i < max; i++) {1009if (qAtts.getName(i).equals(qName)) {1010return i;1011}1012}1013return -1;1014}101510161017/**1018* Look up the type of an attribute by Namespace name.1019*1020* @param uri The Namespace URI1021* @param localName The local name.1022* @return The attribute's type as an internalized string.1023*/1024public String getType (String uri, String localName)1025{1026return null;1027}102810291030/**1031* Look up the type of an attribute by qualified (prefixed) name.1032*1033* @param qName The qualified name.1034* @return The attribute's type as an internalized string.1035*/1036public String getType (String qName)1037{1038return qAtts.getType(qName).intern();1039}104010411042/**1043* Look up the value of an attribute by Namespace name.1044*1045* @param uri The Namespace URI1046* @param localName The local name.1047* @return The attribute's value.1048*/1049public String getValue (String uri, String localName)1050{1051return null;1052}105310541055/**1056* Look up the value of an attribute by qualified (prefixed) name.1057*1058* @param qName The qualified name.1059* @return The attribute's value.1060*/1061public String getValue (String qName)1062{1063return qAtts.getValue(qName);1064}10651066private AttributeList qAtts;1067}1068}10691070// end of ParserAdapter.java107110721073