public final String get(String key) { try { // Replace "." with "_" in the key to match what ConstantsImplCreator // does. return key == null ? null : messages.getString(key.replace(".", "_")); } catch (MissingResourceException e) { return null; } } }
public final String get(String key) { try { // Replace "." with "_" in the key to match what ConstantsImplCreator // does. return key == null ? null : messages.getString(key.replace(".", "_")); } catch (MissingResourceException e) { return null; } } }
public final String get(String key) { try { // Replace "." with "_" in the key to match what ConstantsImplCreator // does. return key == null ? null : messages.getString(key.replace(".", "_")); } catch (MissingResourceException e) { return null; } } }
sValue = rStrings.getString(sKey);
/** * get localized message for key. * * @param pkey key of message * @return localized text for the key */ public final String get(final String pkey) { try { // Replace "." with "_" in the key to match what ConstantsImplCreator does. return pkey == null ? null : messages.getString(pkey.replace(".", "_")); } catch (final MissingResourceException e) { return null; } } }
public String findMessage(Class<?> propertyType, String key) { if (key == null) { return null; } Class<?> typeToLookup = propertyType == null ? Object.class : propertyType; String label = null; while (typeToLookup != null && label == null) { try { ConstantsWithLookup constants = this.constantRegistry.get(typeToLookup); if (constants != null) { label = constants.getString(key); } } catch (MissingResourceException exc) { label = null; } typeToLookup = typeToLookup.getSuperclass(); } return label; }
public String findMessage(Class<?> propertyType, String key) { if (key == null) { return null; } Class<?> typeToLookup = propertyType == null ? Object.class : propertyType; String label = null; while (typeToLookup != null && label == null) { try { ConstantsWithLookup constants = this.constantRegistry.get(typeToLookup); if (constants != null) { label = constants.getString(key); } } catch (MissingResourceException exc) { label = null; } typeToLookup = typeToLookup.getSuperclass(); } return label; }
private String getMessage(Throwable error, String suffix, String defaultMessage) { if (this.constants == null) { return defaultMessage; } try { String className = error.getClass().getSimpleName(); if (error instanceof CommandException) { className = ((CommandException) error).getCauseSimpleClassName(); } String methodName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, className) + suffix; return this.constants.getString(methodName); } catch (MissingResourceException exc) { return defaultMessage; } } }
private String getMessage(Throwable error, String suffix, String defaultMessage) { if (this.constants == null) { return defaultMessage; } try { String className = error.getClass().getSimpleName(); if (error instanceof CommandException) { className = ((CommandException) error).getCauseSimpleClassName(); } String methodName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, className) + suffix; return this.constants.getString(methodName); } catch (MissingResourceException exc) { return defaultMessage; } } }
protected String getErrorMessage(StatusCodeException exception) { try { return this.constants.getString(this.constantsPrefix + exception.getStatusCode()); } catch (MissingResourceException exc) { return exception.getStatusText(); } }
protected String getErrorMessage(StatusCodeException exception) { try { return this.constants.getString(this.constantsPrefix + exception.getStatusCode()); } catch (MissingResourceException exc) { return exception.getStatusText(); } }
errorMsg = errorMsg.replace('.', '_'); String errorsString = errors.getString(errorMsg); if (errorsString != null) { ret = errorsString.replace("\n", "<br/>"); //$NON-NLS-1$ //$NON-NLS-2$