本文整理汇总了Java中org.osgl.util.S.afterFirst方法的典型用法代码示例。如果您正苦于以下问题:Java S.afterFirst方法的具体用法?Java S.afterFirst怎么用?Java S.afterFirst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osgl.util.S
的用法示例。
在下文中一共展示了S.afterFirst方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bytecodeFromSource
import org.osgl.util.S; //导入方法依赖的package包/类
private byte[] bytecodeFromSource(String name, boolean compile) {
Source source = source(name);
if (null == source) {
return null;
}
byte[] bytes = source.bytes();
if (null == bytes && compile) {
compiler.compile(name);
bytes = source.bytes();
}
if (name.contains("$")) {
String innerClassName = S.afterFirst(name, "$");
return source.bytes(innerClassName);
}
return bytes;
}
示例2: load
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public Object load(Object bean, ActContext<?> context, boolean noDefaultValue) {
AdaptiveRecord ar = (AdaptiveRecord) super.load(bean, context, noDefaultValue);
Set<String> loadedFields = fieldLoaders.keySet();
String prefix = S.concat(bindName(), ".");
Set<String> paramKeys = context.paramKeys();
for (String paramKey : paramKeys) {
if (paramKey.startsWith(prefix)) {
String field = S.afterFirst(paramKey, prefix);
if (S.notBlank(field) && !loadedFields.contains(field)) {
if (field.contains(".")) {
warn("AdaptiveRecordLoader does not support nested structure");
continue;
}
ar.putValue(field, context.paramVal(paramKey));
}
}
}
return ar;
}
示例3: findUser
import org.osgl.util.S; //导入方法依赖的package包/类
protected USER_TYPE findUser(String username) {
if (username.contains(":")) {
String field = S.beforeFirst(username, ":");
String value = S.afterFirst(username, ":");
return userDao.findOneBy(field, value);
}
return userDao.findOneBy(_userKey(), username);
}
示例4: readSession
import org.osgl.util.S; //导入方法依赖的package包/类
@Override
public String readSession(H.Request request) {
String payload = request.header(sessionHeader);
return hasSessionPayloadPrefix ? S.afterFirst(payload, sessionPayloadPrefix) : payload;
}
示例5: RouterRegexMacroLookup
import org.osgl.util.S; //导入方法依赖的package包/类
/**
* Construct a macro with {@link AppConfig} instance.
*
* This will load macro definition from app config. Macro
* definition in app config shall has key starts with `router.macro`.
* For example
*
* ```
* router.regex.macro.__user__=[a-z]([a-z_0-9)*
* ```
*
* This will also load from macro definition file named `act.router.macro`
* after loaded from app config. The macro definition provided in the
* definition file shall not be prefixed with `act.router.macro`, for example
*
* ```
* __user__=[a-z]([a-z_0-9)*
* ```
*
* The macro definition file name can also be specified using `router.macro_file`
* configuration.
*
* @param config the app config
*/
public RouterRegexMacroLookup(AppConfig<?> config) {
final String namespace = "router.macro";
final String prefix = namespace + ".";
Map<String, Object> appConfigMacros = config.subSet(namespace);
for (Map.Entry<String, Object> entry : appConfigMacros.entrySet()) {
String key = S.afterFirst(entry.getKey(), prefix);
this.macros.put(key, entry.getValue().toString());
}
String macroDefinitionFile = config.get("router.macro_file");
if (null == macroDefinitionFile) {
macroDefinitionFile = MACRO_DEF_FILE;
}
InputStream is = ConfigResourceLoader.load(macroDefinitionFile, InputStream.class, true);
if (null != is) {
Properties properties = IO.loadProperties(is);
this.macros.putAll((Map) properties);
}
}