Imported GNU Classpath 0.20

Imported GNU Classpath 0.20
       * Makefile.am (AM_CPPFLAGS): Add classpath/include.
       * java/nio/charset/spi/CharsetProvider.java: New override file.
       * java/security/Security.java: Likewise.
       * sources.am: Regenerated.
       * Makefile.in: Likewise.

From-SVN: r109831
This commit is contained in:
Mark Wielaard 2006-01-17 18:09:40 +00:00
parent bcb36c3e02
commit 2127637945
444 changed files with 75778 additions and 30731 deletions

View file

@ -1,5 +1,5 @@
/* TransformerFactoryImpl.java --
Copyright (C) 2004 Free Software Foundation, Inc.
Copyright (C) 2004,2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -37,7 +37,11 @@ exception statement from your version. */
package gnu.xml.transform;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import java.util.Iterator;
import java.util.LinkedHashMap;
@ -73,7 +77,7 @@ public class TransformerFactoryImpl
{
final XPathFactory xpathFactory;
final XSLURIResolver resolver;
final XSLURIResolver resolver;
ErrorListener userListener;
URIResolver userResolver;
@ -341,5 +345,46 @@ public class TransformerFactoryImpl
{
return userListener;
}
/**
* Syntax: TransformerFactoryImpl [<stylesheet> [<input> [<output>]]]
*/
public static void main(String[] args)
throws Exception
{
InputStream stylesheet = null, in = null;
OutputStream out = null;
try
{
if (args.length > 0)
{
stylesheet = new FileInputStream(args[0]);
if (args.length > 1)
{
in = new FileInputStream(args[1]);
if (args.length > 2)
out = new FileOutputStream(args[2]);
}
}
if (in == null)
in = System.in;
if (out == null)
out = System.out;
TransformerFactory f = new TransformerFactoryImpl();
Transformer t = (stylesheet != null) ?
f.newTransformer(new StreamSource(stylesheet)) :
f.newTransformer();
t.transform(new StreamSource(in), new StreamResult(out));
}
finally
{
if (stylesheet != null)
stylesheet.close();
if (in != null && in instanceof FileInputStream)
in.close();
if (out != null && out instanceof FileOutputStream)
out.close();
}
}
}