blob: 9ab138a8d444d566185fb721266c038146106ef8 [file] [log] [blame]
package org.qi4j.library.struts2.support.view;
import org.qi4j.api.injection.scope.This;
import org.qi4j.library.struts2.support.ProvidesEntityOfMixin;
import static org.qi4j.library.struts2.util.ParameterizedTypes.findTypeVariables;
public abstract class ProvidesViewOfMixin<T>
extends ProvidesEntityOfMixin<T>
implements ProvidesViewOf<T>
{
@This
private ProvidesViewOf<T> action;
@Override
public String execute()
{
loadEntity();
return SUCCESS;
}
@Override
protected Class<T> typeToLoad()
{
return (Class<T>) findTypeVariables( action.getClass(), ProvidesViewOf.class )[ 0 ];
}
}