< prev index next >

modules/jdk.packager/src/main/java/com/oracle/tools/packager/StandardBundlerParam.java

Print this page




 139                     I18N.getString("param.classpath.description"),
 140                     "classpath",
 141                     String.class,
 142                     params -> {
 143                         extractMainClassInfoFromAppResources(params);
 144                         String cp = (String) params.get("classpath");
 145                         return cp == null ? "" : cp;
 146                     },
 147                     (s, p) -> s.replace(File.pathSeparator, " ")
 148             );
 149 
 150     public static final StandardBundlerParam<String> MAIN_CLASS =
 151             new StandardBundlerParam<>(
 152                     I18N.getString("param.main-class.name"),
 153                     I18N.getString("param.main-class.description"),
 154                     BundleParams.PARAM_APPLICATION_CLASS,
 155                     String.class,
 156                     params -> {
 157                         //FIXME sniff modules
 158                         extractMainClassInfoFromAppResources(params);
 159                         return (String) params.get(BundleParams.PARAM_APPLICATION_CLASS);




 160                     },
 161                     (s, p) -> s
 162             );
 163 
 164     public static final StandardBundlerParam<String> APP_NAME =
 165             new StandardBundlerParam<>(
 166                     I18N.getString("param.app-name.name"),
 167                     I18N.getString("param.app-name.description"),
 168                     BundleParams.PARAM_NAME,
 169                     String.class,
 170                     params -> {
 171                         String s = MAIN_CLASS.fetchFrom(params);
 172                         if (s == null) return null;
 173 
 174                         int idx = s.lastIndexOf(".");
 175                         if (idx >= 0) {
 176                             return s.substring(idx+1);
 177                         }
 178                         return s;
 179                     },




 139                     I18N.getString("param.classpath.description"),
 140                     "classpath",
 141                     String.class,
 142                     params -> {
 143                         extractMainClassInfoFromAppResources(params);
 144                         String cp = (String) params.get("classpath");
 145                         return cp == null ? "" : cp;
 146                     },
 147                     (s, p) -> s.replace(File.pathSeparator, " ")
 148             );
 149 
 150     public static final StandardBundlerParam<String> MAIN_CLASS =
 151             new StandardBundlerParam<>(
 152                     I18N.getString("param.main-class.name"),
 153                     I18N.getString("param.main-class.description"),
 154                     BundleParams.PARAM_APPLICATION_CLASS,
 155                     String.class,
 156                     params -> {
 157                         //FIXME sniff modules
 158                         extractMainClassInfoFromAppResources(params);
 159                         String s = (String) params.get(BundleParams.PARAM_APPLICATION_CLASS);
 160                         if (s == null) {
 161                             s = JLinkBundlerHelper.getMainClass(params);
 162                         }
 163                         return s;
 164                     },
 165                     (s, p) -> s
 166             );
 167 
 168     public static final StandardBundlerParam<String> APP_NAME =
 169             new StandardBundlerParam<>(
 170                     I18N.getString("param.app-name.name"),
 171                     I18N.getString("param.app-name.description"),
 172                     BundleParams.PARAM_NAME,
 173                     String.class,
 174                     params -> {
 175                         String s = MAIN_CLASS.fetchFrom(params);
 176                         if (s == null) return null;
 177 
 178                         int idx = s.lastIndexOf(".");
 179                         if (idx >= 0) {
 180                             return s.substring(idx+1);
 181                         }
 182                         return s;
 183                     },


< prev index next >