added toString() method to Xml object:
res.write(Xml) now renders the name of the package used as XML-parser
This commit is contained in:
parent
4358af3f20
commit
0e333e8c73
1 changed files with 10 additions and 0 deletions
|
@ -53,7 +53,17 @@ public class DomExtension extends Extension {
|
|||
public ESObject doConstruct(ESObject thisObject, ESValue[] arguments) throws EcmaScriptException {
|
||||
throw new EcmaScriptException("Xml can't be instanced");
|
||||
}
|
||||
public String toString() {
|
||||
try {
|
||||
String parser = javax.xml.parsers.DocumentBuilderFactory.newInstance().getClass ().getPackage ().getName();
|
||||
return "[Xml " + parser + "]";
|
||||
} catch (NullPointerException zeero) {
|
||||
return "[Xml - no parser available]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class XmlWrite extends BuiltinFunctionObject {
|
||||
XmlWrite(String name, Evaluator evaluator, FunctionPrototype fp) {
|
||||
|
|
Loading…
Add table
Reference in a new issue