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


Java StringUtil类代码示例

本文整理汇总了Java中com.liferay.portal.kernel.util.StringUtil的典型用法代码示例。如果您正苦于以下问题:Java StringUtil类的具体用法?Java StringUtil怎么用?Java StringUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getBooleanClauseOccurs

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
public static List<BooleanClauseOccur> getBooleanClauseOccurs(
		String pattern, List<String> subQueries) {
	List<BooleanClauseOccur> booleanClauseOccurs = new ArrayList<BooleanClauseOccur>();
	pattern = pattern.replaceAll(Pattern.quote("("), StringPool.BLANK);

	pattern = pattern.replaceAll("\\)", StringPool.BLANK);

	pattern = pattern.replaceAll(StringPool.SPACE, StringPool.BLANK);
	for (String subQuery : subQueries) {
		subQuery = subQuery.replaceAll(StringPool.SPACE, StringPool.BLANK);
		pattern = pattern.replace(subQuery, StringPool.BLANK);
	}

	pattern = pattern.replaceAll("\\]\\[", StringPool.COMMA);

	pattern = pattern.replaceAll("\\[", StringPool.BLANK);

	pattern = pattern.replaceAll("\\]", StringPool.BLANK);

	String[] conditions = StringUtil.split(pattern);

	if (conditions != null && conditions.length > 0) {
		for (int c = 0; c < conditions.length; c++) {
			if (conditions[c].equalsIgnoreCase("and")) {
				booleanClauseOccurs.add(BooleanClauseOccur.MUST);
			} else if (conditions[c].equalsIgnoreCase("or")) {
				booleanClauseOccurs.add(BooleanClauseOccur.SHOULD);
			} else if (conditions[c].equalsIgnoreCase("not")) {
				booleanClauseOccurs.add(BooleanClauseOccur.MUST_NOT);
			}
		}
	}

	return booleanClauseOccurs;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:36,代码来源:DeliverableLocalServiceImpl.java

示例2: getTargetFolder

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
public static DLFolder getTargetFolder(
	long groupId, long parentFolderId, String destination) {

	DLFolder dlFolder = null;

	String[] folderNames =
		StringUtil.split(destination, StringPool.FORWARD_SLASH);

	if (folderNames != null && folderNames.length > 0) {
		String name = folderNames[0];
		dlFolder = getFolder(groupId, parentFolderId, name);
		folderNames = ArrayUtil.remove(folderNames, name);
		if (folderNames.length > 0) {
			dlFolder = getTargetFolder(
				groupId, dlFolder.getFolderId(),
				StringUtil.merge(folderNames, StringPool.FORWARD_SLASH));
		}

	}

	return dlFolder;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:23,代码来源:DLFolderUtil.java

示例3: getMessagePayment

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * Get payment message
 * 
 * @param pattern
 * @return
 */
public static List<String> getMessagePayment(String pattern) {

	List<String> msgPayments = new ArrayList<String>();
	try {
		pattern = pattern.substring(pattern.indexOf(PAY_MESSAGE), pattern.lastIndexOf(PAY_MESSAGE) + 1);

		String[] splitPattern = StringUtil.split(pattern, PAY_MESSAGE);

		for (String element : splitPattern) {
			if (!element.trim().contentEquals("")) {
				msgPayments.add(StringUtil.trimLeading(element));
			}
		}
	} catch (Exception e) {

	}

	return msgPayments;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:26,代码来源:DossierPaymentUtils.java

示例4: _checkcontains

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * @param pattern
 * @param content
 * @return
 */
private static boolean _checkcontains(String pattern, String content) {

	boolean isContains = false;

	String[] splitPattern = StringUtil.split(pattern, StringPool.SPACE);

	for (String element : splitPattern) {
		if (Validator.equals(element, content)) {
			isContains = true;
			break;

		}
	}

	return isContains;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:22,代码来源:DossierPaymentUtils.java

示例5: getMappingTables

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
public List<String> getMappingTables() {
	List<String> mappingTablesFields =
		ReflectionUtil.getLiferayModelImplMappingTablesFields(
			getLiferayModelImplClass());

	List<String> mappingTables = new ArrayList<String>(
		mappingTablesFields.size());

	for (String mappingTablesField : mappingTablesFields) {
		String mappingTable = StringUtil.replaceFirst(
			mappingTablesField, "MAPPING_TABLE_", StringPool.BLANK);

		mappingTable = StringUtil.replace(
			mappingTable, "_NAME", StringPool.BLANK);

		mappingTable = StringUtil.toLowerCase(mappingTable);

		mappingTables.add(mappingTable);
	}

	return mappingTables;
}
 
开发者ID:jorgediaz-lr,项目名称:servicebuilder-reflection,代码行数:23,代码来源:ServiceImpl.java

示例6: getTableInfo

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
public TableInfo getTableInfo(String mappingTable) {
	Class<?> classLiferayModelImpl = getLiferayModelImplClass();

	String fieldPrefix = "TABLE";

	if (mappingTable != null) {
		fieldPrefix =
			"MAPPING_TABLE_" + StringUtil.toUpperCase(mappingTable);
	}

	Object[][] attributesArr =
		(Object[][])ReflectionUtil.getStaticFieldValue(
			classLiferayModelImpl, fieldPrefix + "_COLUMNS");
	String name = (String)ReflectionUtil.getStaticFieldValue(
		classLiferayModelImpl, fieldPrefix + "_NAME");
	String sqlCreate = (String)ReflectionUtil.getStaticFieldValue(
		classLiferayModelImpl, fieldPrefix + "_SQL_CREATE");

	return new TableInfo(name, attributesArr, sqlCreate);
}
 
开发者ID:jorgediaz-lr,项目名称:servicebuilder-reflection,代码行数:21,代码来源:ServiceImpl.java

示例7: main

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
public static void main(String[] args) {
	String regex = "(\\w+)\\.trim\\(\\)";
	String str = "sd sdfeb sampleStr.trim();";

	Pattern pattern = Pattern.compile(regex);
	System.out.println(pattern.pattern());
	Matcher mather = pattern.matcher(str);

	String newStr = str;

	while (mather.find()) {
		String firstGroup = mather.group(1);
		newStr = StringUtil.replace(newStr, firstGroup, "StringUtil", mather.start());
		newStr = StringUtil.replace(newStr, "trim()", "trim(" + firstGroup + ")");
		System.out.print(newStr);
	}

}
 
开发者ID:bejondshao,项目名称:personal,代码行数:19,代码来源:ReplaceApp.java

示例8: afterPropertiesSet

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * Initializes the eb partner ship persistence.
 */
public void afterPropertiesSet() {
	String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
				com.liferay.util.service.ServiceProps.get(
					"value.object.listener.org.oep.core.dossiermgt.model.EbPartnerShip")));

	if (listenerClassNames.length > 0) {
		try {
			List<ModelListener<EbPartnerShip>> listenersList = new ArrayList<ModelListener<EbPartnerShip>>();

			for (String listenerClassName : listenerClassNames) {
				listenersList.add((ModelListener<EbPartnerShip>)InstanceFactory.newInstance(
						getClassLoader(), listenerClassName));
			}

			listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
		}
		catch (Exception e) {
			_log.error(e);
		}
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:25,代码来源:EbPartnerShipPersistenceImpl.java

示例9: afterPropertiesSet

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * Initializes the doc template persistence.
 */
public void afterPropertiesSet() {
	String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
				com.liferay.util.service.ServiceProps.get(
					"value.object.listener.org.oep.core.dossiermgt.model.DocTemplate")));

	if (listenerClassNames.length > 0) {
		try {
			List<ModelListener<DocTemplate>> listenersList = new ArrayList<ModelListener<DocTemplate>>();

			for (String listenerClassName : listenerClassNames) {
				listenersList.add((ModelListener<DocTemplate>)InstanceFactory.newInstance(
						getClassLoader(), listenerClassName));
			}

			listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
		}
		catch (Exception e) {
			_log.error(e);
		}
	}

	docTemplateToDossierDocTableMapper = TableMapperFactory.getTableMapper("oep_dossiermgt_dossierdoc2template",
			"docTemplateId", "dossierDocId", this, dossierDocPersistence);
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:28,代码来源:DocTemplatePersistenceImpl.java

示例10: afterPropertiesSet

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * Initializes the dossier proc agency persistence.
 */
public void afterPropertiesSet() {
	String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
				com.liferay.util.service.ServiceProps.get(
					"value.object.listener.org.oep.core.dossiermgt.model.DossierProcAgency")));

	if (listenerClassNames.length > 0) {
		try {
			List<ModelListener<DossierProcAgency>> listenersList = new ArrayList<ModelListener<DossierProcAgency>>();

			for (String listenerClassName : listenerClassNames) {
				listenersList.add((ModelListener<DossierProcAgency>)InstanceFactory.newInstance(
						getClassLoader(), listenerClassName));
			}

			listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
		}
		catch (Exception e) {
			_log.error(e);
		}
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:25,代码来源:DossierProcAgencyPersistenceImpl.java

示例11: afterPropertiesSet

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * Initializes the dossier doc2 template persistence.
 */
public void afterPropertiesSet() {
	String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
				com.liferay.util.service.ServiceProps.get(
					"value.object.listener.org.oep.core.dossiermgt.model.DossierDoc2Template")));

	if (listenerClassNames.length > 0) {
		try {
			List<ModelListener<DossierDoc2Template>> listenersList = new ArrayList<ModelListener<DossierDoc2Template>>();

			for (String listenerClassName : listenerClassNames) {
				listenersList.add((ModelListener<DossierDoc2Template>)InstanceFactory.newInstance(
						getClassLoader(), listenerClassName));
			}

			listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
		}
		catch (Exception e) {
			_log.error(e);
		}
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:25,代码来源:DossierDoc2TemplatePersistenceImpl.java

示例12: afterPropertiesSet

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * Initializes the doc file persistence.
 */
public void afterPropertiesSet() {
	String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
				com.liferay.util.service.ServiceProps.get(
					"value.object.listener.org.oep.core.dossiermgt.model.DocFile")));

	if (listenerClassNames.length > 0) {
		try {
			List<ModelListener<DocFile>> listenersList = new ArrayList<ModelListener<DocFile>>();

			for (String listenerClassName : listenerClassNames) {
				listenersList.add((ModelListener<DocFile>)InstanceFactory.newInstance(
						getClassLoader(), listenerClassName));
			}

			listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
		}
		catch (Exception e) {
			_log.error(e);
		}
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:25,代码来源:DocFilePersistenceImpl.java

示例13: afterPropertiesSet

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * Initializes the payment request persistence.
 */
public void afterPropertiesSet() {
	String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
				com.liferay.util.service.ServiceProps.get(
					"value.object.listener.org.oep.core.dossiermgt.model.PaymentRequest")));

	if (listenerClassNames.length > 0) {
		try {
			List<ModelListener<PaymentRequest>> listenersList = new ArrayList<ModelListener<PaymentRequest>>();

			for (String listenerClassName : listenerClassNames) {
				listenersList.add((ModelListener<PaymentRequest>)InstanceFactory.newInstance(
						getClassLoader(), listenerClassName));
			}

			listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
		}
		catch (Exception e) {
			_log.error(e);
		}
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:25,代码来源:PaymentRequestPersistenceImpl.java

示例14: afterPropertiesSet

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * Initializes the dossier proc2 agent persistence.
 */
public void afterPropertiesSet() {
	String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
				com.liferay.util.service.ServiceProps.get(
					"value.object.listener.org.oep.core.dossiermgt.model.DossierProc2Agent")));

	if (listenerClassNames.length > 0) {
		try {
			List<ModelListener<DossierProc2Agent>> listenersList = new ArrayList<ModelListener<DossierProc2Agent>>();

			for (String listenerClassName : listenerClassNames) {
				listenersList.add((ModelListener<DossierProc2Agent>)InstanceFactory.newInstance(
						getClassLoader(), listenerClassName));
			}

			listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
		}
		catch (Exception e) {
			_log.error(e);
		}
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:25,代码来源:DossierProc2AgentPersistenceImpl.java

示例15: afterPropertiesSet

import com.liferay.portal.kernel.util.StringUtil; //导入依赖的package包/类
/**
 * Initializes the legal details persistence.
 */
public void afterPropertiesSet() {
    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
                com.liferay.util.service.ServiceProps.get(
                    "value.object.listener.de.fraunhofer.fokus.movepla.model.LegalDetails")));

    if (listenerClassNames.length > 0) {
        try {
            List<ModelListener<LegalDetails>> listenersList = new ArrayList<ModelListener<LegalDetails>>();

            for (String listenerClassName : listenerClassNames) {
                listenersList.add((ModelListener<LegalDetails>) InstanceFactory.newInstance(
                        listenerClassName));
            }

            listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
        } catch (Exception e) {
            _log.error(e);
        }
    }
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:24,代码来源:LegalDetailsPersistenceImpl.java


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