@Override public String getMessage() { String msg = super.getMessage(); if (msg != null && msg.length() > 0) { return msg; } else { return LocalizationManager.get().getLocalizedTextString(this); } }
void validateDumpConfig(ConfigurationBuffer configurationBuffer) throws ConfigurationException { if (dumpConfigFile != null) { final String text = FileConfigurator.formatBuffer(configurationBuffer, "royale-config", LocalizationManager.get(), "flex2.configuration"); try { final Writer writer = new FileWriter(dumpConfigFile); IOUtils.write(text, writer); IOUtils.closeQuietly(writer); } catch (IOException e) { throw new ConfigurationException.IOError(dumpConfigFile); } } }
void validateDumpConfig(ConfigurationBuffer configurationBuffer) throws ConfigurationException { if (dumpConfigFile != null) { final String text = FileConfigurator.formatBuffer(configurationBuffer, "royale-config", LocalizationManager.get(), "flex2.configuration"); try { final Writer writer = new FileWriter(dumpConfigFile); IOUtils.write(text, writer); IOUtils.closeQuietly(writer); } catch (IOException e) { throw new ConfigurationException.IOError(dumpConfigFile); } } }
@Override public String getMessage() { String msg = super.getMessage(); if (msg != null && msg.length() > 0) { return msg; } else { return LocalizationManager.get().getLocalizedTextString(this); } }
/** * Constructor */ public Configurator(Class<? extends Configuration> configurationClass) { this.configurationClass = configurationClass; args = new LinkedHashMap<String, Object>(); more = new LinkedHashMap<String, Object>(); tokens = new TreeMap<String, String>(); keepLinkReport = false; keepSizeReport = false; keepConfigurationReport = false; reportMissingLibraries = true; warnOnRoyaleOnlyOptionUsage = false; isConfigurationDirty = true; configurationDefaultVariable = ICompilerSettingsConstants.FILE_SPECS_VAR; // the default variable of the configuration. configurationPathResolver = new ConfigurationPathResolver(System.getProperty("user.dir")); configurationProblems = new ArrayList<ICompilerProblem>(); // initialize the localization manager. LocalizationManager.get().addLocalizer(new ResourceBundleLocalizer()); }
/** * Constructor */ public Configurator(Class<? extends Configuration> configurationClass) { this.configurationClass = configurationClass; args = new LinkedHashMap<String, Object>(); more = new LinkedHashMap<String, Object>(); tokens = new TreeMap<String, String>(); keepLinkReport = false; keepSizeReport = false; keepConfigurationReport = false; reportMissingLibraries = true; warnOnRoyaleOnlyOptionUsage = false; isConfigurationDirty = true; configurationDefaultVariable = ICompilerSettingsConstants.FILE_SPECS_VAR; // the default variable of the configuration. configurationPathResolver = new ConfigurationPathResolver(System.getProperty("user.dir")); configurationProblems = new ArrayList<ICompilerProblem>(); // initialize the localization manager. LocalizationManager.get().addLocalizer(new ResourceBundleLocalizer()); }
/** * Print detailed help information if -help is provided. */ private void processHelp(final List<ConfigurationValue> helpVar) { final Set<String> keywords = new LinkedHashSet<String>(); for (final ConfigurationValue val : helpVar) { for (final Object element : val.getArgs()) { String keyword = (String)element; while (keyword.startsWith("-")) keyword = keyword.substring(1); keywords.add(keyword); } } if (keywords.size() == 0) keywords.add("help"); final String usages = CommandLineConfigurator.usage( getProgramName(), DEFAULT_VAR, configBuffer, keywords, LocalizationManager.get(), L10N_CONFIG_PREFIX); System.out.println(getStartMessage()); System.out.println(usages); }
/** * Print detailed help information if -help is provided. */ private void processHelp(final List<ConfigurationValue> helpVar) { final Set<String> keywords = new LinkedHashSet<String>(); for (final ConfigurationValue val : helpVar) { for (final Object element : val.getArgs()) { String keyword = (String)element; while (keyword.startsWith("-")) keyword = keyword.substring(1); keywords.add(keyword); } } if (keywords.size() == 0) keywords.add("help"); final String usages = CommandLineConfigurator.usage( getProgramName(), DEFAULT_VAR, configBuffer, keywords, LocalizationManager.get(), L10N_CONFIG_PREFIX); System.out.println(getStartMessage()); System.out.println(usages); }
/** * Print detailed help information if -help is provided. */ private void processHelp(final List<ConfigurationValue> helpVar) { final Set<String> keywords = new LinkedHashSet<String>(); for (final ConfigurationValue val : helpVar) { for (final Object element : val.getArgs()) { String keyword = (String)element; while (keyword.startsWith("-")) keyword = keyword.substring(1); keywords.add(keyword); } } if (keywords.size() == 0) keywords.add("help"); final String usages = CommandLineConfigurator.usage( getProgramName(), DEFAULT_VAR, configBuffer, keywords, LocalizationManager.get(), L10N_CONFIG_PREFIX); println(getStartMessage()); println(usages); }
/** * Print detailed help information if -help is provided. */ private void processHelp(final List<ConfigurationValue> helpVar) { final Set<String> keywords = new LinkedHashSet<String>(); for (final ConfigurationValue val : helpVar) { for (final Object element : val.getArgs()) { String keyword = (String)element; while (keyword.startsWith("-")) keyword = keyword.substring(1); keywords.add(keyword); } } if (keywords.size() == 0) keywords.add("help"); final String usages = CommandLineConfigurator.usage( getProgramName(), DEFAULT_VAR, configBuffer, keywords, LocalizationManager.get(), L10N_CONFIG_PREFIX); println(getStartMessage()); println(usages); }
/** * Print detailed help information if -help is provided. */ private void processHelp(final List<ConfigurationValue> helpVar) { final Set<String> keywords = new LinkedHashSet<String>(); for (final ConfigurationValue val : helpVar) { for (final Object element : val.getArgs()) { String keyword = (String)element; while (keyword.startsWith("-")) keyword = keyword.substring(1); keywords.add(keyword); } } if (keywords.size() == 0) keywords.add("help"); final String usages = CommandLineConfigurator.usage( getProgramName(), DEFAULT_VAR, configBuffer, keywords, LocalizationManager.get(), L10N_CONFIG_PREFIX); println(getStartMessage()); println(usages); }
/** * Print detailed help information if -help is provided. */ private void processHelp(final List<ConfigurationValue> helpVar) { final Set<String> keywords = new LinkedHashSet<String>(); for (final ConfigurationValue val : helpVar) { for (final Object element : val.getArgs()) { String keyword = (String)element; while (keyword.startsWith("-")) keyword = keyword.substring(1); keywords.add(keyword); } } if (keywords.size() == 0) keywords.add("help"); final String usages = CommandLineConfigurator.usage( getProgramName(), DEFAULT_VAR, configBuffer, keywords, LocalizationManager.get(), L10N_CONFIG_PREFIX); println(getStartMessage()); println(usages); }
/** * Print detailed help information if -help is provided. */ private void processHelp(final List<ConfigurationValue> helpVar) { final Set<String> keywords = new LinkedHashSet<String>(); for (final ConfigurationValue val : helpVar) { for (final Object element : val.getArgs()) { String keyword = (String)element; while (keyword.startsWith("-")) keyword = keyword.substring(1); keywords.add(keyword); } } if (keywords.size() == 0) keywords.add("help"); final String usages = CommandLineConfigurator.usage( getProgramName(), DEFAULT_VAR, configBuffer, keywords, LocalizationManager.get(), L10N_CONFIG_PREFIX); println(getStartMessage()); println(usages); }
/** * Configures the LocalizationManager's locale, which is used when reporting compile time errors, warnings, and * info. * * @param toolsLocale A locale in Java format. For example, "en" or "ja_JP". * @throws ConfigurationException When the specified toolsLocale is not available a ToolsLocaleNotAvailable error is * reported. */ @Config @Mapping("tools-locale") public void setToolsLocale(ConfigurationValue cv, String toolsLocale) throws ConfigurationException { Locale[] locales = Locale.getAvailableLocales(); for (int i = 0; i < locales.length; i++) { if (locales[i].toString().equals(toolsLocale)) { this.toolsLocale = locales[i]; LocalizationManager.get().setLocale(locales[i]); return; } } throw new ConfigurationException.ToolsLocaleNotAvailable(cv.getVar(), cv.getSource(), cv.getLine()); }
/** * Configures the LocalizationManager's locale, which is used when reporting compile time errors, warnings, and * info. * * @param toolsLocale A locale in Java format. For example, "en" or "ja_JP". * @throws ConfigurationException When the specified toolsLocale is not available a ToolsLocaleNotAvailable error is * reported. */ @Config @Mapping("tools-locale") public void setToolsLocale(ConfigurationValue cv, String toolsLocale) throws ConfigurationException { Locale[] locales = Locale.getAvailableLocales(); for (int i = 0; i < locales.length; i++) { if (locales[i].toString().equals(toolsLocale)) { this.toolsLocale = locales[i]; LocalizationManager.get().setLocale(locales[i]); return; } } throw new ConfigurationException.ToolsLocaleNotAvailable(cv.getVar(), cv.getSource(), cv.getLine()); }
getProgramName(), DEFAULT_VAR, LocalizationManager.get(), L10N_CONFIG_PREFIX); System.out.println(getStartMessage());
getProgramName(), DEFAULT_VAR, LocalizationManager.get(), L10N_CONFIG_PREFIX); System.out.println(getStartMessage());
getProgramName(), DEFAULT_VAR, LocalizationManager.get(), L10N_CONFIG_PREFIX); println(getStartMessage());
getProgramName(), DEFAULT_VAR, LocalizationManager.get(), L10N_CONFIG_PREFIX); println(getStartMessage());
getProgramName(), DEFAULT_VAR, LocalizationManager.get(), L10N_CONFIG_PREFIX); println(getStartMessage());