Ejemplo n.º 1
0
  private Field getFieldByName(String fieldName, Class clazz)
      throws ComponentConfigurationException {
    Field retValue = ReflectionUtils.getFieldByNameIncludingSuperclasses(fieldName, clazz);

    if (retValue == null) {
      String msg =
          "Class '" + clazz.getName() + "' does not contain a field named '" + fieldName + "'";

      throw new ComponentConfigurationException(msg);
    }

    return retValue;
  }
Ejemplo n.º 2
0
  private void initField() {
    field = ReflectionUtils.getFieldByNameIncludingSuperclasses(fieldName, object.getClass());

    if (field == null) {
      return;
    }

    fieldType = field.getType();

    try {
      fieldTypeConverter = lookup.lookupConverterForType(fieldType);
    } catch (ComponentConfigurationException e) {
      // ignore, handle later
    }
  }