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:fr.univlorraine.mondossierweb.services.apogee.AnnuMelLoginApogeeServiceImpl.java

@Override
public String findMailFromCodEtu(String cod_etu) {
    try {//from  www.  ja  va 2 s.  c o m
        //Si on a une requte SQL pour surcharger la requte livre avec l'application
        if (StringUtils.hasText(requestUtils.getMailFromCodEtu())) {

            //On utilise la requte indique dans le fichier XML
            return (String) entityManagerApogee
                    .createNativeQuery(requestUtils.getMailFromCodEtu().replaceAll("#COD_ETU#", cod_etu))
                    .getSingleResult();
        } else {
            return (String) entityManagerApogee
                    .createNativeQuery("select MAIL FROM ANNU_MEL_LOGIN WHERE COD_ETU=" + cod_etu)
                    .getSingleResult();
        }
    } catch (NoResultException e) {
        return null;
    } catch (EmptyResultDataAccessException e) {
        return null;
    }
}

From source file:fr.xebia.management.config.WebApplicationMavenInformationDefinitionParser.java

@Override
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext)
        throws BeanDefinitionStoreException {
    String id = super.resolveId(element, definition, parserContext);
    if (!StringUtils.hasText(id)) {
        id = "webApplicationMavenInformation";
    }//from   w  w  w.  j ava2  s.c  o  m

    return id;
}

From source file:com.phoenixnap.oss.ramlapisync.generation.rules.spring.SpringDelegateFieldDeclerationRule.java

public SpringDelegateFieldDeclerationRule(String delegateFieldName) {
    if (StringUtils.hasText(delegateFieldName)) {
        this.delegateFieldName = delegateFieldName;
    }
}

From source file:at.ac.tuwien.dsg.celar.mela.jCatascopiaClient.spring.JCatascopiaPollDataSourceBeanDefinitionParser.java

@Override
protected void doParse(Element element, BeanDefinitionBuilder builder) {
    String url = element.getAttribute("url");
    //        String port = element.getAttribute("port");
    String pollingIntervalMs = element.getAttribute("polling-interval-ms");

    builder.addPropertyValue("url", url);
    //        builder.addPropertyValue("port", Integer.valueOf(port));
    if (StringUtils.hasText(pollingIntervalMs)) {
        builder.addPropertyValue("pollingIntervalMs", Integer.valueOf(pollingIntervalMs));
    }//  ww w . j av a  2 s .c o  m

}

From source file:nz.co.senanque.madura.bundle.spring.BeanBeanDefinitionParser.java

protected void doParse(Element element, BeanDefinitionBuilder bean) {
    String bundleManager = element.getAttribute("bundleManager");
    if (!StringUtils.hasText(bundleManager))
        bundleManager = "bundleManager";
    bean.addPropertyReference("bundleManager", bundleManager);

    String interfaceName = element.getAttribute("interface");
    if (StringUtils.hasText(interfaceName)) {
        bean.addPropertyValue("interface", interfaceName);
    }/*  w w  w .  j  a  va2s  . c  om*/
}

From source file:biz.c24.io.spring.config.C24MarshallerBeanDefinitionParser.java

@Override
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {

    String modelRef = element.getAttribute("model-ref");
    modelRef = StringUtils.hasText(modelRef) ? modelRef : C24ModelBeanDefinitionParser.DEFAULT_BEAN_NAME;

    BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(C24Marshaller.class);
    builder.addConstructorArgReference(modelRef);
    return getSourcedBeanDefinition(builder, parserContext.extractSource(element));
}

From source file:com.phoenixnap.oss.ramlapisync.generation.rules.basic.DelegatingMethodBodyRule.java

public DelegatingMethodBodyRule(String delegateFieldName) {
    if (StringUtils.hasText(delegateFieldName)) {
        this.delegateFieldName = delegateFieldName;
    }
}

From source file:com.artivisi.biller.simulator.service.impl.BillerSimulatorServiceImpl.java

@Override
public Bank findBankById(String id) {
    if (!StringUtils.hasText(id))
        return null;
    return (Bank) sessionFactory.getCurrentSession().get(Bank.class, id);
}

From source file:fr.univlorraine.mondossierweb.utils.PropertyUtils.java

/** Retourne le champ de recherche de l'index elasticSearch */
public static String getElasticSearchChampRecherche() {
    String value = System.getProperty("context.param.elasticsearch.index.champrecherche");
    if (!StringUtils.hasText(value))
        throw new NullPointerException("param.elasticsearch.index.champrecherche cannot be null !");
    return value;
}

From source file:com.phoenixnap.oss.ramlapisync.generation.rules.spring.SpringRestTemplateFieldDeclerationRule.java

public SpringRestTemplateFieldDeclerationRule(String delegateFieldName) {
    if (StringUtils.hasText(delegateFieldName)) {
        this.delegateFieldName = delegateFieldName;
    }
}