当前位置: 首页>>代码示例>>Java>>正文


Java StringUtils.isNotEmpty方法代码示例

本文整理汇总了Java中org.apache.commons.lang.StringUtils.isNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.isNotEmpty方法的具体用法?Java StringUtils.isNotEmpty怎么用?Java StringUtils.isNotEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.lang.StringUtils的用法示例。


在下文中一共展示了StringUtils.isNotEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addAtlasProxyClazz

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public static void addAtlasProxyClazz(Document document, Set<String> nonProxyChannels,  Result result) {

        Element root = document.getRootElement();// Get the root node

        List<? extends Node> serviceNodes = root.selectNodes("//@android:process");

        String packageName = root.attribute("package").getStringValue();

        Set<String> processNames = new HashSet<>();
        processNames.add(packageName);

        for (Node node : serviceNodes) {
            if (null != node && StringUtils.isNotEmpty(node.getStringValue())) {
                String value = node.getStringValue();
                processNames.add(value);
            }
        }

        processNames.removeAll(nonProxyChannels);

        List<String> elementNames = Lists.newArrayList("activity", "service", "provider");

        Element applicationElement = root.element("application");

        for (String processName : processNames) {

            boolean isMainPkg = packageName.equals(processName);
            //boolean isMainPkg = true;
            String processClazzName = processName.replace(":", "").replace(".", "_");

            for (String elementName : elementNames) {

                String fullClazzName = "ATLASPROXY_" +  (isMainPkg ? "" : (packageName.replace(".", "_") + "_" )) +  processClazzName + "_" + StringUtils.capitalize(elementName);

                if ("activity".equals(elementName)) {
                    result.proxyActivities.add(fullClazzName);
                } else if ("service".equals(elementName)) {
                    result.proxyServices.add(fullClazzName);
                } else {
                    result.proxyProviders.add(fullClazzName);
                }

                Element newElement = applicationElement.addElement(elementName);
                newElement.addAttribute("android:name", ATLAS_PROXY_PACKAGE + "." + fullClazzName);

                if (!packageName.equals(processName)) {
                    newElement.addAttribute("android:process", processName);
                }

                boolean isProvider = "provider".equals(elementName);
                if (isProvider) {
                    newElement.addAttribute("android:authorities",
                                            ATLAS_PROXY_PACKAGE + "." + fullClazzName);
                }

            }

        }

    }
 
开发者ID:alibaba,项目名称:atlas,代码行数:61,代码来源:AtlasProxy.java

示例2: validateData

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
GlobalConfigDataForSonarInstance validateData(GlobalConfigDataForSonarInstance globalConfigDataForSonarInstance) {

        if (StringUtils.isNotEmpty(globalConfigDataForSonarInstance.getToken())) {
            return new GlobalConfigDataForSonarInstance(
                    globalConfigDataForSonarInstance.getName(),
                    validateUrl(globalConfigDataForSonarInstance),
                    globalConfigDataForSonarInstance.getToken(),
                    globalConfigDataForSonarInstance.getTimeToWait());
        } else {
            return new GlobalConfigDataForSonarInstance(
                    globalConfigDataForSonarInstance.getName(),
                    validateUrl(globalConfigDataForSonarInstance),
                    validateUsername(globalConfigDataForSonarInstance),
                    validatePassword(globalConfigDataForSonarInstance),
                    globalConfigDataForSonarInstance.getTimeToWait());
        }
    }
 
开发者ID:jenkinsci,项目名称:sonar-quality-gates-plugin,代码行数:18,代码来源:SonarInstanceValidationService.java

示例3: build

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public void build(Object control, ViewComponent parentViewComponent) {
	Label label = (Label) control;
	String id = label.getId();
	ViewComponent component = null;
	if (StringUtils.isNotEmpty(id)) {
		component = this.generateViewComponent(id,  Label.class);
		if (StringUtils.isEmpty(label.getText())) {
			component.setDesc(label.getText());
		}
	}else if (StringUtils.isEmpty(label.getText())) {
		component = this.generateViewComponent(label.getText(),Label.class);
	}
	if(component!=null){
		if(StringUtils.isEmpty(component.getId())){
			component.setEnabled(false);
		}
		parentViewComponent.addChildren(component);			
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:20,代码来源:LabelBuilder.java

示例4: filter

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public void filter(String processDefinitionId, String taskName, Component component) throws Exception {
	TabControl tabControl = (TabControl) component;

	Set<String> componentSignature = new HashSet<String>();
	for (Tab tab : tabControl.getTabs()) {
		String tags = tab.getTags();
		if (StringUtils.isNotEmpty(tags)) {
			componentSignature.addAll(Arrays.asList(tags.split(",")));
		}
		for (String token : new String[] { tab.getName(), tab.getName() }) {
			if (StringUtils.isNotEmpty(token)) {
				componentSignature.add(token);
			}
		}
		int authority = securityCheck.checkComponent(processDefinitionId, taskName, componentSignature);
		if (authority == ComponentFilter.INVISIBLE) {
			tab.setIgnored(true);
		} else if (authority > 0) {
			tab.setDisabled(authority == ComponentFilter.READONLY);
		}
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:23,代码来源:TabControlFilter.java

示例5: createGraph

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public Graph createGraph() throws InterruptedException {
    Graph newGraph;
    if (this.cassandraEnabled) {
        Builder titanBuilder = TitanFactory.build().set("storage.backend", "cassandra")
                .set("storage.cassandra.keyspace", this.cassandraKeyspace)
                .set("storage.hostname", Arrays.asList(hostname.split(","))).set("storage.port", this.port)
                .set("cache.db-cache", this.cacheEnabled).set("cache.db-cache-clean-wait", this.titanCacheCleanWait)
                .set("cache.db-cache-time", this.titanCacheTime).set("cache.db-cache-size", this.titanCacheSize);
        if (StringUtils.isNotEmpty(this.username)) {
            titanBuilder = titanBuilder.set("storage.username", this.username);
        }
        if (StringUtils.isNotEmpty(this.password)) {
            titanBuilder = titanBuilder.set("storage.password", this.password);
        }
        newGraph = titanBuilder.open();
    } else {
        newGraph = TitanFactory.build().set("storage.backend", "inmemory").open();
    }
    createSchemaElements(newGraph);
    LOGGER.info("Initialized titan db.");
    return newGraph;
}
 
开发者ID:eclipse,项目名称:keti,代码行数:23,代码来源:GraphConfig.java

示例6: getSelectedJobDetails

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private JobDetails getSelectedJobDetails(String consoleName, Map<String, List<JobDetails>> jobDetails,
		String selectedUniqueJobId) {
	JobDetails selectedJob = null;
	for (Map.Entry<String, List<JobDetails>> entry : jobDetails.entrySet()) {
		if (consoleName.equalsIgnoreCase(entry.getKey())) {
			List<JobDetails> jobList = entry.getValue();
			for (JobDetails jobDetail : jobList) {
				if (StringUtils.isNotEmpty(selectedUniqueJobId)
						&& jobDetail.getUniqueJobID().equalsIgnoreCase(selectedUniqueJobId)) {
					selectedJob = jobDetail;
					break;
				}
			}
		}
	}
	return selectedJob;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:WatchRecordAction.java

示例7: getLocFilterSubQuery

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private String getLocFilterSubQuery(LocationSuggestionModel parentLocation) {
  StringBuilder filterQuery = new StringBuilder();
  if (parentLocation != null) {
      if (StringUtils.isNotEmpty(parentLocation.state)) {
          filterQuery.append(" AND STATE ")
              .append(CharacterConstants.EQUALS).append(CharacterConstants.S_QUOTE)
              .append(parentLocation.state).append(CharacterConstants.S_QUOTE).append(CharacterConstants.SPACE);
      }
      if (StringUtils.isNotEmpty(parentLocation.district)) {
          filterQuery.append(" AND DISTRICT ")
              .append(CharacterConstants.EQUALS).append(CharacterConstants.S_QUOTE)
              .append(parentLocation.district).append(CharacterConstants.S_QUOTE).append(CharacterConstants.SPACE);
      }
  }
  return filterQuery.toString();
}
 
开发者ID:logistimo,项目名称:logistimo-web-service,代码行数:17,代码来源:EntitiesServiceImpl.java

示例8: getDataGridColumns

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * 获取系统默认DataGrid的所有列,包括ColumnGroup中的多有列到Map对象中
 * 
 * @param topColumns
 * @param groupColumns
 */
private void getDataGridColumns(List<Column> topColumns, Map<String, Column> groupColumns) {

	for (Column column : topColumns) {
		if (column instanceof ColumnGroup) {
			this.getDataGridColumns(((ColumnGroup) column).getColumns(), groupColumns);
		}
		String name = column.getName();
		if (StringUtils.isNotEmpty(name)) {
			groupColumns.put(column.getName(), column);
		}
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:19,代码来源:DataGridProfileFilter.java

示例9: ClientSelector

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
public ClientSelector(String servers, int loadBalance, ConnectionValidator validator, GenericKeyedObjectPoolConfig poolConfig, FailoverStrategy strategy, int connTimeout, String backupServers, int serviceLevel) {
   	this.failoverChecker = new FailoverChecker(validator, strategy, serviceLevel);
   	this.poolProvider = new DefaultThriftConnectionPool(new ThriftConnectionFactory(failoverChecker, connTimeout), poolConfig);
   	failoverChecker.setConnectionPool(poolProvider);
   	failoverChecker.setServerList(ThriftServer.parse(servers));
       if (StringUtils.isNotEmpty(backupServers)) {
       	failoverChecker.setBackupServerList(ThriftServer.parse(backupServers));
       } else{
       	failoverChecker.setBackupServerList(new ArrayList<ThriftServer>());
       }
       failoverChecker.startChecking();
   }
 
开发者ID:cyfonly,项目名称:ThriftJ,代码行数:14,代码来源:ClientSelector.java

示例10: prepareFiltersByRegion

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private void prepareFiltersByRegion(Long domainId, QueryRequestModel model) {
  try {
    DomainConfig dc = DomainConfig.getInstance(domainId);
    if (StringUtils.isNotEmpty(dc.getCountry())) {
      if (StringUtils.isNotEmpty(dc.getState())) {
        if (StringUtils.isNotEmpty(dc.getDistrict())) {
          model.filters.put(QueryHelper.TOKEN_LOCATION, QueryHelper.LOCATION_TALUK);
          model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_TALUK, null);
          model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_DISTRICT, null);
          model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_STATE, null);
          model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_COUNTRY, null);
        } else {
          model.filters.put(QueryHelper.TOKEN_LOCATION, QueryHelper.LOCATION_DISTRICT);
          model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_DISTRICT, null);
          model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_STATE, null);
          model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_COUNTRY, null);
        }
      } else {
        model.filters.put(QueryHelper.TOKEN_LOCATION, QueryHelper.LOCATION_STATE);
        model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_STATE, null);
        model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_COUNTRY, null);
      }
    } else {
      model.filters.put(QueryHelper.TOKEN_LOCATION, QueryHelper.LOCATION_COUNTRY);
      model.filters.put(QueryHelper.TOKEN + QueryHelper.QUERY_COUNTRY, null);
    }
  } catch (Exception e) {
    xLogger.warn("Exception in replacing location token", e);
  }
}
 
开发者ID:logistimo,项目名称:logistimo-web-service,代码行数:31,代码来源:ReportPluginService.java

示例11: findKalturaPlayerJSURL

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * Finds the correct JS player to use
 * @param playerId [OPTIONAL] the numeric id of the kaltura player
 * @return the HTML5 JS player for a given player or null if the player is not enabled. If for some reason the player id is
 * also null, then we return null.
 */
protected String findKalturaPlayerJSURL(String playerId) {
    String playerJSURL = null; // should be null if not enabled or the player id is null.
    if (this.kalturaHtml5PlayerEnabled && StringUtils.isNotEmpty(playerId)) {
        int partnerId = this.getKalturaConfig().getPartnerId();
        // Use the URL provided if there was a property override set
        if (StringUtils.isNotEmpty(this.kalturaHtml5PlayerJS)) {
            playerJSURL = this.kalturaHtml5PlayerJS;
        } else {
            // build custom JS url: {KALTURA HOST}/p/{PARTNER_ID}/sp/{PARTNER_ID}00/embedIframeJs/uiconf_id/{PLAYER_ID}/partner_id/{PARTNER_ID}
            playerJSURL = this.getKalturaConfig().getEndpoint()+"/p/"+partnerId+"/sp/"+partnerId+"00/embedIframeJs/uiconf_id/"+playerId+"/partner_id/"+partnerId;
        }
    }
    return playerJSURL;
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:21,代码来源:KalturaAPIService.java

示例12: needAlarm

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * 验证接口和ip是否符合上下线报警规则
 * @param interfaceName
 * @param ip
 * @return
 */
public boolean needAlarm(String interfaceName, String ip) {
    List<IfaceAlarm> list = ifaceAlarmRuleMap.get(interfaceName);
    if (list != null) {
        for (IfaceAlarm alarm : list) {
            if (StringUtils.isNotEmpty(alarm.getAlarmIp()) && isIpMatch(GenerateRegular.getIpRegularList(alarm.getAlarmIp()), ip)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:tiglabs,项目名称:jsf-core,代码行数:18,代码来源:ScanNodeStatusHelper.java

示例13: getFormElementLabel

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private String getFormElementLabel(FormElement element, Map<String, PropertyDef> dataTypePropertyDefs) {
	String property = element.getProperty();
	if (StringUtils.isNotEmpty(property) && dataTypePropertyDefs != null) {
		PropertyDef pd = dataTypePropertyDefs.get(property);
		if (pd != null && StringUtils.isNotEmpty(pd.getLabel())) {
			return pd.getLabel();
		}
	}
	return property;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:11,代码来源:FormElementBuilder.java

示例14: loadOperatorDocumentation

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
	 * This is the method for loading an operator's documentation within the program.
	 */
	public static String loadOperatorDocumentation(final boolean online, final boolean activateCache,
			final OperatorDescription dirtyOpDesc) {
		String toShowText;
		OperatorDescription opDesc = dirtyOpDesc;
		if (opDesc == null) {
			// TODO: Eliminate this case
			toShowText = ERROR_TEXT_FOR_WIKI;
		} else {
			if (activateCache && OPERATOR_CACHE_MAP.containsKey(opDesc)) {
				return OPERATOR_CACHE_MAP.get(opDesc);
			} else {
				try {
//					if (online) {
//						toShowText = loadSelectedOperatorDocuFromWiki(opDesc);
//					} else {
//						toShowText = loadSelectedOperatorDocuLocally(opDesc);
//					}
                    toShowText = loadSelectedOperatorDocuLocally(opDesc);
				} catch (Exception e) {
					SwingTools.showFinalErrorMessage("rapid_doc_bot_importer_showInBrowser", e, true,
							new Object[] { e.getMessage() });
					toShowText = ERROR_TEXT_FOR_WIKI;
				}
				if (activateCache && StringUtils.isNotBlank(toShowText) && StringUtils.isNotEmpty(toShowText)) {
					OPERATOR_CACHE_MAP.put(opDesc, toShowText);
				}
			}
		}
		return toShowText;
	}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:34,代码来源:OperatorDocLoader.java

示例15: addAdditionalParameterMapValues

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private void addAdditionalParameterMapValues() {

		if (additionalParameterValue != null && !additionalParameterValue.isEmpty()) {
			if (additionalParameterValue.get(Constants.NUMBER_OF_PARTITIONS) != null 
					&& StringUtils.isNotEmpty((String)additionalParameterValue.get(Constants.NUMBER_OF_PARTITIONS))) {
				noOfPartitionsTextBox.setText(additionalParameterValue.get(Constants.NUMBER_OF_PARTITIONS).toString());
				Utils.INSTANCE.addMouseMoveListener(noOfPartitionsTextBox, cursor);	
				if (additionalParameterValue.get(Constants.NOP_LOWER_BOUND) != null 
						&& StringUtils.isNotEmpty((String) additionalParameterValue.get(Constants.NOP_LOWER_BOUND))) {
					partitionKeyLowerBoundTextBox.setText(additionalParameterValue.get(Constants.NOP_LOWER_BOUND).toString());
					Utils.INSTANCE.addMouseMoveListener(partitionKeyLowerBoundTextBox, cursor);
					partitionKeyLowerBoundControlDecoration.hide();
				} else {
					partitionKeyLowerBoundControlDecoration.show();
				}
				if (additionalParameterValue.get(Constants.NOP_UPPER_BOUND) != null 
						&& StringUtils.isNotEmpty((String) additionalParameterValue.get(Constants.NOP_UPPER_BOUND))) {
					partitionKeyUpperBoundTextBox
							.setText(additionalParameterValue.get(Constants.NOP_UPPER_BOUND).toString());
					Utils.INSTANCE.addMouseMoveListener(partitionKeyUpperBoundTextBox, cursor);
					partitionKeyUpperBoundControlDecoration.hide();
				} else {
					partitionKeyUpperBoundControlDecoration.show();
				}
			}else{
				partitionKeyLowerBoundControlDecoration.hide();
				partitionKeyUpperBoundControlDecoration.hide();
			}
			fetchSizeTextBox.setText((String) additionalParameterValue.get(Constants.ADDITIONAL_DB_FETCH_SIZE));
			Utils.INSTANCE.addMouseMoveListener(fetchSizeTextBox, cursor);

			if (StringUtils.isNotBlank((String) additionalParameterValue.get(Constants.ADDITIONAL_PARAMETERS_FOR_DB))) {
				additionalParameterTextBox
						.setText((String) additionalParameterValue.get(Constants.ADDITIONAL_PARAMETERS_FOR_DB));
				Utils.INSTANCE.addMouseMoveListener(additionalParameterTextBox, cursor);
			}
		}

	}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:40,代码来源:InputAdditionalParametersDialog.java


注:本文中的org.apache.commons.lang.StringUtils.isNotEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。