List of usage examples for org.apache.commons.lang3 StringUtils isNotEmpty
public static boolean isNotEmpty(final CharSequence cs)
Checks if a CharSequence is not empty ("") and not null.
StringUtils.isNotEmpty(null) = false StringUtils.isNotEmpty("") = false StringUtils.isNotEmpty(" ") = true StringUtils.isNotEmpty("bob") = true StringUtils.isNotEmpty(" bob ") = true
From source file:com.glaf.mail.web.springmvc.MailAccountController.java
@RequestMapping("/edit") public ModelAndView edit(HttpServletRequest request, ModelMap modelMap) { RequestUtils.setRequestParameterToAttribute(request); Map<String, Object> params = RequestUtils.getParameterMap(request); String rowId = ParamUtils.getString(params, "accountId"); MailAccount mailAccount = null;//from w w w.j a v a 2s . co m if (StringUtils.isNotEmpty(rowId)) { mailAccount = mailAccountService.getMailAccount(rowId); if (StringUtils.equals(RequestUtils.getActorId(request), mailAccount.getCreateBy())) { request.setAttribute("mailAccount", mailAccount); } } String view = request.getParameter("view"); if (StringUtils.isNotEmpty(view)) { return new ModelAndView(view, modelMap); } String x_view = CustomProperties.getString("mailAccount.edit"); if (StringUtils.isNotEmpty(x_view)) { return new ModelAndView(x_view, modelMap); } return new ModelAndView("/modules/mail/mailAccount/edit", modelMap); }
From source file:com.haulmont.cuba.web.gui.components.table.LinkCellClickListener.java
@Override public void onClick(final Entity rowItem, final String columnId) { Table.Column column = table.getColumn(columnId); if (column.getXmlDescriptor() != null) { String invokeMethodName = column.getXmlDescriptor().attributeValue("linkInvoke"); if (StringUtils.isNotEmpty(invokeMethodName)) { callControllerInvoke(rowItem, columnId, invokeMethodName); return; }//from ww w.jav a2 s .c om } Entity entity; Object value = rowItem.getValueEx(columnId); if (value instanceof Entity) { entity = (Entity) value; } else { entity = rowItem; } WindowManager wm; Window window = ComponentsHelper.getWindow(table); if (window == null) { throw new IllegalStateException("Please specify Frame for Table"); } else { wm = window.getWindowManager(); } Messages messages = applicationContext.getBean(Messages.NAME, Messages.class); if (entity instanceof SoftDelete && ((SoftDelete) entity).isDeleted()) { wm.showNotification(messages.getMainMessage("OpenAction.objectIsDeleted"), Frame.NotificationType.HUMANIZED); return; } DataSupplier dataSupplier = window.getDsContext().getDataSupplier(); entity = dataSupplier.reload(entity, View.MINIMAL); WindowConfig windowConfig = applicationContext.getBean(WindowConfig.NAME, WindowConfig.class); String windowAlias = null; if (column.getXmlDescriptor() != null) { windowAlias = column.getXmlDescriptor().attributeValue("linkScreen"); } if (StringUtils.isEmpty(windowAlias)) { windowAlias = windowConfig.getEditorScreenId(entity.getMetaClass()); } WindowManager.OpenType screenOpenType = WindowManager.OpenType.THIS_TAB; if (column.getXmlDescriptor() != null) { String openTypeAttribute = column.getXmlDescriptor().attributeValue("linkScreenOpenType"); if (StringUtils.isNotEmpty(openTypeAttribute)) { screenOpenType = WindowManager.OpenType.valueOf(openTypeAttribute); } } Window.Editor editor = wm.openEditor(windowConfig.getWindowInfo(windowAlias), entity, screenOpenType); editor.addCloseListener(actionId -> { // move focus to component table.focus(); if (Window.COMMIT_ACTION_ID.equals(actionId)) { Entity editorItem = editor.getItem(); handleEditorCommit(editorItem, rowItem, columnId); } }); }
From source file:de.jcup.egradle.core.process.EGradleShellType.java
public List<String> createCheckStandaloneCommands() { List<String> shellExecParams = buildShellAndOptions(); if (StringUtils.isNotEmpty(executionCheck)) { shellExecParams.add(executionCheck); }/* ww w. j av a2 s. c om*/ return shellExecParams; }
From source file:io.wcm.handler.url.impl.modes.UrlConfig.java
/** * @return true if site url for author is set *//*from ww w .j a v a 2 s. com*/ public boolean hasSiteUrlAuthor() { return StringUtils.isNotEmpty(this.siteUrlAuthor); }
From source file:com.nts.alphamale.data.ElementInfo.java
/*** * ? Element ? // w w w . j a v a2 s. co m * @return */ public boolean isIdentified() { if (StringUtils.isEmpty(instance)) { instance = "0"; } if (StringUtils.isNotEmpty(text) || (StringUtils.isNotEmpty(className) && (Integer.valueOf(instance) != 0)) || StringUtils.isNotEmpty(contentDesc) || StringUtils.isNotEmpty(resourceId)) { return true; } return false; }
From source file:com.adobe.acs.commons.mcp.impl.processes.asset.NameUtil.java
static String createValidDamPath(String path) { if (StringUtils.isNotEmpty(path)) { path = Arrays.asList(StringUtils.split(path, PATH_SEPARATOR)).stream() .map(name -> name.matches(VALID_NAME_REGEXP) ? name : NameUtil.createValidDamName(name)) .collect(Collectors.joining(PATH_SEPARATOR)); if (!path.startsWith(PATH_SEPARATOR)) { path = PATH_SEPARATOR + path; }//from w w w . j a v a2s. c om } return path; }
From source file:com.bellman.bible.android.view.activity.search.SearchIndex.java
private Book getDocumentToIndex() { String documentInitials = getIntent().getStringExtra(SearchControl.SEARCH_DOCUMENT); Book documentToIndex = null;// w ww . j a v a 2s.c o m if (StringUtils.isNotEmpty(documentInitials)) { documentToIndex = SwordDocumentFacade.getInstance().getDocumentByInitials(documentInitials); } else { documentToIndex = ControlFactory.getInstance().getCurrentPageControl().getCurrentPage() .getCurrentDocument(); } return documentToIndex; }
From source file:com.funtl.framework.smoke.core.modules.act.rest.editor.model.ModelEditorJsonRestResource.java
@RequiresPermissions("act:model:edit") @RequestMapping(value = "/act/service/model/{modelId}/json", method = RequestMethod.GET, produces = "application/json") public ObjectNode getEditorJson(@PathVariable String modelId) { ObjectNode modelNode = null;/*from w w w . j ava 2 s . c o m*/ Model model = repositoryService.getModel(modelId); if (model != null) { try { if (StringUtils.isNotEmpty(model.getMetaInfo())) { modelNode = (ObjectNode) objectMapper.readTree(model.getMetaInfo()); } else { modelNode = objectMapper.createObjectNode(); modelNode.put(MODEL_NAME, model.getName()); } modelNode.put(MODEL_ID, model.getId()); ObjectNode editorJsonNode = (ObjectNode) objectMapper .readTree(new String(repositoryService.getModelEditorSource(model.getId()), "utf-8")); modelNode.set("model", editorJsonNode); // modelNode.put("model", editorJsonNode); // - 2016-09-03 by Lusifer } catch (Exception e) { LOGGER.error("Error creating model JSON", e); throw new ActivitiException("Error creating model JSON", e); } } return modelNode; }
From source file:monasca.log.api.model.Log.java
public Log setApplicationType(final String applicationType) { if (StringUtils.isNotEmpty(applicationType)) { this.put(KEY_APPLICATION_TYPE, applicationType); }//from w w w . jav a 2 s . c o m return this; }
From source file:cherry.foundation.testtool.invoker.InvokerImpl.java
@Override public String invoke(String beanName, Class<?> beanClass, Method method, List<String> args, List<String> argTypes) { try {//from w w w . ja va2s . co m Object targetBean; if (StringUtils.isEmpty(beanName)) { targetBean = appCtx.getBean(beanClass); } else { targetBean = appCtx.getBean(beanName, beanClass); } Type[] paramType = method.getGenericParameterTypes(); Object[] param = new Object[paramType.length]; for (int i = 0; i < paramType.length; i++) { String arg = getOrNull(args, i); String argType = getOrNull(argTypes, i); JavaType javaType; if (StringUtils.isNotEmpty(argType)) { javaType = objectMapper.getTypeFactory().constructFromCanonical(argType); } else { javaType = objectMapper.getTypeFactory().constructType(paramType[i]); } param[i] = resolve(arg, javaType); } Object result = method.invoke(targetBean, param); return convert(result); } catch (InvocationTargetException | IllegalAccessException | IOException ex) { throw new IllegalStateException(ex); } }