org.omnaest.utils.beans.adapter.source
Annotation Type DefaultValues


@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface DefaultValues

The DefaultValues Annotation allows to declare a value which is used as default value, if a given or returned value of a method is null.

The values are specified as String and will be converted to any type which has a single String parameter constructor or a valueOf method like Double.valueOf(String) .

Example:

 protected interface ExampleInterface
 {
   @DefaultValue(value = "defaultValueSet")
   public void setFieldString( String value );
   
   @DefaultValue(value = "defaultValueGet")
   public String getFieldString();
   
   @DefaultValue(value = "1.23")
   public void setFieldDouble( Double value );
   
   @DefaultValue(value = "3.45")
   public Double getFieldDouble();
 }
 

Author:
Omnaest

Required Element Summary
 String[] values
           
 

Element Detail

values

public abstract String[] values


Copyright © 2013. All Rights Reserved.