本文整理汇总了Java中org.seasar.framework.util.StringUtil.split方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.split方法的具体用法?Java StringUtil.split怎么用?Java StringUtil.split使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.seasar.framework.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.split方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createIdentifierGenerator
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
public static IdentifierGenerator createIdentifierGenerator(
PropertyType propertyType, Dbms dbms, String annotation) {
if (propertyType == null) {
throw new EmptyRuntimeException("propertyType");
}
if (dbms == null) {
throw new EmptyRuntimeException("dbms");
}
if (annotation == null) {
return new AssignedIdentifierGenerator(propertyType, dbms);
}
String[] array = StringUtil.split(annotation, "=, ");
Class clazz = getGeneratorClass(array[0]);
IdentifierGenerator generator = createIdentifierGenerator(clazz,
propertyType, dbms);
for (int i = 1; i < array.length; i += 2) {
setProperty(generator, array[i].trim(), array[i + 1].trim());
}
return generator;
}
示例2: url
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
/**
* URLを計算します。
*
* @param input
* 入力値
* @return エスケープした結果
*/
public static String url(String input) {
String contextPath = RequestUtil.getRequest().getContextPath();
StringBuilder sb = new StringBuilder();
if (contextPath.length() > 1) {
sb.append(contextPath);
}
if (StringUtil.isEmpty(input)) {
sb.append(ActionUtil.calcActionPath());
} else if (!input.startsWith("/")) {
sb.append(ActionUtil.calcActionPath()).append(input);
} else {
String[] names = StringUtil.split(input, "/");
S2Container container = SingletonS2ContainerFactory.getContainer();
StringBuilder sb2 = new StringBuilder(50);
String input2 = input;
for (int i = 0; i < names.length; i++) {
if (container.hasComponentDef(sb2 + names[i] + "Action")) {
String actionPath = RoutingUtil.getActionPath(names, i);
String paramPath = RoutingUtil.getParamPath(names, i + 1);
if (StringUtil.isEmpty(paramPath)) {
input2 = actionPath + "/";
break;
}
}
sb2.append(names[i] + "_");
}
sb.append(input2);
}
return ResponseUtil.getResponse().encodeURL(sb.toString());
}
示例3: isTarget
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
/**
* 対象のメソッドかどうかを返します。
*
* @param methodName
* メソッド名
* @param target
* メソッド名がカンマ区切りで指定されたもの
* @return 対象のメソッドかどうか
*/
protected boolean isTarget(String methodName, String target) {
if (StringUtil.isEmpty(target)) {
return true;
}
String[] names = StringUtil.split(target, ", ");
for (String name : names) {
if (methodName.equals(name.trim())) {
return true;
}
}
return false;
}
示例4: getArgNames
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
public String[] getArgNames(Method method) {
String argsKey = method.getName() + ARGS_SUFFIX;
if (daoBeanDesc.hasField(argsKey)) {
Field argNamesField = daoBeanDesc.getField(argsKey);
String argNames = (String) FieldUtil.get(argNamesField, null);
return StringUtil.split(argNames, " ,");
} else {
return new String[0];
}
}
示例5: getProps
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
private String[] getProps(Method method, String fieldName) {
if (daoBeanDesc.hasField(fieldName)) {
Field field = daoBeanDesc.getField(fieldName);
String s = (String) FieldUtil.get(field, null);
return StringUtil.split(s, ", ");
}
return null;
}
示例6: getNoPersisteneProps
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
public String[] getNoPersisteneProps() {
if (beanDesc.hasField(NO_PERSISTENT_PROPS)) {
Field field = beanDesc.getField(NO_PERSISTENT_PROPS);
String str = (String) FieldUtil.get(field, null);
return StringUtil.split(str, ", ");
}
return null;
}
示例7: BindVariableNode
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
public BindVariableNode(String expression) {
this.expression = expression;
names = StringUtil.split(expression, ".");
// baseName_ = array[0];
// if (array.length > 1) {
// propertyName_ = array[1];
// }
}
示例8: EmbeddedValueNode
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
public EmbeddedValueNode(String expression) {
this.expression = expression;
String[] array = StringUtil.split(expression, ".");
this.baseName = array[0];
if (array.length > 1) {
this.propertyName = array[1];
}
}
示例9: testGetActionPath
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
/**
* @throws Exception
*/
public void testGetActionPath() throws Exception {
String[] names = StringUtil.split("/aaa", "/");
assertEquals("/aaa", RoutingUtil.getActionPath(names, 0));
}
示例10: testGetActionPath_method
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
/**
* @throws Exception
*/
public void testGetActionPath_method() throws Exception {
String[] names = StringUtil.split("/aaa/hoge", "/");
assertEquals("/aaa", RoutingUtil.getActionPath(names, 0));
}
示例11: testGetParamPath
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
/**
* @throws Exception
*/
public void testGetParamPath() throws Exception {
String[] names = StringUtil.split("/aaa", "/");
assertEquals("", RoutingUtil.getParamPath(names, 1));
}
示例12: testGetParamPath_method
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
/**
* @throws Exception
*/
public void testGetParamPath_method() throws Exception {
String[] names = StringUtil.split("/aaa/hoge", "/");
assertEquals("hoge", RoutingUtil.getParamPath(names, 1));
}
示例13: testGetParamPath_index
import org.seasar.framework.util.StringUtil; //导入方法依赖的package包/类
/**
* @throws Exception
*/
public void testGetParamPath_index() throws Exception {
String[] names = StringUtil.split("/higayasuo/edit", "/");
assertEquals("higayasuo/edit", RoutingUtil.getParamPath(names, 0));
}