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


Java S.string方法代码示例

本文整理汇总了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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:17,代码来源:EnvAnnotationVisitor.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:20,代码来源:Config.java

示例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);
}
 
开发者ID:actframework,项目名称:act-ebean,代码行数:9,代码来源:EbeanDao.java

示例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();
    }
}
 
开发者ID:actframework,项目名称:act-aaa-plugin,代码行数:13,代码来源:LoginUserFinder.java

示例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));
}
 
开发者ID:actframework,项目名称:actframework,代码行数:8,代码来源:GH325.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:13,代码来源:GH325.java

示例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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:11,代码来源:EndpointTester.java

示例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();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:12,代码来源:EndpointTester.java

示例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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:15,代码来源:OptionsInfoBase.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:13,代码来源:CommanderByteCodeScanner.java

示例11: hello6

import org.osgl.util.S; //导入方法依赖的package包/类
@SessionFree
@PostAction("/hello6")
public String hello6(int i) {
    return S.string(i);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:6,代码来源:HelloController.java

示例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})$"));
}
 
开发者ID:actframework,项目名称:actframework,代码行数:5,代码来源:EmailHandler.java

示例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;
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:44,代码来源:CommanderByteCodeScanner.java

示例14: getVal

import org.osgl.util.S; //导入方法依赖的package包/类
public String getVal() {
    return S.string(val);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:4,代码来源:ConfigItem.java

示例15: resolveUserName

import org.osgl.util.S; //导入方法依赖的package包/类
@Override
protected String resolveUserName(HttpServletRequest request) {
    return S.string(request.getAttribute(AAAConfigurer.getSessionKeyUserName()));
}
 
开发者ID:greenlaw110,项目名称:spring-aaa,代码行数:5,代码来源:A3HttpSessionManager.java


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