diff --git a/batik-bridge/src/main/resources/META-INF/services/org.apache.batik.script.InterpreterFactory b/batik-bridge/src/main/resources/META-INF/services/org.apache.batik.script.InterpreterFactory index 4912fea645..3ea8e5ccec 100644 --- a/batik-bridge/src/main/resources/META-INF/services/org.apache.batik.script.InterpreterFactory +++ b/batik-bridge/src/main/resources/META-INF/services/org.apache.batik.script.InterpreterFactory @@ -24,7 +24,5 @@ # ECMAScript org.apache.batik.bridge.RhinoInterpreterFactory -# TCL -#org.apache.batik.script.jacl.JaclInterpreterFactory # Python #org.apache.batik.script.jpython.JPythonInterpreterFactory diff --git a/batik-script/pom.xml b/batik-script/pom.xml index 7ab17c5f1a..330c9008be 100644 --- a/batik-script/pom.xml +++ b/batik-script/pom.xml @@ -69,11 +69,6 @@ maven-compiler-plugin ${compiler.version} - - - **/jacl/* - - maven-dependency-plugin diff --git a/batik-script/src/main/java/org/apache/batik/script/InterpreterPool.java b/batik-script/src/main/java/org/apache/batik/script/InterpreterPool.java index cab5979d49..50ffca6d5c 100644 --- a/batik-script/src/main/java/org/apache/batik/script/InterpreterPool.java +++ b/batik-script/src/main/java/org/apache/batik/script/InterpreterPool.java @@ -36,8 +36,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more * *

By default, it is able to create interpreters for ECMAScript, * Python and Tcl scripting languages if you provide the right jar - * files in your CLASSPATH (i.e. Rhino, JPython and Jacl jar - * files).

+ * files in your CLASSPATH (i.e. Rhino and JPython jar files).

* * @author Christophe Jolif * @version $Id$ diff --git a/batik-script/src/main/java/org/apache/batik/script/jacl/JaclInterpreter.java b/batik-script/src/main/java/org/apache/batik/script/jacl/JaclInterpreter.java deleted file mode 100644 index 055774653b..0000000000 --- a/batik-script/src/main/java/org/apache/batik/script/jacl/JaclInterpreter.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - */ -package org.apache.batik.script.jacl; - -import java.io.IOException; -import java.io.Reader; -import java.io.Writer; -import java.util.Locale; - -import org.apache.batik.script.InterpreterException; - -import tcl.lang.Interp; -import tcl.lang.ReflectObject; -import tcl.lang.TclException; - -/** - * A simple implementation of Interpreter interface to use - * JACL Tcl parser. - * @author Christophe Jolif - * @version $Id$ - */ -public class JaclInterpreter implements org.apache.batik.script.Interpreter { - private Interp interpreter = null; - - public JaclInterpreter() { - interpreter = new Interp(); - try { - interpreter.eval("package require java", 0); - } catch (TclException e) { - } - } - - // org.apache.batik.script.Intepreter implementation - - /** - * Returns the content types of the scripting languages this interpreter - * handles. - */ - public String[] getMimeTypes() { - return JaclInterpreterFactory.JACL_MIMETYPES; - } - - public Object evaluate(Reader scriptreader) throws IOException { - return evaluate(scriptreader, ""); - } - - public Object evaluate(Reader scriptreader, String description) - throws IOException { - // oops jacl doesn't accept reader in its eval method :-( - StringBuffer sbuffer = new StringBuffer(); - char[] buffer = new char[1024]; - int val = 0; - while ((val = scriptreader.read(buffer)) != -1) { - sbuffer.append(buffer, 0, val); - } - String str = sbuffer.toString(); - return evaluate(str); - } - - public Object evaluate(String script) { - try { - interpreter.eval(script, 0); - } catch (TclException e) { - throw new InterpreterException(e, e.getMessage(), -1, -1); - } catch (RuntimeException re) { - throw new InterpreterException(re, re.getMessage(), -1, -1); - } - return interpreter.getResult(); - } - - public void dispose() { - interpreter.dispose(); - } - - public void bindObject(String name, Object object) { - try { - interpreter. - setVar(name, - ReflectObject. - newInstance(interpreter, object.getClass(), object), - 0); - } catch (TclException e) { - // should not happened we just register an object - } - } - - public void setOut(Writer out) { - // no implementation of a default output function in Jacl - } - - // org.apache.batik.i18n.Localizable implementation - - public Locale getLocale() { - return Locale.getDefault(); - } - - public void setLocale(Locale locale) { - } - - public String formatMessage(String key, Object[] args) { - return null; - } -} diff --git a/batik-script/src/main/java/org/apache/batik/script/jacl/JaclInterpreterFactory.java b/batik-script/src/main/java/org/apache/batik/script/jacl/JaclInterpreterFactory.java deleted file mode 100644 index 1486cee92f..0000000000 --- a/batik-script/src/main/java/org/apache/batik/script/jacl/JaclInterpreterFactory.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - */ -package org.apache.batik.script.jacl; - -import java.net.URL; - -import org.apache.batik.script.ImportInfo; -import org.apache.batik.script.Interpreter; -import org.apache.batik.script.InterpreterFactory; - -/** - * Allows to create instances of JaclInterpreter class. - * @author Christophe Jolif - * @version $Id$ - */ -public class JaclInterpreterFactory implements InterpreterFactory { - - /** - * The MIME types that jacl can handle. - */ - public static final String[] JACL_MIMETYPES = { "text/tcl" }; - - /** - * Builds a JaclInterpreterFactory. - */ - public JaclInterpreterFactory() { - } - - /** - * Returns the mime-types to register this interpereter with. - */ - public String[] getMimeTypes() { - return JACL_MIMETYPES; - } - - /** - * Creates an instance of JaclInterpreter class. - * - * @param documentURL the url for the document which will be scripted - * @param svg12 whether the document is an SVG 1.2 document - */ - public Interpreter createInterpreter(URL documentURL, boolean svg12) { - return new JaclInterpreter(); - } - - /** - * Creates an instance of JaclInterpreter class. - * - * @param documentURL the url for the document which will be scripted - * @param svg12 whether the document is an SVG 1.2 document - * @param imports The set of classes/packages to import (if - * the interpreter supports that), may be null. - */ - public Interpreter createInterpreter(URL documentURL, boolean svg12, - ImportInfo imports) { - return new JaclInterpreter(); - } -} diff --git a/batik-script/src/main/java/org/apache/batik/script/jacl/package.html b/batik-script/src/main/java/org/apache/batik/script/jacl/package.html deleted file mode 100644 index 48f3ee6254..0000000000 --- a/batik-script/src/main/java/org/apache/batik/script/jacl/package.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Jacl Package - - - - Provides an API for interpreting Tcl language through - the Jacl interpreter. - - diff --git a/build.xml b/build.xml index 34d33df785..c3ef282be5 100644 --- a/build.xml +++ b/build.xml @@ -190,9 +190,6 @@ To display the available targets type: - - - @@ -231,15 +228,9 @@ To display the available targets type: - - - - - + value="${javadoc-exclusion-rhino},${javadoc-exclusion-jpython}"/> @@ -1034,7 +1025,6 @@ JAVA=/usr/bin/java - Jython engine, and -
  • - Tcl for which you need to download the - Jacl engine. -
  • To get more information on how to install optional diff --git a/documentation-sources/content/xdocs/install.xml b/documentation-sources/content/xdocs/install.xml index 0dc5ca70a8..84aa4e0c1a 100644 --- a/documentation-sources/content/xdocs/install.xml +++ b/documentation-sources/content/xdocs/install.xml @@ -237,12 +237,6 @@ jar xvf batik-1.6.zip you put the jython.jar file in the Batik lib directory. -

  • - For Tcl, you need to download Jacl & TclBlend distribution at - http://dev.scriptics.com/software/java/. - Then you put the jacl.jar and tcljava.jar - files in the Batik lib directory. -
  • Conversely, you can remove the js.jar of the Batik diff --git a/documentation-sources/content/xdocs/using/extending.xml b/documentation-sources/content/xdocs/using/extending.xml index 97476e8525..1cdc6a680d 100644 --- a/documentation-sources/content/xdocs/using/extending.xml +++ b/documentation-sources/content/xdocs/using/extending.xml @@ -731,14 +731,12 @@

    Batik comes with implementations of Interpreter and - IntepreterFactory to support TCL and Python script in - SVG documents, if the Jacl and Jython distributions are installed, - respectively. See the classes in the - org.apache.batik.script.jacl and - org.apache.batik.script.jython packages to guidance + IntepreterFactory to support Python script in + SVG documents, if the Jython distributions is installed. See the classes + in the org.apache.batik.script.jython packages to guidance on how to implement the interpreter interfaces, and the installation notes on what jar files are - needed for TCL and Python support. + needed for Python support.