Example usage for org.springframework.util StringUtils hasText

List of usage examples for org.springframework.util StringUtils hasText

Introduction

In this page you can find the example usage for org.springframework.util StringUtils hasText.

Prototype

public static boolean hasText(@Nullable String str) 

Source Link

Document

Check whether the given String contains actual text.

Usage

From source file:egov.data.ibatis.repository.config.SqlMapRepositoryConfigDefinitionParser.java

@Override
protected void postProcessBeanDefinition(SqlMapRepositoryConfiguration ctx, BeanDefinitionBuilder builder,
        BeanDefinitionRegistry registry, Object beanSource) {
    // SqlMapRepositoryFactoryBean? sqlMapClient 
    if (StringUtils.hasText(ctx.getSqlMapClientRef())) {
        builder.addPropertyReference(SqlMapRepositoryFactoryBean.DEFAULT_SQLMAP_CLIENT_NAME,
                ctx.getSqlMapClientRef());
    } else {/*from   w  ww . j  a v  a 2  s . co m*/
        builder.addPropertyReference(SqlMapRepositoryFactoryBean.DEFAULT_SQLMAP_CLIENT_NAME,
                SqlMapRepositoryFactoryBean.DEFAULT_SQLMAP_CLIENT_NAME);
    }

    /* TODO Transaction   
    if(StringUtils.hasText(ctx.getTransactionManagerRef())) {
       builder.addPropertyValue(TxUtils.DEFAULT_TRANSACTION_MANAGER, ctx.getTransactionManagerRef());
    } else {
       builder.addPropertyValue(TxUtils.DEFAULT_TRANSACTION_MANAGER, TxUtils.DEFAULT_TRANSACTION_MANAGER);
    }
    */
}

From source file:org.jasypt.spring31.xml.encryption.AbstractEncryptionBeanDefinitionParser.java

protected final void processStringAttribute(final Element element, final BeanDefinitionBuilder builder,
        final String attributeName, final String propertyName) {
    final String attributeValue = element.getAttribute(attributeName);
    if (StringUtils.hasText(attributeValue)) {
        builder.addPropertyValue(propertyName, attributeValue);
    }// w w w  .ja v a 2 s  . c  o m
}

From source file:de.itsvs.cwtrpc.controller.config.SerializationPolicyProviderBeanDefinitionParser.java

@Override
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext)
        throws BeanDefinitionStoreException {
    final String id;

    id = element.getAttribute(ID_ATTRIBUTE);
    return StringUtils.hasText(id) ? id : ExtendedSerializationPolicyProvider.DEFAULT_BEAN_ID;
}

From source file:org.sventon.web.ctrl.DeleteConfigurationController.java

@Override
protected ModelAndView handleRequestInternal(final HttpServletRequest request,
        final HttpServletResponse response) throws Exception {

    final String repositoryToDelete = ServletRequestUtils.getStringParameter(request, "name", null);

    if (StringUtils.hasText(repositoryToDelete)) {
        final RepositoryName repositoryName = new RepositoryName(repositoryToDelete);
        application.deleteConfiguration(repositoryName);
    }/*from w  ww .jav  a2 s  . c o m*/
    return new ModelAndView(new RedirectView("/repos/listconfigs", true));
}

From source file:org.openregistry.core.web.propertyeditors.AbstractReferenceRepositoryPropertyEditor.java

@Override
public final void setAsText(final String s) throws IllegalArgumentException {
    if (StringUtils.hasText(s)) {
        setAsTextInternal(s);/*  www. j  a v  a 2 s .  c  o m*/
    } else {
        setValue(null);
    }
}

From source file:com.joyveb.dbpimpl.cass.prepare.config.xml.CassandraMappingConverterParser.java

@Override
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext)
        throws BeanDefinitionStoreException {

    String id = super.resolveId(element, definition, parserContext);
    return StringUtils.hasText(id) ? id : ConfigConstants.CASSANDRA_CONVERTER;
}

From source file:csns.web.validator.AssignmentValidator.java

@Override
public void validate(Object target, Errors errors) {
    ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "error.field.required");

    Assignment assignment = (Assignment) target;
    if (!StringUtils.hasText(assignment.getAlias()))
        assignment.setAlias(assignment.getName());

    if (!assignment.isOnline()) {
        errors.pushNestedPath("description");
        ValidationUtils.invokeValidator(resourceValidator, assignment.getDescription(), errors);
        errors.popNestedPath();/*from w  w w .  j a va 2 s  .co  m*/
    }
}

From source file:com.dinstone.jrpc.spring.spi.ClientBeanDefinitionParser.java

@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
    String id = element.getAttribute("id");
    if (!StringUtils.hasText(id)) {
        builder.addPropertyValue("clientId", Client.class.getName());
        element.setAttribute("id", Client.class.getName());
    }/*from w w w .  ja  va 2s .c o  m*/

    // ================================================
    // Transport config
    // ================================================
    builder.addPropertyValue("transportBean", getTransportBeanDefinition(element, parserContext));

    // ================================================
    // Registry config
    // ================================================
    builder.addPropertyValue("registryBean", getRegistryBeanDefinition(element, parserContext));
}

From source file:ch.rasc.extclassgenerator.ReferenceBean.java

public boolean hasAnyProperties() {
    return StringUtils.hasText(this.type) || StringUtils.hasText(this.association)
            || StringUtils.hasText(this.child) || StringUtils.hasText(this.parent)
            || StringUtils.hasText(this.role) || StringUtils.hasText(this.inverse);
}

From source file:com.reactivetechnologies.analytics.dto.ArffJsonRequest.java

@Override
public String toString() {
    StringBuilder s = new StringBuilder("@RELATION ");
    s.append(StringUtils.hasText(getRelation()) ? getRelation() : "stream").append("\n\n");

    for (Attribute a : getAttributes()) {
        s.append("@ATTRIBUTE ").append(a.getName()).append(" ");
        if (StringUtils.hasText(a.getType())) {
            if (a.getType().equalsIgnoreCase("string") || a.getType().equalsIgnoreCase("numeric")) {
                s.append(a.getType()).append("\n");
            } else if (a.getType().equalsIgnoreCase("date")) {
                s.append(a.getType()).append("\"").append(a.getSelector()[0]).append("\"").append("\n");
            }//w ww.  ja  va 2s  . co  m
        } else {
            s.append("{").append(StringUtils.arrayToCommaDelimitedString(a.getSelector())).append("}")
                    .append("\n");
        }
    }

    s.append("\n@DATA\n");
    for (Text d : getData()) {
        s.append(d.getText()).append("\n");
    }

    return s.toString();
}