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:hydrograph.ui.validators.impl.NonEmptyStringValidatorRule.java
@Override public boolean validate(Object object, String propertyName, Map<String, List<FixedWidthGridRow>> inputSchemaMap, boolean isJobImported) { String value = (String) object; if (StringUtils.isNotEmpty(value)) { return true; }//from w ww . j a va2s. c o m errorMessage = propertyName + " is mandatory"; return false; }
From source file:com.cyclopsgroup.waterview.ui.action.ChangeSessionAttribute.java
/** * Overwrite or implement method execute() * * @see com.cyclopsgroup.waterview.Action#execute(com.cyclopsgroup.waterview.RuntimeData, com.cyclopsgroup.waterview.ActionContext) *///from ww w. ja va2s.c o m public void execute(RuntimeData data, ActionContext context) throws Exception { String name = data.getParameters().getString("attribute_name"); String value = data.getParameters().getString("attribute_value"); String type = data.getParameters().getString("attribute_type", "string"); Object v = value; if (StringUtils.isNotEmpty(type)) { v = TypeUtils.convert(value, type); } data.getSessionContext().put(name, v); //context.addMessage( "Attribute is changed in session" ); }
From source file:jp.co.nemuzuka.controller.project.management.ajax.MilestoneEditInfoController.java
@Override @ProjectAdmin//from ww w . j a v a2 s . c o m @ProjectMember protected Object execute() throws Exception { JsonResult result = new JsonResult(); //Form? String keyToString = asString("keyToString"); MilestoneForm form = milestoneService.get(keyToString); if (StringUtils.isNotEmpty(keyToString) && StringUtils.isEmpty(form.keyToString)) { //?????????????? result.setStatus(JsonResult.NO_DATA); result.getErrorMsg().add(ApplicationMessage.get("info.empty")); } else { result.setToken(this.setToken()); result.setResult(form); } return result; }
From source file:de.u808.simpleinquest.service.impl.DefaultMimeIconRegistry.java
private String getIcon(String mimeType) { String singleType = null;// w ww . ja va 2s .c o m if (StringUtils.isNotEmpty(mimeType) && mimeType.contains(",")) { String[] types = mimeType.split(","); singleType = this.getSuitableType(types); } else { singleType = mimeType; } return configBeanResource.getSystemConfig().getConfiguration().getMimeIconMap().getIconURI(singleType); }
From source file:com.haulmont.cuba.gui.xml.layout.loaders.SuggestionFieldLoader.java
protected void loadPopupWidth(SuggestionField suggestionField, Element element) { String popupWidth = element.attributeValue("popupWidth"); if (StringUtils.isNotEmpty(popupWidth)) { suggestionField.setPopupWidth(popupWidth); }//from w ww .j a va2 s. c o m }
From source file:com.dlshouwen.tdjs.channel.dao.ChannelDao.java
/** * ?id??//from w w w. jav a2s .c o m * @param identity * @param teamId id * @return */ public List<Map<String, Object>> getRecordsByIdentityAndTeamId(String identity, String teamId) { StringBuffer sql = new StringBuffer(); sql.append("select bc.* "); sql.append("from tdjs_channel bc "); if (StringUtils.isNotEmpty(identity) && identity.equals("1")) { if (StringUtils.isEmpty(teamId)) { sql.append("order by bc.channel_seq "); return this.queryForList(sql.toString()); } else { sql.append("where bc.team_id =? "); sql.append("order by bc.channel_seq "); return this.queryForList(sql.toString(), teamId); } } else if (StringUtils.isNotEmpty(identity) && identity.equals("0") && StringUtils.isNotEmpty(teamId)) { sql.append("where bc.team_id =? "); sql.append("order by bc.channel_seq "); return this.queryForList(sql.toString(), teamId); } else { sql.append("where 1>2"); } return this.queryForList(sql.toString()); }
From source file:com.janrain.oauth2.AuthorizationRequest.java
public AuthorizationRequest(String cookie, Map parameterMap) throws SimpleDBException { Map<String, String> data = new LinkedHashMap<String, String>(); for (Field f : EnumSet.allOf(Field.class)) { Object value = parameterMap.get(f.getFieldName().toLowerCase()); if (value != null && ((String[]) value).length > 0 && StringUtils.isNotEmpty(((String[]) value)[0])) { data.put(f.getFieldName(), ((String[]) value)[0]); }// w ww. j a va2s . c o m } data.put(Field.COOKIE.getFieldName(), cookie); data.put(Field.EXPIRES.getFieldName(), DateTimeUtils.ISO8601.get() .format(new Date(System.currentTimeMillis() + AUTH_REQUEST_TIMEOUT_SECONDS * 1000))); super.init(cookie, data); }
From source file:io.servicecomb.serviceregistry.config.ConfigurePropertyUtils.java
private static String buildPath(String path) { String prefix = System.getProperty(Const.URL_PREFIX); if (StringUtils.isNotEmpty(prefix)) { if (!path.startsWith(prefix)) { path = prefix + path;//from ww w . ja va 2s. c o m } } return path; }
From source file:com.cyclopsgroup.waterview.ui.view.pub.DefaultNavigationNode.java
/** * Overwrite or implement method execute() * * @see com.cyclopsgroup.waterview.Module#execute(com.cyclopsgroup.waterview.RuntimeData, com.cyclopsgroup.waterview.Context) *///from w w w. ja v a 2s . co m public void execute(RuntimeData data, Context context) throws Exception { RuntimeTreeNode navigationNode = null; String nodeId = data.getParameters().getString("node_id"); if (StringUtils.isNotEmpty(nodeId)) { NavigatorService nav = (NavigatorService) lookup(NavigatorService.ROLE); navigationNode = nav.getRuntimeNode(data).getNodeById(nodeId); } if (navigationNode == null) { navigationNode = (RuntimeTreeNode) context.get("navigationNode"); } if (navigationNode == null) { throw new IllegalArgumentException("No node is specified"); } context.put("navigationNode", navigationNode); String action = data.getParameters().getString("node_action"); if (StringUtils.equals("expand", action)) { navigationNode.expand(data); } else if (StringUtils.equals("collapse", action)) { navigationNode.collapse(); } }
From source file:com.googlecode.jtiger.modules.ecside.table.cell.CheckBoxHeaderCell.java
public String getHtmlDisplay(TableModel model, Column column) { HtmlBuilder html = new HtmlBuilder(); String tableId = model.getTable().getTableId(); String selectableControlName = column.getAlias(); html.td(2).valign("middle").append(" columnName=\"").append(column.getAlias()).append("\" "); if ("true".equalsIgnoreCase(column.getGroup())) { html.append(" group=\"true\" "); }/* w ww . j a v a2 s . c om*/ if (StringUtils.isNotEmpty(column.getWidth())) { html.width(column.getWidth()); } String headerClass = column.getHeaderClass(); StringBuffer styleClass = new StringBuffer(); if (StringUtils.isNotEmpty(headerClass)) { styleClass.append(headerClass); } if (StringUtils.isNotEmpty(column.getHeaderStyleClass())) { styleClass.append(" ").append(column.getHeaderStyleClass()); } html.styleClass(styleClass.toString().trim()); if (StringUtils.isNotEmpty(column.getHeaderStyle())) { html.style(column.getHeaderStyle()); } html.onmouseover(ECSideConstants.UTIL_FUNCTION_NAME + ".lightHeader(this,'" + tableId + "');"); html.onmouseout(ECSideConstants.UTIL_FUNCTION_NAME + ".unlightHeader(this,'" + tableId + "');"); html.close(); html.span(); String cstyle = "columnSeparator"; html.styleClass(cstyle); html.close().append(" "); html.spanEnd(); html.div().styleClass("headerTitle").close(); html.span().styleClass("checkboxHeader"); html.title(model.getMessages().getMessage(PreferencesConstants.HEAD_TIP_CHECKALL)); html.onclick(ECSideConstants.UTIL_FUNCTION_NAME + ".checkAll(this,'" + selectableControlName + "','" + tableId + "');"); html.close(); html.append(" "); // // html.input("checkbox"); // if (column.getStyleClass() != null) { // html.styleClass(column.getStyleClass()); // } else { //// html.styleClass("checkboxHeader"); // } // // html.xclose(); // html.spanEnd(); //html.append(column.getTitle()); html.divEnd(); html.tdEnd(); return html.toString(); }