author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Wed, 16 Jul 2014 07:57:22 +0200 | |
branch | jdk8 |
changeset 1642 | c178e0bdce5d |
parent 702 | fa42b3d8cbbc |
child 1787 | ea12a3bb4b33 |
permissions | -rw-r--r-- |
jaroslav@672 | 1 |
/** |
jaroslav@672 | 2 |
* Back 2 Browser Bytecode Translator |
jaroslav@672 | 3 |
* Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
jaroslav@672 | 4 |
* |
jaroslav@672 | 5 |
* This program is free software: you can redistribute it and/or modify |
jaroslav@672 | 6 |
* it under the terms of the GNU General Public License as published by |
jaroslav@672 | 7 |
* the Free Software Foundation, version 2 of the License. |
jaroslav@672 | 8 |
* |
jaroslav@672 | 9 |
* This program is distributed in the hope that it will be useful, |
jaroslav@672 | 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
jaroslav@672 | 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
jaroslav@672 | 12 |
* GNU General Public License for more details. |
jaroslav@672 | 13 |
* |
jaroslav@672 | 14 |
* You should have received a copy of the GNU General Public License |
jaroslav@672 | 15 |
* along with this program. Look for COPYING file in the top folder. |
jaroslav@672 | 16 |
* If not, see http://opensource.org/licenses/GPL-2.0. |
jaroslav@672 | 17 |
*/ |
jaroslav@672 | 18 |
package org.apidesign.vm4brwsr; |
jaroslav@672 | 19 |
|
jaroslav@672 | 20 |
import java.io.IOException; |
jaroslav@672 | 21 |
import java.io.InputStream; |
jaroslav@672 | 22 |
import org.apidesign.bck2brwsr.emul.lang.ManifestInputStream; |
jaroslav@672 | 23 |
|
jaroslav@672 | 24 |
/** |
jaroslav@672 | 25 |
* |
jaroslav@672 | 26 |
* @author Jaroslav Tulach <jtulach@netbeans.org> |
jaroslav@672 | 27 |
*/ |
jaroslav@702 | 28 |
final class ParseMan extends ManifestInputStream { |
jaroslav@672 | 29 |
private String cp; |
jaroslav@702 | 30 |
private String mc; |
jaroslav@672 | 31 |
|
jaroslav@702 | 32 |
public ParseMan(InputStream is) throws IOException { |
jaroslav@672 | 33 |
super(is); |
jaroslav@672 | 34 |
readAttributes(new byte[512]); |
jaroslav@672 | 35 |
} |
jaroslav@672 | 36 |
|
jaroslav@672 | 37 |
@Override |
jaroslav@672 | 38 |
protected String putValue(String key, String value) { |
jaroslav@672 | 39 |
if ("Class-Path".equals(key)) { |
jaroslav@672 | 40 |
cp = value; |
jaroslav@672 | 41 |
} |
jaroslav@702 | 42 |
if ("Main-Class".equals(key)) { |
jaroslav@702 | 43 |
mc = value; |
jaroslav@702 | 44 |
} |
jaroslav@672 | 45 |
return null; |
jaroslav@672 | 46 |
} |
jaroslav@702 | 47 |
|
jaroslav@702 | 48 |
String getMainClass() { |
jaroslav@702 | 49 |
return mc; |
jaroslav@702 | 50 |
} |
jaroslav@672 | 51 |
|
jaroslav@672 | 52 |
@Override |
jaroslav@672 | 53 |
public String toString() { |
jaroslav@672 | 54 |
return cp; |
jaroslav@672 | 55 |
} |
jaroslav@672 | 56 |
|
jaroslav@672 | 57 |
} |