本文整理汇总了Java中org.osgl.util.S.concat方法的典型用法代码示例。如果您正苦于以下问题:Java S.concat方法的具体用法?Java S.concat怎么用?Java S.concat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osgl.util.S
的用法示例。
在下文中一共展示了S.concat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSetter
import org.osgl.util.S; //导入方法依赖的package包/类
private void addSetter(Map.Entry<String, $.T2<String, String>> field) {
String name = field.getKey();
String desc = field.getValue()._1;
String signature = field.getValue()._2;
if (null != signature) {
signature = S.concat("(", signature, ")V");
}
MethodVisitor mv = visitMethod(ACC_PUBLIC, setterName(name), S.concat("(", desc, ")V"), signature, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(loadCode(desc), 1);
mv.visitFieldInsn(PUTFIELD, classDesc, name, desc);
mv.visitInsn(RETURN);
if (_D == desc.hashCode() || _J == desc.hashCode()) {
mv.visitMaxs(3, 3);
} else {
mv.visitMaxs(2, 2);
}
mv.visitEnd();
}
示例2: preventDoubleSubmission
import org.osgl.util.S; //导入方法依赖的package包/类
private void preventDoubleSubmission(ActionContext context) {
if (null == dspToken) {
return;
}
H.Request req = context.req();
if (req.method().safe()) {
return;
}
String tokenValue = context.paramVal(dspToken);
if (S.blank(tokenValue)) {
return;
}
H.Session session = context.session();
String cacheKey = S.concat("DSP-", dspToken);
String cached = session.cached(cacheKey);
if (S.eq(tokenValue, cached)) {
throw Conflict.get();
}
session.cacheFor1Min(cacheKey, tokenValue);
}
示例3: amendSuffix
import org.osgl.util.S; //导入方法依赖的package包/类
protected String amendSuffix(String path, ActContext context) {
if (path.contains(".")) {
return path;
}
H.Format fmt = context.accept();
if (UNKNOWN == fmt) {
fmt = HTML;
}
if (isAcceptFormatSupported(fmt)) {
return S.concat(path, ".", fmt.name());
}
if (context instanceof ActionContext) {
ActionContext actionContext = $.cast(context);
H.Request req = actionContext.req();
throw E.unsupport("Error handling %s request to %s - Request accept not supported: %s", req.method(), req.url(), fmt);
}
throw E.unsupport("Request accept not supported: %s", fmt);
}
示例4: dissolveIntoCookieContent
import org.osgl.util.S; //导入方法依赖的package包/类
private String dissolveIntoCookieContent(H.KV<?> kv, boolean isSession) {
S.Buffer sb = S.buffer();
int i = 0;
for (String k : kv.keySet()) {
if (i > 0) {
sb.append("\u0000");
}
sb.append(k);
sb.append("\u0001");
sb.append(kv.get(k));
i++;
}
String data = sb.toString();
if (isSession) {
String sign = app.sign(data);
data = S.concat(sign, "-", data);
if (encryptSession) {
data = app.encrypt(data);
}
}
data = Codec.encodeUrl(data, Charsets.UTF_8);
return data;
}
示例5: call
import org.osgl.util.S; //导入方法依赖的package包/类
protected void call(String path) {
if (path.startsWith("http:") || path.startsWith("//")) {
// we don't process absolute path
p(path);
return;
}
if (Act.isDev()) {
if (!path.startsWith("/")) {
path = '/' + path;
}
path = path + (path.contains("?") ? '&' : '?');
path = path + "ts=" + $.ms();
} else {
String checksum = checksumManager.checksumOf(path);
if (!path.startsWith("/")) {
path = '/' + path;
}
if (S.notBlank(checksum)) {
String sep = path.contains("?") ? "&" : "?";
path = S.concat(path, sep, "checksum=", checksum);
}
}
p(path);
}
示例6: verifyHash
import org.osgl.util.S; //导入方法依赖的package包/类
public boolean verifyHash(String content, String hash) {
byte[] myHash = mac.doFinal(content.getBytes(UTF_8));
int len = hash.length();
int padding = 4 - len % 4;
if (padding > 0) {
hash = S.concat(hash, S.times('.', padding));
}
return MessageDigest.isEqual(myHash, Codec.decodeUrlSafeBase64(hash));
}
示例7: loadSourceInfo
import org.osgl.util.S; //导入方法依赖的package包/类
private static SourceInfo loadSourceInfo(String className, String elementName, boolean isMethod, Integer lineNo) {
E.illegalStateIf(Act.isProd());
DevModeClassLoader cl = (DevModeClassLoader) App.instance().classLoader();
Source source = cl.source(className);
if (null == source) {
return null;
}
List<String> lines = source.lines();
Line candidate = null;
String pattern = isMethod ?
S.concat("^\\s*.*", elementName, "\\s*\\(.*") :
S.concat("^\\s*.*", elementName, "[^\\(\\{]*");
if (null != lineNo) {
return new SourceInfoImpl(source, lineNo);
}
for (int i = 0; i < lines.size(); ++i) {
String line = lines.get(i);
if (line.matches(pattern)) {
candidate = new Line(line, i + 1);
if (candidate.forSure) {
return new SourceInfoImpl(source, candidate.no);
}
}
}
if (null != candidate) {
return new SourceInfoImpl(source, candidate.no);
}
return new SourceInfoImpl(source, 1);
}
示例8: interpolate
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String interpolate(String messageTemplate, Context context, Locale locale) {
if (messageTemplate.startsWith("{act.")) {
return actInterpolate(messageTemplate, locale);
}
if (!messageTemplate.startsWith("{")) {
messageTemplate = S.concat("{", messageTemplate, "}");
}
return realInterpolator.interpolate(messageTemplate, context, locale);
}
示例9: generateToken
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String generateToken(H.Session session, App app) {
String id = session.id();
String username = session.get(app.config().sessionKeyUsername());
String payload = S.concat(id, username);
String sign = app.sign(payload);
return S.concat(payload, "-", sign);
}
示例10: toString
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String toString() {
return S.concat("name:", name, "; num:", S.string(num));
}
示例11: greet
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String greet(String who) {
return S.concat(who, " 你好");
}
示例12: commonConfig
import org.osgl.util.S; //导入方法依赖的package包/类
private String commonConfig(String path) {
return S.concat("conf/common/", path);
}
示例13: senderPath
import org.osgl.util.S; //导入方法依赖的package包/类
public MailerContext senderPath(String className, String methodName) {
senderPath = S.concat(className, ".", methodName);
return this;
}
示例14: errorMsg
import org.osgl.util.S; //导入方法依赖的package包/类
private static String errorMsg(AsmException exception, boolean scanning) {
String userMsg = exception.getLocalizedMessage();
return (S.blank(userMsg)) ? S.concat("Error ", scanning ? "scanning" : "enhancing", " bytecode at ", exception.context().toString()) : userMsg;
}
示例15: confConfig
import org.osgl.util.S; //导入方法依赖的package包/类
private String confConfig(String path) {
return S.concat("conf/", path);
}