/** * Returns all the field trackings as an unmodifiable List. */ public List getFieldTracking() { if (Tapestry.size(_trackings) == 0) return null; return Collections.unmodifiableList(_trackings); }
/** * 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 }); }
/** * Creates an exception indicating the binding value is null. * * @since 3.0 */ public static BindingException createNullBindingException(IBinding binding) { return new BindingException(getMessage("null-value-for-binding"), binding); }
/** * 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()); }
/** @since 3.0 */ public void activate(IPage page) { Defense.notNull(page, "page"); if (LOG.isDebugEnabled()) LOG.debug("Activating page " + page); Tapestry.clearMethodInvocations(); page.validate(this); Tapestry.checkMethodInvocation(Tapestry.ABSTRACTPAGE_VALIDATE_METHOD_ID, "validate()", page); _page = page; }
protected void prepareForRender(IRequestCycle cycle) { super.prepareForRender(cycle); if (getImage() == null) throw Tapestry.createRequiredParameterException(this, "image"); } }
/** * By default, pages are not protected and this method does nothing. */ public void validate(IRequestCycle cycle) { Tapestry.addMethodInvocation(Tapestry.ABSTRACTPAGE_VALIDATE_METHOD_ID); firePageValidate(); }
/** * A convienience (useful in test code) for invoking {@link #newInstance(Class, Map)}. The Map * is constructed from the properties array, which consists of alternating keys and values. */ public Object newInstance(Class abstractClass, Object[] properties) { Map propertyMap = Tapestry.convertArrayToMap(properties); return newInstance(abstractClass, propertyMap); } }
public boolean getAllowBody(String componentId, Location location) { IComponent embedded = _component.getComponent(componentId); if (embedded == null) throw Tapestry.createNoSuchComponentException(_component, componentId, location); return embedded.getSpecification().getAllowBody(); }
Tapestry.close(stream);
protected void prepareForRender(IRequestCycle cycle) { super.prepareForRender(cycle); if (getImage() == null) throw Tapestry.createRequiredParameterException(this, "image"); } }
/** * 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()); }
/** @since 3.0 */ public void activate(IPage page) { Defense.notNull(page, "page"); if (LOG.isDebugEnabled()) LOG.debug("Activating page " + page); Tapestry.clearMethodInvocations(); page.validate(this); Tapestry.checkMethodInvocation(Tapestry.ABSTRACTPAGE_VALIDATE_METHOD_ID, "validate()", page); _page = page; }
/** * By default, pages are not protected and this method does nothing. */ public void validate(IRequestCycle cycle) { Tapestry.addMethodInvocation(Tapestry.ABSTRACTPAGE_VALIDATE_METHOD_ID); firePageValidate(); }
/** * A convienience (useful in test code) for invoking {@link #newInstance(Class, Map)}. The Map * is constructed from the properties array, which consists of alternating keys and values. */ public Object newInstance(Class abstractClass, Object[] properties) { Map propertyMap = Tapestry.convertArrayToMap(properties); return newInstance(abstractClass, propertyMap); } }
public boolean getAllowBody(String componentId, Location location) { IComponent embedded = _component.getComponent(componentId); if (embedded == null) throw Tapestry.createNoSuchComponentException(_component, componentId, location); return embedded.getSpecification().getAllowBody(); }
Tapestry.close(stream);
/** * Invoked by the direct service to trigger the application-specific action by notifying the * {@link IActionListener listener}. */ public void trigger(IRequestCycle cycle) { String event = cycle.getParameter(BrowserEvent.NAME); IActionListener listener = (IActionListener)getAllListenerBindings().get(event); if (listener == null) throw Tapestry.createRequiredParameterException(this, event); getListenerInvoker().invokeListener(listener, this, cycle); }
/** * Returns all the field trackings as an unmodifiable List. */ public List getFieldTracking() { if (Tapestry.size(_trackings) == 0) return null; return Collections.unmodifiableList(_trackings); }
/** * 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); }