Code example for Field

Methods: getGenericType, isAnnotationPresent

0
		this.pluginManager = pluginManager;
	} 
	 
	@Override 
	public Object getFieldValue(Field field, Object fieldOwner) {
		if (field.isAnnotationPresent(Inject.class)) {
			// field.getType().getName() must be java.util.List 
//			System.out.println(">>>> " + field.getType().getName()); 
			 
			ParameterizedType parameterizedType = (ParameterizedType) field.getGenericType();
			Class<?> type = (Class<?>) parameterizedType.getActualTypeArguments()[0];
			 
			return pluginManager.getExtensions(type) ;
        } 
		 
        return null; 
	} 
 
	@Override 
	public boolean supportsField(Field field) {
		return field.isAnnotationPresent(Inject.class);