本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}