jdk/test/java/util/ServiceLoader/modules/src/bananascript/org/banana/BananaScriptEngineFactory.java
changeset 42418 4330273ee80c
parent 42417 8e1573096052
parent 42401 925e4d87ebac
child 42419 5c71ea43933b
equal deleted inserted replaced
42417:8e1573096052 42418:4330273ee80c
     1 /*
       
     2  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.
       
     8  *
       
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    12  * version 2 for more details (a copy is included in the LICENSE file that
       
    13  * accompanied this code).
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License version
       
    16  * 2 along with this work; if not, write to the Free Software Foundation,
       
    17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    18  *
       
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    20  * or visit www.oracle.com if you need additional information or have any
       
    21  * questions.
       
    22  */
       
    23 
       
    24 package org.banana;
       
    25 
       
    26 import java.util.Arrays;
       
    27 import java.util.List;
       
    28 import javax.script.ScriptEngine;
       
    29 import javax.script.ScriptEngineFactory;
       
    30 
       
    31 public class BananaScriptEngineFactory implements ScriptEngineFactory {
       
    32 
       
    33     @Override
       
    34     public String getEngineName() {
       
    35         return "BananaScriptEngine";
       
    36     }
       
    37 
       
    38     @Override
       
    39     public String getEngineVersion() {
       
    40         return "1.0";
       
    41     }
       
    42 
       
    43     @Override
       
    44     public List<String> getExtensions() {
       
    45         return Arrays.asList("banana");
       
    46     }
       
    47 
       
    48     @Override
       
    49     public List<String> getMimeTypes() {
       
    50         return Arrays.asList("application/x-bananascript");
       
    51     }
       
    52 
       
    53     @Override
       
    54     public List<String> getNames() {
       
    55         return Arrays.asList("BananaScript");
       
    56     }
       
    57 
       
    58     @Override
       
    59     public String getLanguageName() {
       
    60         return "BananaScript";
       
    61     }
       
    62 
       
    63     @Override
       
    64     public String getLanguageVersion() {
       
    65         return "1.0";
       
    66     }
       
    67 
       
    68     @Override
       
    69     public Object getParameter(String key) {
       
    70         return null;
       
    71     }
       
    72 
       
    73     @Override
       
    74     public String getMethodCallSyntax(String obj, String m, String... args) {
       
    75         throw new RuntimeException();
       
    76     }
       
    77 
       
    78     @Override
       
    79     public String getOutputStatement(String toDisplay) {
       
    80         throw new RuntimeException();
       
    81     }
       
    82 
       
    83     @Override
       
    84     public String getProgram(String... statements) {
       
    85         throw new RuntimeException();
       
    86     }
       
    87 
       
    88     @Override
       
    89     public ScriptEngine getScriptEngine() {
       
    90         return new BananaScript();
       
    91     }
       
    92 }