-// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
package org.xwt;
import java.io.*;
public String toString() { return "ByteStream, source=" + (file == null ? "memory" : file.getAbsolutePath()); }
public Object get(Object name) {
- if (name.equals("getUTF")) return getUTF;
+ if (name.equals("getUTF")) return getUTF;
else if (name.equals("getDOM")) return getDOM;
else if (name.equals("fileName")) return file == null ? null : file.getAbsolutePath();
else return null;
os.close();
}
- private final JS.Function getDOM = new JS.Function(-1, "java", null, null) {
- public Object _call(JS.Array args) throws JS.Exn {
+ private final JS.Callable getDOM = new JS.Callable() {
+ public Object call(JS.Array args) throws JS.Exn {
if (args.length() != 0) return null;
return new XMLHelper().doParse();
}
};
- private final JS.Function getUTF = new JS.Function(-1, "java", null, null) {
- public Object _call(JS.Array args) throws JS.Exn {
+ private final JS.Callable getUTF = new JS.Callable() {
+ public Object call(JS.Array args) throws JS.Exn {
if (args.length() != 0) return null;
try {
CharArrayWriter caw = new CharArrayWriter();