KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > script > rhino > RhinoInterpreterFactory


1 /*
2
3    Copyright 2001-2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.script.rhino;
19
20 import java.net.URL JavaDoc;
21
22 import org.apache.batik.script.Interpreter;
23 import org.apache.batik.script.InterpreterFactory;
24
25 /**
26  * Allows to create instances of <code>RhinoInterpreter</code> class.
27  *
28  * @author <a HREF="mailto:cjolif@ilog.fr">Christophe Jolif</a>
29  * @author <a HREF="mailto:vhardy@apache.org">Vincent Hardy</a>
30  * @version $Id: RhinoInterpreterFactory.java,v 1.9 2004/08/27 00:42:07 deweese Exp $
31  */

32 public class RhinoInterpreterFactory implements InterpreterFactory {
33
34     final static String JavaDoc TEXT_ECMASCRIPT = "text/ecmascript";
35
36     /**
37      * Builds a <code>RhinoInterpreterFactory</code>.
38      */

39     public RhinoInterpreterFactory() {
40     }
41
42     /**
43      * Returns the mime-type to register this interpereter with.
44      */

45     public String JavaDoc getMimeType() { return TEXT_ECMASCRIPT; }
46
47     /**
48      * Creates an instance of <code>RhinoInterpreter</code> class.
49      *
50      * @param documentURL the url for the document which will be scripted
51      */

52     public Interpreter createInterpreter(URL JavaDoc documentURL) {
53         return new RhinoInterpreter(documentURL);
54     }
55 }
56
Popular Tags