本文整理了Java中org.jgroups.util.Util.methodNameToAttributeName()
方法的一些代码示例,展示了Util.methodNameToAttributeName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.methodNameToAttributeName()
方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:methodNameToAttributeName
[英]Converts a method name to an attribute name, e.g. getFooBar() --> foo_bar, isFlag --> flag.
[中]将方法名称转换为属性名称,例如getFooBar()-->foo_bar、isFlag-->flag。
代码示例来源:origin: wildfly/wildfly
@Override
public String getName() {
String name = super.getName();
return (name != null) ? name : Util.methodNameToAttributeName(this.accessible.getName());
}
代码示例来源:origin: wildfly/wildfly
public static String getPropertyName(Method method) throws IllegalArgumentException {
if (method == null) {
throw new IllegalArgumentException("Cannot get property name: field is null") ;
}
Property annotation=method.getAnnotation(Property.class);
if (annotation == null) {
throw new IllegalArgumentException("Cannot get property name for method " +
method.getName() + " which is not annotated with @Property") ;
}
String propertyName=!annotation.name().isEmpty()? annotation.name() : method.getName();
propertyName=Util.methodNameToAttributeName(propertyName);
return propertyName ;
}
代码示例来源:origin: wildfly/wildfly
name = Util.methodNameToAttributeName(method.getName());
代码示例来源:origin: wildfly/wildfly
method_name=method_name.trim();
else {
String field_name=Util.methodNameToAttributeName(method.getName());
method_name=Util.attributeNameToMethodName(field_name);
try {
Object value=method.invoke(obj);
String attributeName=Util.methodNameToAttributeName(method_name);
if(value instanceof Double)
value=String.format("%.2f", (double)value);
代码示例来源:origin: wildfly/wildfly
if(annotation.name() != null)
possible_names.add(annotation.name());
possible_names.add(Util.methodNameToAttributeName(methodName));
Field field=Util.findField(prot, possible_names);
if(field != null) {
代码示例来源:origin: wildfly/wildfly
if(annotation.name() != null)
possible_names.add(annotation.name());
possible_names.add(Util.methodNameToAttributeName(methodName));
Field field=Util.findField(prot, possible_names);
if(field != null) {
代码示例来源:origin: wildfly/wildfly
final String name;
if (annotation.name().length() < 1) {
name = Util.methodNameToAttributeName(method.getName());
} else {
name = annotation.name();
代码示例来源:origin: wildfly/wildfly
else {
attr_name=Util.methodNameToAttributeName(methodName);
if(!atts.containsKey(attr_name)) {
String type=is_setter? method.getParameterTypes()[0].getCanonicalName() : method.getReturnType().getCanonicalName();
MBeanAttributeInfo info=new MBeanAttributeInfo(attr_name, type, descr, true, writable, methodName.startsWith("is"));
AttributeEntry entry=new AttributeEntry(Util.methodNameToAttributeName(methodName), info);
if(is_setter)
entry.setter(new MethodAccessor(method, instance));
代码示例来源:origin: org.jboss.eap/wildfly-clustering-jgroups-extension
@Override
public String getName() {
String name = super.getName();
return (name != null) ? name : Util.methodNameToAttributeName(this.accessible.getName());
}
代码示例来源:origin: org.infinispan.server/infinispan-server-jgroups
@Override
public String getName() {
String name = super.getName();
return (name != null) ? name : Util.methodNameToAttributeName(this.accessible.getName());
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
public static String getPropertyName(Method method) throws IllegalArgumentException {
if (method == null) {
throw new IllegalArgumentException("Cannot get property name: field is null") ;
}
Property annotation=method.getAnnotation(Property.class);
if (annotation == null) {
throw new IllegalArgumentException("Cannot get property name for method " +
method.getName() + " which is not annotated with @Property") ;
}
String propertyName=!annotation.name().isEmpty()? annotation.name() : method.getName();
propertyName=Util.methodNameToAttributeName(propertyName);
return propertyName ;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
name = Util.methodNameToAttributeName(method.getName());
代码示例来源:origin: org.jboss.eap/wildfly-client-all
method_name=method_name.trim();
else {
String field_name=Util.methodNameToAttributeName(method.getName());
method_name=Util.attributeNameToMethodName(field_name);
try {
Object value=method.invoke(obj);
String attributeName=Util.methodNameToAttributeName(method_name);
if(value instanceof Double)
value=String.format("%.2f", (double)value);
代码示例来源:origin: org.jboss.eap/wildfly-client-all
if(annotation.name() != null)
possible_names.add(annotation.name());
possible_names.add(Util.methodNameToAttributeName(methodName));
Field field=Util.findField(prot, possible_names);
if(field != null) {
代码示例来源:origin: org.jboss.eap/wildfly-client-all
if(annotation.name() != null)
possible_names.add(annotation.name());
possible_names.add(Util.methodNameToAttributeName(methodName));
Field field=Util.findField(prot, possible_names);
if(field != null) {
代码示例来源:origin: org.jboss.eap/wildfly-client-all
final String name;
if (annotation.name().length() < 1) {
name = Util.methodNameToAttributeName(method.getName());
} else {
name = annotation.name();
代码示例来源:origin: org.jboss.eap/wildfly-client-all
else {
attr_name=Util.methodNameToAttributeName(methodName);
if(!atts.containsKey(attr_name)) {
String type=is_setter? method.getParameterTypes()[0].getCanonicalName() : method.getReturnType().getCanonicalName();
MBeanAttributeInfo info=new MBeanAttributeInfo(attr_name, type, descr, true, writable, methodName.startsWith("is"));
AttributeEntry entry=new AttributeEntry(Util.methodNameToAttributeName(methodName), info);
if(is_setter)
entry.setter(new MethodAccessor(method, instance));
内容来源于网络,如有侵权,请联系作者删除!