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


Java StringUtils.isNotBlank方法代码示例

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


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

示例1: dashboardInfo

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public Map<String, Object> dashboardInfo() {

	int jobInfoCount = xxlJobInfoDao.findAllCount();
	int jobLogCount = xxlJobLogDao.triggerCountByHandleCode(-1);
	int jobLogSuccessCount = xxlJobLogDao.triggerCountByHandleCode(ReturnT.SUCCESS_CODE);

	// executor count
	Set<String> executerAddressSet = new HashSet<String>();
	List<XxlJobGroup> groupList = xxlJobGroupDao.findAll();
	if (CollectionUtils.isNotEmpty(groupList)) {
		for (XxlJobGroup group: groupList) {
			List<String> registryList = null;
			if (group.getAddressType() == 0) {
				registryList = JobRegistryMonitorHelper.discover(RegistryConfig.RegistType.EXECUTOR.name(), group.getAppName());
			} else {
				if (StringUtils.isNotBlank(group.getAddressList())) {
					registryList = Arrays.asList(group.getAddressList().split(","));
				}
			}
			if (CollectionUtils.isNotEmpty(registryList)) {
				executerAddressSet.addAll(registryList);
			}
		}
	}
	int executorCount = executerAddressSet.size();

	Map<String, Object> dashboardMap = new HashMap<String, Object>();
	dashboardMap.put("jobInfoCount", jobInfoCount);
	dashboardMap.put("jobLogCount", jobLogCount);
	dashboardMap.put("jobLogSuccessCount", jobLogSuccessCount);
	dashboardMap.put("executorCount", executorCount);
	return dashboardMap;
}
 
开发者ID:kevinKaiF,项目名称:xxl-job,代码行数:35,代码来源:XxlJobServiceImpl.java

示例2: generatorSpringCloud

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@RequestMapping(value = "/springcloud", method = RequestMethod.GET)
public void generatorSpringCloud(HttpServletResponse response,
                                 @RequestParam(value = "id") Integer id,
                                 @RequestParam(value = "type", defaultValue = "java") String type,
                                 @RequestParam(value = "project", defaultValue = "demo") String project,
                                 @RequestParam(value = "packagePath", defaultValue = "com.example") String packagePath,
                                 @RequestParam(value = "tbls", required = false) List<String> tbls,
                                 @RequestParam(value = "mutilProject", defaultValue = "false") boolean mutilProject,
                                 @RequestParam(value = "swagger", defaultValue = "false") boolean swagger,
                                 @RequestParam(value = "commonPackagePath", required = false) String commonPackagePath,
                                 @RequestParam(value = "language", defaultValue = "java") String language) throws Exception {

    Datasource db = datasourceService.findOne(id);
    AbstractGenerator generator;

    //springcloud暂时只支持 java不支持其他语言
    if (StringUtils.isNotBlank(commonPackagePath)) {
        generator = new SpringCloudBaseGeneratorMybatis(db.getJdbcUrl(), db.getUsername(), db.getPassword(), db.getDriver(), project, packagePath, tbls, commonPackagePath, mutilProject, swagger);
    } else {
        generator = new SpringCloudNoBaseGeneratorMybatis(db.getJdbcUrl(), db.getUsername(), db.getPassword(), db.getDriver(), project, packagePath, tbls, mutilProject, swagger);
    }

    download(response, generator, project);

}
 
开发者ID:wu191287278,项目名称:sc-generator,代码行数:26,代码来源:GeneratorController.java

示例3: parse

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public RowDefinition parse(Element element) {
	RowDefinition row=new RowDefinition();
	row.setRowNumber(Integer.valueOf(element.attributeValue("row-number")));
	String height=element.attributeValue("height");
	if(StringUtils.isNotBlank(height)){
		row.setHeight(Integer.valueOf(height));
	}
	String band=element.attributeValue("band");
	if(StringUtils.isNotBlank(band)){
		row.setBand(Band.valueOf(band));
	}
	return row;
}
 
开发者ID:youseries,项目名称:ureport,代码行数:15,代码来源:RowParser.java

示例4: parseDiagram

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
protected NodeDiagram parseDiagram(Element element){
	NodeDiagram diagram=new NodeDiagram();
	String g=element.attributeValue("g");
	String name=element.attributeValue("name");
	String label=element.attributeValue("label");
	diagram.setLabel(label);			
	diagram.setName(name);
	if(StringUtils.isNotBlank(g)){
		String[] info=g.split(",");
		if(info.length!=4){
			throw new IllegalArgumentException("Node "+element.attributeValue("name")+" diagram info is invalide!");
		}
		diagram.setX(Integer.valueOf(info[0]));
		diagram.setY(Integer.valueOf(info[1]));
		diagram.setWidth(Integer.valueOf(info[2]));
		diagram.setHeight(Integer.valueOf(info[3]));			
	}
	String x=element.attributeValue("x");
	String y=element.attributeValue("y");
	String width=element.attributeValue("width");
	String height=element.attributeValue("height");
	if(StringUtils.isNotBlank(x)){
		diagram.setX(Integer.valueOf(x));
	}
	if(StringUtils.isNotBlank(y)){
		diagram.setY(Integer.valueOf(y));
	}
	if(StringUtils.isNotBlank(width)){
		diagram.setWidth(Integer.valueOf(width));
	}
	if(StringUtils.isNotBlank(height)){
		diagram.setHeight(Integer.valueOf(height));
	}
	return diagram;
}
 
开发者ID:youseries,项目名称:uflo,代码行数:36,代码来源:AbstractParser.java

示例5: getTitle

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private String getTitle() {
	StringBuffer title=new StringBuffer(Messages.EXPRESSION_EDITOR_TITLE);
	if(StringUtils.isNotBlank(windowTitleSuffix)){
		title.append(Constants.SPACE);
		title.append(Constants.DASH);
		title.append(Constants.SPACE);
		title.append(windowTitleSuffix);
	}
	return title.toString();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:ExpressionEditorDialog.java

示例6: split

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private static String[] split(String field, String reg) {
    String[] result = null;
    if (StringUtils.isNotBlank(field)) {
        String[] arr = field.split(reg, 2);
        result = new String[2];
        result[0] = arr[0].trim();
        if (arr.length == 2) {
            result[1] = arr[1].trim();
        } else {
            result[1] = "";
        }
    }
    return result;
}
 
开发者ID:alibaba,项目名称:Dragonfly,代码行数:15,代码来源:HttpClientUtil.java

示例7: validatePropertyMap

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private boolean validatePropertyMap(Map<String, String> additionalParam, String propertyName) {
	if(!additionalParam.containsKey(Constants.ADDITIONAL_DB_CHUNK_SIZE) &&
			(additionalParam.containsKey(Constants.NUMBER_OF_PARTITIONS) || 
			additionalParam.containsKey(Constants.ADDITIONAL_DB_FETCH_SIZE) ||
			additionalParam.containsKey(Constants.ADDITIONAL_PARAMETERS_FOR_DB))){//input
		
		if(StringUtils.isNotBlank(additionalParam.get(Constants.NUMBER_OF_PARTITIONS))){
			if((validatePopertyFields(additionalParam, propertyName, propertyName))	
				&& (additionalParam.containsKey(Constants.ADDITIONAL_DB_FETCH_SIZE) &&
						validateFetchSizeField(additionalParam, propertyName, propertyName)) 
				&& validateAdditionalParam(additionalParam, propertyName, propertyName)){
				return true;
			}
		}else if((additionalParam.containsKey(Constants.ADDITIONAL_DB_FETCH_SIZE) &&
				validateFetchSizeField(additionalParam, propertyName, propertyName)) 
		&& validateAdditionalParam(additionalParam, propertyName, propertyName)){
			return true;
		}
		
		
	}else if(additionalParam.containsKey(Constants.ADDITIONAL_DB_CHUNK_SIZE) || 
			additionalParam.containsKey(Constants.ADDITIONAL_PARAMETERS_FOR_DB)){//output
		if(validateChunkSize(additionalParam, propertyName, propertyName) &&
				validateAdditionalParam(additionalParam, propertyName, propertyName)){
			return true;
		}
	}
	return false;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:30,代码来源:AdditionalParamDBValidationRule.java

示例8: setTemporaryDirectoryName

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private void setTemporaryDirectoryName(Sparkredshift redshiftOutput) {
	String temporaryDirectoryName =(String) properties.get(PropertyNameConstants.TEMPORARY_DIRECTORY_NAME.value());
	if (StringUtils.isNotBlank(temporaryDirectoryName)) {
		ElementValueStringType temps3Dir = new ElementValueStringType();
		temps3Dir.setValue(temporaryDirectoryName);
		redshiftOutput.setTemps3Dir(temps3Dir);
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:9,代码来源:OutputSparkRedshiftConverter.java

示例9: logMessage

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * 
 * log message
 * 
 * @param message
 */
public void logMessage(String message){
	for(AbstractJobLogger jobLogger: loggers){
		if(StringUtils.isNotBlank(message)){
			message = StringUtils.trim(message);
			jobLogger.log(message);
		}
		logger.debug("Logged message {} on {}", message, jobLogger.getClass().getName());
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:16,代码来源:JobLogger.java

示例10: getFieldNameModifyListener

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * Gets the field name modify listener.
 * 
 * @param tableViewer
 *            the table viewer
 * @param conditionsList
 *            the conditions list
 * @param fieldsAndTypes
 *            the fields and types
 * @param fieldNames
 *            the field names
 * @param saveButton
 *            the save button
 * @param displayButton
 *            the display button
 * @return the field name modify listener
 */
public ModifyListener getFieldNameModifyListener(final TableViewer tableViewer, final List<Condition> conditionsList,
		final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
	ModifyListener listener = new ModifyListener() {
		
		@Override
		public void modifyText(ModifyEvent e) {
			CCombo source = (CCombo) e.getSource();
			int index = (int) source.getData(FilterConstants.ROW_INDEX);
			Condition filterConditions = conditionsList.get(index);
			String fieldName = source.getText();
			filterConditions.setFieldName(fieldName);
			
			if(StringUtils.isNotBlank(fieldName)){
				String fieldType = fieldsAndTypes.get(fieldName);
				TableItem item = tableViewer.getTable().getItem(index);
				CCombo conditionalCombo = (CCombo) item.getData(FilterConditionsDialog.CONDITIONAL_OPERATORS);
				if(conditionalCombo != null && StringUtils.isNotBlank(fieldType)){
					conditionalCombo.setText(filterConditions.getConditionalOperator());
					conditionalCombo.setItems(FilterHelper.INSTANCE.getTypeBasedOperatorMap().get(fieldType));
					new AutoCompleteField(conditionalCombo, new CComboContentAdapter(), conditionalCombo.getItems());
				}
			}
			validateCombo(source);
			toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:46,代码来源:FilterHelper.java

示例11: buildMaterialModelList

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public Results buildMaterialModelList(Results results,
                                      SecureUserDetails sUser, Long domainId)
    throws ServiceException {
  List materials = results.getResults();
  List<MaterialModel> newInventory = new ArrayList<MaterialModel>(
      materials.size());
  int itemCount = results.getOffset() + 1;
  Map<Long, String> domainNames = new HashMap<>(1);
  UsersService as = null;
  as = Services.getService(UsersServiceImpl.class);
  for (Object material : materials) {
    MaterialModel item = buildMaterialModel((IMaterial) material,
        sUser, itemCount, domainNames);
    if (item != null) {
      if (as != null) {
        try {
          IUserAccount ua;
          if (StringUtils.isNotBlank(item.ludBy)) {
            ua = as.getUserAccount(item.ludBy);
            item.ludByn = ua.getFullName();
          } else if (StringUtils.isNotBlank(item.creBy)) {
            ua = as.getUserAccount(item.creBy);
            item.ludBy = ua.getUserId();
            item.ludByn = ua.getFullName();
          }
        } catch (ObjectNotFoundException e) {
          xLogger.warn("User {0} not found", item.ludBy);
        }
      }
      newInventory.add(item);
      itemCount++;
    }
  }
  return new Results(newInventory, results.getCursor(), results.getNumFound(),
      results.getOffset());
}
 
开发者ID:logistimo,项目名称:logistimo-web-service,代码行数:37,代码来源:MaterialBuilder.java

示例12: buildIndexBuilder

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
/**
 * builds Index builder
 */
private void buildIndexBuilder(Context context) {
    String indexBuilderClass = DEFAULT_ES_INDEX_BUILDER;
    if (StringUtils.isNotBlank(context.getString(ES_INDEX_BUILDER))) {
        indexBuilderClass = context.getString(ES_INDEX_BUILDER);
    }
    this.indexBuilder = instantiateClass(indexBuilderClass);
    if (this.indexBuilder != null) {
        this.indexBuilder.configure(context);
    }
}
 
开发者ID:cognitree,项目名称:flume-elasticsearch-sink,代码行数:14,代码来源:ElasticSearchSink.java

示例13: populateWidget

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private void populateWidget() {
	
	if(excelFormattingDataStructure !=null){
		List<ExcelConfigurationDataStructure> listOfExcelConfiguration2 = excelFormattingDataStructure.getListOfExcelConfiguration();
		if(listOfExcelConfiguration2 !=null && listOfExcelConfiguration2.size() >0 ){
			draggedFields.clear();
			for(ExcelConfigurationDataStructure excelConfigurationDataStructure :  listOfExcelConfiguration2){
				if(StringUtils.isNotBlank(excelConfigurationDataStructure.getFieldName())){
					draggedFields.add(excelConfigurationDataStructure.getFieldName());
				}
			}
			draggedFields.add(0, "Select");
			combo.setItems(convertToArray(draggedFields));
		}
		if(StringUtils.isNotBlank(excelFormattingDataStructure.getCopyOfField())){
			combo.setText(excelFormattingDataStructure.getCopyOfField());
		}
		if(listOfExcelConfiguration2 !=null){
			this.listOfExcelConfiguration.clear();
			ArrayList tmplist = (ArrayList)this.excelFormattingDataStructure.getListOfExcelConfiguration();
			this.listOfExcelConfiguration.addAll((ArrayList)tmplist.clone());
			targetTableViewer.setInput(listOfExcelConfiguration);
		}
	}
	
	highlightDropFields();
	enableDeleteButton();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:29,代码来源:ExcelFormattingDialog.java

示例14: isResetNeeded

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private boolean isResetNeeded(XPathGridRow xPathGridRow, String property) {
	if(XPathSchemaGridWidget.DATATYPE.equals(property) && StringUtils.isNotBlank(xPathGridRow.getDataTypeValue())){
		if(DataType.INTEGER_CLASS.equals(xPathGridRow.getDataTypeValue()) 
				||DataType.LONG_CLASS.equals(xPathGridRow.getDataTypeValue())
				||DataType.STRING_CLASS.equals(xPathGridRow.getDataTypeValue())
				||DataType.SHORT_CLASS.equals(xPathGridRow.getDataTypeValue())
				||DataType.BOOLEAN_CLASS.equals(xPathGridRow.getDataTypeValue())
				||DataType.FLOAT_CLASS.equals(xPathGridRow.getDataTypeValue())
				||DataType.DOUBLE_CLASS.equals(xPathGridRow.getDataTypeValue())
				||DataType.DATE_CLASS.equals(xPathGridRow.getDataTypeValue())){
			return true;
		}	
	}
	return false;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:16,代码来源:XPathSchemaGridCellModifier.java

示例15: getAssets

import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@RequestMapping(value = "/", method = RequestMethod.GET)
public
@ResponseBody
Results getAssets(@RequestParam(required = false) String q,
                  @RequestParam(required = false) Integer at,
                  @RequestParam(defaultValue = PageParams.DEFAULT_SIZE_STR) int size,
                  @RequestParam(defaultValue = PageParams.DEFAULT_OFFSET_STR) int offset,
                  HttpServletRequest request) {
  SecureUserDetails sUser = SecurityUtils.getUserDetails(request);
  Locale locale = sUser.getLocale();
  ResourceBundle backendMessages = Resources.get().getBundle("BackendMessages", locale);
  String timezone = sUser.getTimezone();
  AssetManagementService ams;
  Results assetResults;
  Navigator
      navigator =
      new Navigator(request.getSession(), "AssetController.getAssets", offset, size, "dummy", 0);
  PageParams pageParams = new PageParams(navigator.getCursor(offset), offset, size);
  long domainId = SessionMgr.getCurrentDomain(request.getSession(), sUser.getUsername());
  try {
    if (StringUtils.isNotBlank(q)) {
      q = AssetUtil.decodeURLParameters(q);
      assetResults = SearchUtil.findAssets(domainId, q, pageParams);
      assetResults.setNumFound(-1);
    } else {
      ams = Services.getService(AssetManagementServiceImpl.class, locale);
      assetResults = ams.getAssetsByDomain(domainId, at, pageParams);
    }
    assetResults.setOffset(offset);
    navigator.setResultParams(assetResults);
  } catch (Exception e) {
    xLogger.severe("Error while getting asset for the domain {0}", domainId, e);
    throw new InvalidServiceException(
        backendMessages.getString("asset.detail.fetch.domain.error"));
  }
  return assetBuilder.buildAssetResults(assetResults, locale, timezone);
}
 
开发者ID:logistimo,项目名称:logistimo-web-service,代码行数:38,代码来源:AssetController.java


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