List of usage examples for org.apache.commons.lang StringUtils isNotEmpty
public static boolean isNotEmpty(String str)
Checks if a String is not empty ("") and not null.
From source file:com.clican.pluto.dataprocess.spring.parser.JGroupPartitionProcessorParser.java
@SuppressWarnings("unchecked") public void customiseBeanDefinition(BeanDefinition beanDef, Element element, ParserContext parserContext) { ((RootBeanDefinition) beanDef).setInitMethodName("init"); String partition = element.getAttribute("partition"); if (StringUtils.isEmpty(partition)) { partition = "partition"; }//from w ww .jav a 2 s. com String partitionListName = element.getAttribute("partitionListName"); if (StringUtils.isNotEmpty(element.getAttribute("inputVarName"))) { String[] inputVarName = element.getAttribute("inputVarName").split(","); beanDef.getPropertyValues().addPropertyValue("inputVarName", inputVarName); } if (StringUtils.isNotEmpty(element.getAttribute("outputVarName"))) { String[] outputVarName = element.getAttribute("outputVarName").split(","); beanDef.getPropertyValues().addPropertyValue("outputVarName", outputVarName); } String serviceName = element.getAttribute("serviceName"); beanDef.getPropertyValues().addPropertyValue("partitionListName", partitionListName); beanDef.getPropertyValues().addPropertyValue("serviceName", serviceName); try { beanDef.getPropertyValues().addPropertyValue("partition", new RuntimeBeanReference(partition)); } catch (Throwable e) { } String[] partitionProcessors = element.getAttribute("partitionProcessors").split(","); List partitionProcessorList = new ManagedList(); for (String partitionProcessor : partitionProcessors) { partitionProcessorList.add(new RuntimeBeanReference(partitionProcessor.trim())); } beanDef.getPropertyValues().addPropertyValue("partitionProcessors", partitionProcessorList); }
From source file:com.pureinfo.srm.product.action.Product3IndexDuplicateListAction.java
public String getScenery() { String sDup = request.getParameter("dup"); return StringUtils.isNotEmpty(sDup) ? "duplicatelist" : "3index_list"; }
From source file:com.bstek.dorado.view.widget.action.LongTaskParser.java
@Override protected void initDefinition(ObjectDefinition definition, Element element, ParseContext context) throws Exception { super.initDefinition(definition, element, context); String taskName = (String) definition.getProperty("taskName"); if (taskName != null && taskName.charAt(0) == '#') { String viewName = ((ViewParseContext) context).getResourceName(); if (StringUtils.isNotEmpty(viewName)) { String prefix;//w w w .j ava 2 s . c om int i1 = viewName.lastIndexOf('/'); int i2 = viewName.lastIndexOf('.'); int i = (i1 > i2) ? i1 : i2; if (i > 0 && i < (viewName.length() - 1)) { prefix = viewName.substring(i + 1); } else { prefix = viewName; } definition.setProperty("taskName", StringUtils.uncapitalize(prefix) + taskName); } } }
From source file:com.clican.pluto.dataprocess.spring.parser.ForProcessorParser.java
@SuppressWarnings("unchecked") public void customiseBeanDefinition(BeanDefinition beanDef, Element element, ParserContext parserContext) { this.setBeanDefinitionStringProperty("elementName", beanDef, element); this.setBeanDefinitionStringProperty("step", beanDef, element); this.setBeanDefinitionStringProperty("start", beanDef, element); this.setBeanDefinitionStringProperty("end", beanDef, element); String commit = element.getAttribute("stepCommit"); if (StringUtils.isNotEmpty(commit)) { beanDef.getPropertyValues().addPropertyValue("stepCommit", Boolean.parseBoolean(commit)); }//from www . j a v a 2s .c o m String iteratorProcessors = element.getAttribute("iteratorProcessors"); List iteratorProcessorList = new ManagedList(); for (String nextDataProcess : iteratorProcessors.split(",")) { nextDataProcess = nextDataProcess.trim(); iteratorProcessorList.add(new RuntimeBeanReference(nextDataProcess)); } beanDef.getPropertyValues().addPropertyValue("iteratorProcessors", iteratorProcessorList); }
From source file:com.haulmont.cuba.gui.xml.layout.loaders.SourceCodeEditorLoader.java
@Override public void loadComponent() { super.loadComponent(); loadTabIndex(resultComponent, element); loadMode(resultComponent, element);/*from www. j ava 2 s . c o m*/ String showGutter = element.attributeValue("showGutter"); if (StringUtils.isNotEmpty(showGutter)) { resultComponent.setShowGutter(Boolean.parseBoolean(showGutter)); } String printMargin = element.attributeValue("printMargin"); if (StringUtils.isNotEmpty(printMargin)) { resultComponent.setShowPrintMargin(Boolean.parseBoolean(printMargin)); } String printMarginColumn = element.attributeValue("printMarginColumn"); if (StringUtils.isNotEmpty(printMarginColumn)) { resultComponent.setPrintMarginColumn(Integer.parseInt(printMarginColumn)); } String highlightActiveLine = element.attributeValue("highlightActiveLine"); if (StringUtils.isNotEmpty(highlightActiveLine)) { resultComponent.setHighlightActiveLine(Boolean.parseBoolean(highlightActiveLine)); } String handleTabKey = element.attributeValue("handleTabKey"); if (StringUtils.isNotEmpty("handleTabKey")) { resultComponent.setHandleTabKey(Boolean.parseBoolean(handleTabKey)); } }
From source file:info.magnolia.cms.taglibs.util.StrToObj.java
/** * @see javax.servlet.jsp.tagext.Tag#doEndTag() *//*from w ww .j a v a 2 s.c o m*/ public int doEndTag() { String str = getBodyContent().getString(); if (StringUtils.isNotEmpty(str)) { String[] obj = str.split(StringUtils.defaultString(this.delims, "\n")); //$NON-NLS-1$ pageContext.setAttribute(this.var, obj, PageContext.PAGE_SCOPE); } else { pageContext.setAttribute(this.var, StringUtils.EMPTY, PageContext.PAGE_SCOPE); } return EVAL_PAGE; }
From source file:com.bstek.dorado.view.type.property.validator.AjaxValidatorParser.java
@Override protected void initDefinition(ObjectDefinition definition, Element element, ParseContext context) throws Exception { super.initDefinition(definition, element, context); String service = (String) definition.getProperty("service"); if (service != null && service.charAt(0) == '#') { String viewName = ((ViewParseContext) context).getResourceName(); if (StringUtils.isNotEmpty(viewName)) { String prefix;/* w w w . j a v a 2 s.c om*/ int i1 = viewName.lastIndexOf('/'); int i2 = viewName.lastIndexOf('.'); int i = (i1 > i2) ? i1 : i2; if (i > 0 && i < (viewName.length() - 1)) { prefix = viewName.substring(i + 1); } else { prefix = viewName; } definition.setProperty("service", StringUtils.uncapitalize(prefix) + service); } } }
From source file:com.haulmont.cuba.gui.xml.layout.loaders.SearchFieldLoader.java
@Override public void loadComponent() { super.loadComponent(); SearchField searchField = (SearchField) resultComponent; String minSearchStringLength = element.attributeValue("minSearchStringLength"); if (StringUtils.isNotEmpty(minSearchStringLength)) { searchField.setMinSearchStringLength(Integer.parseInt(minSearchStringLength)); }//from w w w.j a v a 2s .com String modeString = element.attributeValue("mode"); if (StringUtils.isNotEmpty(modeString)) { SearchField.Mode mode; try { mode = SearchField.Mode.valueOf(StringUtils.upperCase(modeString)); } catch (IllegalArgumentException e) { throw new GuiDevelopmentException("Unable to parse mode for search", context.getFullFrameId(), "mode", modeString); } searchField.setMode(mode); } String escapeValueForLike = element.attributeValue("escapeValueForLike"); if (StringUtils.isNotEmpty(escapeValueForLike)) { searchField.setEscapeValueForLike(Boolean.parseBoolean(escapeValueForLike)); } }
From source file:com.vmware.thinapp.workpool.VmRunProgramOutput.java
public void log(final Logger logger) { if (logger == null) { return;/*ww w . j a v a 2 s . co m*/ } if (StringUtils.isNotEmpty(getStdout())) { logger.info(getStdout()); } if (StringUtils.isNotEmpty(getStderr())) { logger.error(getStderr()); } }
From source file:com.jfaker.framework.security.model.Menu.java
public Page<Menu> paginate(int pageNumber, int pageSize, String name) { String sql = "from sec_menu m left join sec_menu pm on m.parent_menu=pm.id"; if (StringUtils.isNotEmpty(name)) { sql += " where m.name like '%" + name + "%' "; }//from ww w . j a va2 s .c o m sql += " order by id desc"; return paginate(pageNumber, pageSize, "select m.*,pm.name as parentName", sql); }