本文整理了Java中jodd.bean.BeanUtil.setDeclaredPropertyForcedSilent()
方法的一些代码示例,展示了BeanUtil.setDeclaredPropertyForcedSilent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BeanUtil.setDeclaredPropertyForcedSilent()
方法的具体详情如下:
包路径:jodd.bean.BeanUtil
类名称:BeanUtil
方法名:setDeclaredPropertyForcedSilent
暂无
代码示例来源:origin: org.jodd/jodd-wot
/**
* Sets target bean property, optionally creates instance if doesn't exist.
*/
protected void setTargetProperty(Object target, String name, Object attrValue, boolean create) {
if (create == true) {
BeanUtil.setDeclaredPropertyForcedSilent(target, name, attrValue);
} else {
BeanUtil.setDeclaredPropertySilent(target, name, attrValue);
}
}
代码示例来源:origin: com.threewks.thundr/thundr-gae
@Override
public T from(Map<String, Object> from) {
try {
T instance = type.newInstance();
for (Map.Entry<String, Object> entry : from.entrySet()) {
String field = metadata.getDecodedFieldName(entry.getKey());
BeanUtil.setDeclaredPropertyForcedSilent(instance, field, entry.getValue());
}
return instance;
} catch (Exception e) {
throw new SearchException(e, "Failed to create a new instance of %s for search results: %s", type.getName(), e.getMessage());
}
}
});
代码示例来源:origin: org.jodd/jodd-wot
public void inject(Object target, ActionRequest actionRequest) {
ActionConfig config = actionRequest.getActionConfig();
ActionConfigSet set = config.getActionConfigSet();
if (set.actionPathMacros== null) {
return;
}
String[] actionPathChunks = actionRequest.getActionPathChunks();
for (int i = 0; i < set.actionPathMacros.length; i++) {
ActionConfigSet.PathMacro macro = set.actionPathMacros[i];
int ndx = macro.ndx;
String name = macro.name;
String value = actionPathChunks[ndx];
int leftLen = macro.left.length();
int rightLen = macro.right.length();
if (leftLen + rightLen > 0) {
// there is additional prefix and/or suffix
value = value.substring(leftLen, value.length() - rightLen);
}
BeanUtil.setDeclaredPropertyForcedSilent(target, name, value);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!