/** * Convienience method for invoking {@link #format(String, Object[])}. * * @since 3.0 */ public static String format(String key, Object arg) { return format(key, new Object[] { arg }); }
/** * Constructor used when the target action id is not found. */ public StaleLinkException(IPage page, String targetActionId, String targetIdPath) { this(Tapestry.format("StaleLinkException.component-mismatch", targetActionId, targetIdPath), page); }
/** * Convienience method for invoking {@link #format(String, Object[])}. * * @since 3.0 */ public static String format(String key, Object arg) { return format(key, new Object[] { arg }); }
/** * Convienience method for invoking {@link #format(String, Object[])}. * * @since 3.0 */ public static String format(String key, Object arg1, Object arg2) { return format(key, new Object[] { arg1, arg2 }); }
/** * Convienience method for invoking {@link #format(String, Object[])}. * * @since 3.0 */ public static String format(String key, Object arg1, Object arg2, Object arg3) { return format(key, new Object[] { arg1, arg2, arg3 }); }
/** * Convienience method for invoking {@link #format(String, Object[])}. * * @since 3.0 */ public static String getMessage(String key) { return format(key, null); }
/** * Convienience method for invoking {@link #format(String, Object[])}. * * @since 3.0 */ public static String format(String key, Object arg1, Object arg2) { return format(key, new Object[] { arg1, arg2 }); }
public void addConfiguration(String propertyName, String value) { if (_configuration.containsKey(propertyName)) throw new IllegalArgumentException(Tapestry.format("ExtensionSpecification.duplicate-property", this, propertyName)); _configuration.put(propertyName, value); }
public void setPageSpecificationPath(String name, String path) { if (_pages == null) _pages = new HashMap(); if (_pages.containsKey(name)) throw new IllegalArgumentException(Tapestry.format("LibrarySpecification.duplicate-page-name", name)); _pages.put(name, path); }
public void addConfiguration(String propertyName, String value) { if (_configuration.containsKey(propertyName)) throw new IllegalArgumentException(Tapestry.format("ExtensionSpecification.duplicate-property", this, propertyName)); _configuration.put(propertyName, value); }
public void setComponentSpecificationPath(String alias, String path) { if (_components == null) _components = new HashMap(); if (_components.containsKey(alias)) throw new IllegalArgumentException(Tapestry.format("LibrarySpecification.duplicate-component-alias", alias)); _components.put(alias, path); }
public void setPageSpecificationPath(String name, String path) { if (_pages == null) _pages = new HashMap(); if (_pages.containsKey(name)) throw new IllegalArgumentException(Tapestry.format("LibrarySpecification.duplicate-page-name", name)); _pages.put(name, path); }
public IComponent getComponent(String id) { Defense.notNull(id, "id"); IComponent result = null; if (_components != null) result = (IComponent) _components.get(id); if (result == null) throw new ApplicationRuntimeException(Tapestry.format("no-such-component", this, id), this, null, null); return result; }
private NumberStrategy getStrategy(IFormComponent field) { NumberStrategy result = getStrategy(_valueTypeClass); if (result == null) throw new ApplicationRuntimeException(Tapestry.format("NumberValidator.no-adaptor-for-field", field, _valueTypeClass.getName())); return result; }
/** @since 3.0 * */ public static ApplicationRuntimeException createNoSuchComponentException(IComponent component, String id, Location location) { return new ApplicationRuntimeException(format("no-such-component", component.getExtendedId(), id), component, location, null); }
/** @since 3.0 * */ public static ApplicationRuntimeException createRenderOnlyPropertyException( IComponent component, String propertyName) { return new ApplicationRuntimeException(format("render-only-property", propertyName, component.getExtendedId()), component, null, null); }
/** @since 3.0 * */ public static ApplicationRuntimeException createRenderOnlyPropertyException( IComponent component, String propertyName) { return new ApplicationRuntimeException(format("render-only-property", propertyName, component.getExtendedId()), component, null, null); }
private boolean convertValue(String value) { try { Boolean b = (Boolean) getDataSqueezer().unsqueeze(value); return b.booleanValue(); } catch (Exception ex) { throw new ApplicationRuntimeException(Tapestry.format( "FormConditional.unable-to-convert-string", value), this, null, ex); } }
/** * Returns a string identifying the namespace, for use in error messages. * I.e., "Application namespace" or "namespace 'foo'". */ public String getNamespaceId() { if (_frameworkNamespace) return Tapestry.getMessage("Namespace.framework-namespace"); if (_applicationNamespace) return Tapestry.getMessage("Namespace.application-namespace"); return Tapestry.format("Namespace.nested-namespace", getExtendedId()); }
private IComponentSpecification locateComponentSpecification(String type) { String path = _specification.getComponentSpecificationPath(type); if (path == null) throw new ApplicationRuntimeException(Tapestry.format("Namespace.no-such-alias", type, getNamespaceId())); // We don't record line-precise data about <component-type> elements // so use the location for the specification as a whole (at least // identifying // the right file) return _resources.getComponentSpecification(getSpecificationLocation(), path, getLocation()); }