本文整理汇总了Java中org.osgl.util.S.string方法的典型用法代码示例。如果您正苦于以下问题:Java S.string方法的具体用法?Java S.string怎么用?Java S.string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osgl.util.S
的用法示例。
在下文中一共展示了S.string方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public void visit(String name, Object value) {
if ("value".equals(name)) {
String s = S.string(value);
if (type == Env.RequireProfile.class || type == Env.Profile.class) {
matched = Env.profileMatches(s);
} else if (type == Env.RequireGroup.class || type == Env.Group.class) {
matched = Env.groupMatches(s);
}
} else if ("except".equals(name)) {
except = (Boolean) value;
} else if ("except".equals(name)) {
except = (Boolean) value;
}
super.visit(name, value);
}
示例2: getInteger
import org.osgl.util.S; //导入方法依赖的package包/类
public Integer getInteger(ConfigKey key, Integer def) {
Object retVal = get(key, def);
if (null == retVal) {
return null;
}
if (retVal instanceof Number) {
return ((Number) retVal).intValue();
}
String s = S.string(retVal);
if (s.contains("*")) {
List<String> sl = S.fastSplit(s, "*");
int n = 1;
for (String sn : sl) {
n *= Integer.parseInt(sn.trim());
}
return n;
}
return Integer.parseInt(s);
}
示例3: applyTo
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
void applyTo(ExpressionList<?> where, String field, Object val) {
String s = S.string(val);
if (!s.contains("%")) {
s = S.builder("%").append(s).append("%").toString();
}
where.like(field, s);
}
示例4: initialized
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
protected void initialized() {
App app = App.instance();
Class rawType = spec.rawType();
dao = app.dbServiceManager().dao(rawType);
querySpec = S.string(options.get(KEY_USER_KEY));
if (S.blank(querySpec)) {
querySpec = AAAConfig.user.key.get();
}
}
示例5: test2
import org.osgl.util.S; //导入方法依赖的package包/类
@GetAction("person/{name};{attributes}/{key}")
public String test2(String name, Map<String, Integer> attributes, String key) {
if (S.eq("name", key)) {
return name;
}
return S.string(attributes.get(key));
}
示例6: test3
import org.osgl.util.S; //导入方法依赖的package包/类
@GetAction("list/{list}/{key}")
public String test3(Map<String, List<Integer>> list, String key) {
List<Integer> l = list.get(key);
if (null == l) {
return "0";
}
int n = 0;
for (int x : l) {
n += x;
}
return S.string(n);
}
示例7: params
import org.osgl.util.S; //导入方法依赖的package包/类
public ReqBuilder params(String key, Object val, Object ... otherPairs) {
E.illegalArgumentIf(otherPairs.length % 2 != 0);
param(key, val);
int len = otherPairs.length;
for (int i = 0; i < len - 1; i += 2) {
String key0 = S.string(otherPairs[i]);
param(key0, otherPairs[i + 1]);
}
return this;
}
示例8: buildFormEncoded
import org.osgl.util.S; //导入方法依赖的package包/类
private RequestBody buildFormEncoded() {
FormBody.Builder builder = new FormBody.Builder();
for ($.T2<String, Object> entry : postParams) {
String val = S.string(entry._2);
if (this.method == H.Method.GET) {
val = Codec.encodeUrl(val);
}
builder.add(entry._1, val);
}
return builder.build();
}
示例9: optionHandler
import org.osgl.util.S; //导入方法依赖的package包/类
public RequestHandler optionHandler(CharSequence path, ActionContext context) {
String s = S.string(path);
RequestHandler handler = handlers.get(s);
if (null == handler) {
RequestHandler newHandler = createHandler(path, context);
handler = handlers.putIfAbsent(s, newHandler);
if (null == handler) {
handler = newHandler;
} else {
newHandler.destroy();
}
}
return handler;
}
示例10: visit
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public void visit(String name, Object value) {
if ("value".equals(name)) {
String key = S.string(value);
if (S.blank(key)) {
sessionVariableName = fieldName;
} else {
sessionVariableName = key;
}
}
super.visit(name, value);
}
示例11: hello6
import org.osgl.util.S; //导入方法依赖的package包/类
@SessionFree
@PostAction("/hello6")
public String hello6(int i) {
return S.string(i);
}
示例12: isValid
import org.osgl.util.S; //导入方法依赖的package包/类
private boolean isValid(Object val) {
String s = S.string(val);
return (S.isBlank(s) || s.toLowerCase().matches("^[_a-z0-9-']+(\\.[_a-z0-9-']+)*(\\+[0-9]+)[email protected][a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})$"));
}
示例13: visitParameterAnnotation
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public AnnotationVisitor visitParameterAnnotation(final int paramIndex, String desc, boolean visible) {
AnnotationVisitor av = super.visitParameterAnnotation(paramIndex, desc, visible);
Type type = Type.getType(desc);
boolean isOptional = $.eq(type, AsmTypes.OPTIONAL.asmType());
boolean isRequired = !isOptional && $.eq(type, AsmTypes.REQUIRED.asmType());
if (isOptional || isRequired) {
if (optionAnnoInfoMap.containsKey(paramIndex)) {
throw E.unexpected("Option annotation already found on index %s", paramIndex);
}
return new ParamOptionAnnotationVisitor(av, paramIndex, isOptional);
} else if ($.eq(type, AsmTypes.CONTEXT.asmType())) {
contextInfo.set(paramIndex);
return av;
} else if ($.eq(type, AsmTypes.READ_FILE_CONTENT.asmType())) {
readFileContentFlags.put(paramIndex, true);
return av;
} else if ($.eq(type, AsmTypes.CLI_SESSION_ATTRIBUTE.asmType())) {
return new AnnotationVisitor(ASM5, av) {
private String attributeKey = "";
@Override
public void visit(String name, Object value) {
if ("value".equals(name)) {
attributeKey = S.string(value);
}
super.visit(name, value);
}
@Override
public void visitEnd() {
cliSessionAttributeMap.put(paramIndex, attributeKey);
super.visitEnd();
}
};
} else if ("Ljavax/inject/Named;".equals(desc)) {
skipNaming.add(paramIndex);
return av;
} else {
return av;
}
}
示例14: getVal
import org.osgl.util.S; //导入方法依赖的package包/类
public String getVal() {
return S.string(val);
}
示例15: resolveUserName
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
protected String resolveUserName(HttpServletRequest request) {
return S.string(request.getAttribute(AAAConfigurer.getSessionKeyUserName()));
}