public Object convertValue(Object value) { String s = (String) value; boolean b = HiveMind.isNonBlank(s) && !s.equals("false"); // JDK 1.4 has a Boolean.valueOf(), but we're trying for 1.3 compatibility return b ? Boolean.TRUE : Boolean.FALSE; }
public Object convertValue(Object value) { String s = (String) value; boolean b = HiveMind.isNonBlank(s) && !s.equals("false"); // JDK 1.4 has a Boolean.valueOf(), but we're trying for 1.3 compatibility return b ? Boolean.TRUE : Boolean.FALSE; }
private String extractMessage(Throwable t) { String message = t.getMessage(); return HiveMind.isNonBlank(message) ? message : t.getClass().getName(); }
/** @since 4.0 */ public void setAliases(String nameList) { if (HiveMind.isNonBlank(nameList)) { String[] names = TapestryUtils.split(nameList); _aliasNames = Arrays.asList(names); } }
/** @since 4.0 */ public void setAliases(String nameList) { if (HiveMind.isNonBlank(nameList)) { String[] names = TapestryUtils.split(nameList); _aliasNames = Arrays.asList(names); } }
private Validator extractValidatorBean(IComponent component, String validatorName, String value, String message) { String beanName = validatorName.substring(1); if (HiveMind.isNonBlank(value) || HiveMind.isNonBlank(message)) throw new ApplicationRuntimeException(ValidatorMessages .noValueOrMessageForBean(beanName)); return new BeanValidatorWrapper(component, beanName); }
private Validator extractValidatorBean(IComponent component, String validatorName, String value, String message) { String beanName = validatorName.substring(1); if (HiveMind.isNonBlank(value) || HiveMind.isNonBlank(message)) throw new ApplicationRuntimeException(ValidatorMessages .noValueOrMessageForBean(beanName)); return new BeanValidatorWrapper(component, beanName); }
private void writeDocType(IMarkupWriter writer, IRequestCycle cycle) { // This is the real code String doctype = getDoctype(); if (HiveMind.isNonBlank(doctype)) { writer.printRaw("<!DOCTYPE " + doctype + ">"); writer.println(); } }
private void writeDocType(IMarkupWriter writer, IRequestCycle cycle) { // This is the real code String doctype = getDoctype(); if (HiveMind.isNonBlank(doctype)) { writer.printRaw("<!DOCTYPE " + doctype + ">"); writer.println(); } }
protected void writeHiddenField(IMarkupWriter writer, String name, String id, String value) { writer.beginEmpty("postfield"); writer.attribute("name", name); if (HiveMind.isNonBlank(id)) writer.attribute("id", id); writer.attribute("value", value); writer.println(); }
protected void writeHiddenField(IMarkupWriter writer, String name, String id, String value) { writer.beginEmpty("postfield"); writer.attribute("name", name); if (HiveMind.isNonBlank(id)) writer.attribute("id", id); writer.attribute("value", value); writer.println(); }
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { Object conditionObject = cycle.getAttribute(IfBean.IF_VALUE_ATTRIBUTE); if (conditionObject instanceof Boolean && !((Boolean) conditionObject).booleanValue()) { String element = HiveMind.isNonBlank(getElement()) ? getElement() : getTemplateTagName(); boolean render = !cycle.isRewinding() && (getRenderTag() || HiveMind.isNonBlank(getElement())); if (render) { writer.begin(element); renderInformalParameters(writer, cycle); } renderBody(writer, cycle); if (render) writer.end(element); } } }
/** * Overwridden by {@link org.apache.tapestry.wml.GoFormSupportImpl} (WML). */ protected void writeHiddenField(IMarkupWriter writer, String name, String id, String value) { writer.beginEmpty("input"); writer.attribute("type", "hidden"); writer.attribute("name", name); if (HiveMind.isNonBlank(id)) writer.attribute("id", id); writer.attribute("value", value == null ? "" : value); writer.println(); }
/** * Overwridden by {@link org.apache.tapestry.wml.GoFormSupportImpl} (WML). */ protected void writeHiddenField(IMarkupWriter writer, String name, String id, String value) { writer.beginEmpty("input"); writer.attribute("type", "hidden"); writer.attribute("name", name); if (HiveMind.isNonBlank(id)) writer.attribute("id", id); writer.attribute("value", value == null ? "" : value); writer.println(); }
private void beginApplicationSpecificationInitial() { expectElement("application"); String name = getAttribute("name"); String engineClassName = getAttribute("engine-class"); IApplicationSpecification as = _factory.createApplicationSpecification(); as.setName(name); if (HiveMind.isNonBlank(engineClassName)) as.setEngineClassName(engineClassName); _rootObject = as; push(_elementName, as, STATE_LIBRARY_SPECIFICATION); }
private void beginApplicationSpecificationInitial() { expectElement("application"); String name = getAttribute("name"); String engineClassName = getAttribute("engine-class"); IApplicationSpecification as = _factory.createApplicationSpecification(); as.setName(name); if (HiveMind.isNonBlank(engineClassName)) as.setEngineClassName(engineClassName); _rootObject = as; push(_elementName, as, STATE_LIBRARY_SPECIFICATION); }
/** * @see org.apache.tapestry.AbstractComponent#renderComponent(IMarkupWriter, * IRequestCycle) */ protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { boolean render = !cycle.isRewinding(); if (render) { writer.begin("option"); String value = getValue(); if (HiveMind.isNonBlank(value)) writer.attribute("value", value); renderInformalParameters(writer, cycle); renderBody(writer, cycle); writer.end(); } }
/** * @see AbstractComponent#renderComponent(IMarkupWriter, IRequestCycle) */ protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { if (cycle.isRewinding()) return; writer.beginEmpty("setvar"); writer.attribute("name", getName()); renderInformalParameters(writer, cycle); String value = getValue(); if (HiveMind.isNonBlank(value)) writer.attribute("value", value); else writer.attribute("value", ""); writer.closeTag(); }
/** * @see AbstractComponent#renderComponent(IMarkupWriter, IRequestCycle) */ protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { if (cycle.isRewinding()) return; writer.beginEmpty("setvar"); writer.attribute("name", getName()); renderInformalParameters(writer, cycle); String value = getValue(); if (HiveMind.isNonBlank(value)) writer.attribute("value", value); else writer.attribute("value", ""); writer.closeTag(); }
/** * @see AbstractComponent#renderComponent(IMarkupWriter, IRequestCycle) */ protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { boolean render = !cycle.isRewinding(); if (render) { writer.begin("do"); writer.attribute("type", getType()); String label = getLabel(); if (HiveMind.isNonBlank(label)) writer.attribute("label", label); renderInformalParameters(writer, cycle); } renderBody(writer, cycle); if (render) writer.end(); }