Imported GNU Classpath 0.90
Imported GNU Classpath 0.90 * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore. * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant. * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5. * java/lang/Math.java: New override file. * java/lang/Character.java: Merged from Classpath. (start, end): Now 'int's. (canonicalName): New field. (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants. (UnicodeBlock): Added argument. (of): New overload. (forName): New method. Updated unicode blocks. (sets): Updated. * sources.am: Regenerated. * Makefile.in: Likewise. From-SVN: r111942
This commit is contained in:
parent
27079765d0
commit
8aa540d2f7
1367 changed files with 188789 additions and 22762 deletions
|
@ -1,5 +1,5 @@
|
|||
/* SAXParser.java --
|
||||
Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -92,8 +92,7 @@ import org.xml.sax.ext.Locator2;
|
|||
*/
|
||||
public class SAXParser
|
||||
extends javax.xml.parsers.SAXParser
|
||||
implements XMLReader, Attributes2, Locator2, XMLReporter,
|
||||
XMLParser.XMLResolver2
|
||||
implements XMLReader, Attributes2, Locator2, XMLReporter, XMLResolver
|
||||
{
|
||||
|
||||
ContentHandler contentHandler;
|
||||
|
@ -323,6 +322,7 @@ public class SAXParser
|
|||
supportDTD,
|
||||
baseAware,
|
||||
stringInterning,
|
||||
true,
|
||||
this,
|
||||
this);
|
||||
else
|
||||
|
@ -338,6 +338,7 @@ public class SAXParser
|
|||
supportDTD,
|
||||
baseAware,
|
||||
stringInterning,
|
||||
true,
|
||||
this,
|
||||
this);
|
||||
}
|
||||
|
@ -357,6 +358,7 @@ public class SAXParser
|
|||
supportDTD,
|
||||
baseAware,
|
||||
stringInterning,
|
||||
true,
|
||||
this,
|
||||
this);
|
||||
}
|
||||
|
@ -486,14 +488,14 @@ public class SAXParser
|
|||
contentHandler.processingInstruction(target, data);
|
||||
}
|
||||
break;
|
||||
case XMLStreamConstants.START_ENTITY:
|
||||
case XMLParser.START_ENTITY:
|
||||
if (lexicalHandler != null)
|
||||
{
|
||||
String name = reader.getText();
|
||||
lexicalHandler.startEntity(name);
|
||||
}
|
||||
break;
|
||||
case XMLStreamConstants.END_ENTITY:
|
||||
case XMLParser.END_ENTITY:
|
||||
if (lexicalHandler != null)
|
||||
{
|
||||
String name = reader.getText();
|
||||
|
@ -649,24 +651,36 @@ public class SAXParser
|
|||
lexicalHandler.endDTD();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (XMLStreamException e)
|
||||
{
|
||||
if (!startDocumentDone && contentHandler != null)
|
||||
contentHandler.startDocument();
|
||||
SAXParseException e2 = new SAXParseException(e.getMessage(), this);
|
||||
e2.initCause(e);
|
||||
if (errorHandler != null)
|
||||
errorHandler.fatalError(e2);
|
||||
if (contentHandler != null)
|
||||
contentHandler.endDocument();
|
||||
throw e2;
|
||||
}
|
||||
finally
|
||||
{
|
||||
reset();
|
||||
if (opened)
|
||||
in.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
SAXParseException e2 = new SAXParseException(e.getMessage(), this);
|
||||
e2.initCause(e);
|
||||
try
|
||||
{
|
||||
if (!startDocumentDone && contentHandler != null)
|
||||
contentHandler.startDocument();
|
||||
if (errorHandler != null)
|
||||
errorHandler.fatalError(e2);
|
||||
if (contentHandler != null)
|
||||
contentHandler.endDocument();
|
||||
}
|
||||
catch (SAXException sex)
|
||||
{
|
||||
// Ignored, we will rethrow the original exception.
|
||||
}
|
||||
reset();
|
||||
if (opened)
|
||||
in.close();
|
||||
if (e instanceof SAXException)
|
||||
throw (SAXException) e;
|
||||
if (e instanceof IOException)
|
||||
throw (IOException) e;
|
||||
else
|
||||
throw e2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -685,7 +699,7 @@ public class SAXParser
|
|||
int ac = reader.getAttributeCount();
|
||||
for (int i = 0; i < ac; i++)
|
||||
{
|
||||
QName aname = reader.getAttributeQName(i);
|
||||
QName aname = reader.getAttributeName(i);
|
||||
if ("space".equals(aname.getLocalPart()) &&
|
||||
XMLConstants.XML_NS_URI.equals(aname.getNamespaceURI()))
|
||||
{
|
||||
|
@ -726,7 +740,7 @@ public class SAXParser
|
|||
int len = reader.getAttributeCount();
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
QName q = reader.getAttributeQName(i);
|
||||
QName q = reader.getAttributeName(i);
|
||||
String localName = q.getLocalPart();
|
||||
String prefix = q.getPrefix();
|
||||
String qn = ("".equals(prefix)) ? localName : prefix + ":" + localName;
|
||||
|
@ -741,7 +755,7 @@ public class SAXParser
|
|||
int len = reader.getAttributeCount();
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
QName q = reader.getAttributeQName(i);
|
||||
QName q = reader.getAttributeName(i);
|
||||
String ln = q.getLocalPart();
|
||||
String u = q.getNamespaceURI();
|
||||
if (u == null && uri != null)
|
||||
|
@ -761,12 +775,12 @@ public class SAXParser
|
|||
|
||||
public String getLocalName(int index)
|
||||
{
|
||||
return reader.getAttributeName(index);
|
||||
return reader.getAttributeLocalName(index);
|
||||
}
|
||||
|
||||
public String getQName(int index)
|
||||
{
|
||||
QName q = reader.getAttributeQName(index);
|
||||
QName q = reader.getAttributeName(index);
|
||||
String localName = q.getLocalPart();
|
||||
String prefix = q.getPrefix();
|
||||
return ("".equals(prefix)) ? localName : prefix + ":" + localName;
|
||||
|
@ -864,13 +878,14 @@ public class SAXParser
|
|||
|
||||
public String getPublicId()
|
||||
{
|
||||
return null;
|
||||
Location l = reader.getLocation();
|
||||
return l.getPublicId();
|
||||
}
|
||||
|
||||
public String getSystemId()
|
||||
{
|
||||
Location l = reader.getLocation();
|
||||
return l.getLocationURI();
|
||||
return l.getSystemId();
|
||||
}
|
||||
|
||||
public String getEncoding()
|
||||
|
@ -885,13 +900,8 @@ public class SAXParser
|
|||
|
||||
// -- XMLResolver --
|
||||
|
||||
public InputStream resolve(String uri)
|
||||
throws XMLStreamException
|
||||
{
|
||||
return resolve(null, uri);
|
||||
}
|
||||
|
||||
public InputStream resolve(String publicId, String systemId)
|
||||
public Object resolveEntity(String publicId, String systemId,
|
||||
String baseURI, String namespace)
|
||||
throws XMLStreamException
|
||||
{
|
||||
if (entityResolver != null)
|
||||
|
@ -901,7 +911,16 @@ public class SAXParser
|
|||
InputSource input =
|
||||
entityResolver.resolveEntity(publicId, systemId);
|
||||
if (input != null)
|
||||
return input.getByteStream();
|
||||
{
|
||||
InputStream in = input.getByteStream();
|
||||
if (in == null)
|
||||
{
|
||||
String newSystemId = input.getSystemId();
|
||||
if (newSystemId != null && !newSystemId.equals(systemId))
|
||||
in = XMLParser.resolve(newSystemId);
|
||||
}
|
||||
return in;
|
||||
}
|
||||
}
|
||||
catch (SAXException e)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue