rt/vm/src/test/java/org/apidesign/vm4brwsr/ImplementFactory.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 28 May 2014 14:35:21 +0200
branchclosure
changeset 1611 d0df418a5993
parent 1610 a6f807104d8e
child 1772 e80693152d8b
permissions -rw-r--r--
External classes are treated as exported.
jaroslav@1610
     1
/**
jaroslav@1610
     2
 * Back 2 Browser Bytecode Translator
jaroslav@1610
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@1610
     4
 *
jaroslav@1610
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@1610
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@1610
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@1610
     8
 *
jaroslav@1610
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@1610
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@1610
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@1610
    12
 * GNU General Public License for more details.
jaroslav@1610
    13
 *
jaroslav@1610
    14
 * You should have received a copy of the GNU General Public License
jaroslav@1610
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@1610
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@1610
    17
 */
jaroslav@1610
    18
package org.apidesign.vm4brwsr;
jaroslav@1610
    19
jaroslav@1611
    20
import org.apidesign.vm4brwsr.extrnl.ImplementInterface;
jaroslav@1611
    21
jaroslav@1610
    22
/**
jaroslav@1610
    23
 *
jaroslav@1610
    24
 * @author Jaroslav Tulach
jaroslav@1610
    25
 */
jaroslav@1610
    26
public class ImplementFactory {
jaroslav@1610
    27
    private ImplementFactory() {
jaroslav@1610
    28
    }
jaroslav@1610
    29
    
jaroslav@1610
    30
    private static ImplementInterface create() {
jaroslav@1610
    31
        return new Impl();
jaroslav@1610
    32
    }
jaroslav@1610
    33
    
jaroslav@1610
    34
    public static String hello() {
jaroslav@1610
    35
        ImplementInterface i = create();
jaroslav@1610
    36
        return i.sayHello();
jaroslav@1610
    37
    }
jaroslav@1610
    38
jaroslav@1610
    39
    private static class Impl implements ImplementInterface {
jaroslav@1610
    40
jaroslav@1610
    41
        public Impl() {
jaroslav@1610
    42
        }
jaroslav@1610
    43
jaroslav@1610
    44
        @Override
jaroslav@1610
    45
        public String sayHello() {
jaroslav@1610
    46
            return "Hello!";
jaroslav@1610
    47
        }
jaroslav@1610
    48
    }
jaroslav@1610
    49
}