Code example for TypeToken

Methods: getRawType

0
  } 
 
  @Override 
  public void visit(Object instance, TypeToken<?> inspectType, TypeToken<?> declareType, Field field) throws Exception {
    if (field.isAnnotationPresent(Property.class)) {
      String key = declareType.getRawType().getName() + '.' + field.getName();
      String value = properties.get(key);
      if (value == null) {
        return; 
      } 
      setValue(instance, field, value);
    } 
  } 
 
  /** 
   * Sets the value of the field in the given instance by converting the value from String to the field type. 
   * Currently only allows primitive types, boxed types, String and Enum. 
   */ 
  @SuppressWarnings("unchecked") 
  private void setValue(Object instance, Field field, String value) throws IllegalAccessException {
Connect your IDE to all the code out there  Get Codota for Java