public static String getPropertyName(Field field, Map<String,String> props) throws IllegalArgumentException { if (field == null) { throw new IllegalArgumentException("Cannot get property name: field is null") ; } if (props == null) { throw new IllegalArgumentException("Cannot get property name: properties map is null") ; } Property annotation=field.getAnnotation(Property.class); if (annotation == null) { throw new IllegalArgumentException("Cannot get property name for field " + field.getName() + " which is not annotated with @Property") ; } String propertyName=field.getName(); if(props.containsKey(annotation.name())) { propertyName=annotation.name(); boolean isDeprecated=!annotation.deprecatedMessage().isEmpty(); if(isDeprecated) log.warn(Util.getMessage("Deprecated"), propertyName, annotation.deprecatedMessage()); } return propertyName ; }
public <T extends Protocol> T setValue(String name, Object value) { if(name == null || value == null) return (T)this; Field field=Util.getField(getClass(), name); if(field == null) throw new IllegalArgumentException("field " + name + " not found"); Property prop=field.getAnnotation(Property.class); if(prop != null) { String deprecated_msg=prop.deprecatedMessage(); if(deprecated_msg != null && !deprecated_msg.isEmpty()) log.warn("Field " + getName() + "." + name + " is deprecated: " + deprecated_msg); } Util.setField(field, this, value); return (T)this; }
String deprecated_msg=annotation.deprecatedMessage(); if(deprecated_msg != null && !deprecated_msg.isEmpty()) { log.warn(Util.getMessage("Deprecated"), method.getDeclaringClass().getSimpleName() + "." + methodName,
String deprecated_msg=annotation.deprecatedMessage(); if(deprecated_msg != null && !deprecated_msg.isEmpty()) { log.warn(Util.getMessage("Deprecated"), field.getDeclaringClass().getSimpleName() + "." + field.getName(),
final String property; final Property r = field.getAnnotation(Property.class); boolean annotationRedefinesName = !r.name().isEmpty() && r.deprecatedMessage().isEmpty(); if (annotationRedefinesName) { property = r.name();
public static String getPropertyName(Field field, Map<String,String> props) throws IllegalArgumentException { if (field == null) { throw new IllegalArgumentException("Cannot get property name: field is null") ; } if (props == null) { throw new IllegalArgumentException("Cannot get property name: properties map is null") ; } Property annotation=field.getAnnotation(Property.class); if (annotation == null) { throw new IllegalArgumentException("Cannot get property name for field " + field.getName() + " which is not annotated with @Property") ; } String propertyName=field.getName(); if(props.containsKey(annotation.name())) { propertyName=annotation.name(); boolean isDeprecated=!annotation.deprecatedMessage().isEmpty(); if(isDeprecated) log.warn(Util.getMessage("Deprecated"), propertyName, annotation.deprecatedMessage()); } return propertyName ; }
public <T extends Protocol> T setValue(String name, Object value) { if(name == null || value == null) return (T)this; Field field=Util.getField(getClass(), name); if(field == null) throw new IllegalArgumentException("field " + name + " not found"); Property prop=field.getAnnotation(Property.class); if(prop != null) { String deprecated_msg=prop.deprecatedMessage(); if(deprecated_msg != null && !deprecated_msg.isEmpty()) log.warn("Field " + getName() + "." + name + " is deprecated: " + deprecated_msg); } Util.setField(field, this, value); return (T)this; }
String deprecated_msg=annotation.deprecatedMessage(); if(deprecated_msg != null && !deprecated_msg.isEmpty()) { log.warn(Util.getMessage("Deprecated"), method.getDeclaringClass().getSimpleName() + "." + methodName,
String deprecated_msg=annotation.deprecatedMessage(); if(deprecated_msg != null && !deprecated_msg.isEmpty()) { log.warn(Util.getMessage("Deprecated"), field.getDeclaringClass().getSimpleName() + "." + field.getName(),
final String property; final Property r = field.getAnnotation(Property.class); boolean annotationRedefinesName = !r.name().isEmpty() && r.deprecatedMessage().isEmpty(); if (annotationRedefinesName) { property = r.name();