author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Tue, 24 Feb 2015 11:12:53 +0100 | |
changeset 1787 | ea12a3bb4b33 |
parent 1772 | e80693152d8b |
permissions | -rw-r--r-- |
jaroslav@1610 | 1 |
/** |
jaroslav@1610 | 2 |
* Back 2 Browser Bytecode Translator |
jaroslav@1787 | 3 |
* Copyright (C) 2012-2015 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@1772 | 21 |
import org.apidesign.vm4brwsr.extrnl.ImportedField; |
jaroslav@1611 | 22 |
|
jaroslav@1610 | 23 |
/** |
jaroslav@1610 | 24 |
* |
jaroslav@1610 | 25 |
* @author Jaroslav Tulach |
jaroslav@1610 | 26 |
*/ |
jaroslav@1610 | 27 |
public class ImplementFactory { |
jaroslav@1610 | 28 |
private ImplementFactory() { |
jaroslav@1610 | 29 |
} |
jaroslav@1610 | 30 |
|
jaroslav@1610 | 31 |
private static ImplementInterface create() { |
jaroslav@1610 | 32 |
return new Impl(); |
jaroslav@1610 | 33 |
} |
jaroslav@1610 | 34 |
|
jaroslav@1610 | 35 |
public static String hello() { |
jaroslav@1610 | 36 |
ImplementInterface i = create(); |
jaroslav@1610 | 37 |
return i.sayHello(); |
jaroslav@1610 | 38 |
} |
jaroslav@1772 | 39 |
|
jaroslav@1772 | 40 |
public static int meaning() { |
jaroslav@1772 | 41 |
return ImportedField.Factory.create(42).x; |
jaroslav@1772 | 42 |
} |
jaroslav@1610 | 43 |
|
jaroslav@1610 | 44 |
private static class Impl implements ImplementInterface { |
jaroslav@1610 | 45 |
|
jaroslav@1610 | 46 |
public Impl() { |
jaroslav@1610 | 47 |
} |
jaroslav@1610 | 48 |
|
jaroslav@1610 | 49 |
@Override |
jaroslav@1610 | 50 |
public String sayHello() { |
jaroslav@1610 | 51 |
return "Hello!"; |
jaroslav@1610 | 52 |
} |
jaroslav@1610 | 53 |
} |
jaroslav@1610 | 54 |
} |