/** * @return The declaring type of the decorable element. If the decorable element is a type, then this returns that type. */ public MetaClass getDecorableDeclaringType() { return decorableType().getEnclosingType(annotated); }
/** * @return The name of the annotated element. Calls * {@link MetaClassMember#getName()} for fields and methods. The * source code name for parameter, and the simple class name for * types. */ public String getName() { return decorableType().getName(annotated); }
/** * @return The type of the decorable element. The type of a field or parameter, the return type of a method, the type itself for a type. */ public MetaClass getType() { return decorableType().getType(annotated); }
public Statement call(final Statement... values) { return decorableType().call(annotated, factory, values); }
/** * For all but parameters, this access statement can be used in generated * implementations for * {@link Factory#createInstance(org.jboss.errai.ioc.client.container.ContextManager)} * and * {@link Factory#destroyInstance(Object, org.jboss.errai.ioc.client.container.ContextManager)} * . For parameters it is only valid in the former. * * @param params * If this decorable is a method these parameters are used in the * generated invocation. Otherwise they are ignored. * @return A reference to the decorated value. For fields or methods, the * member is loaded/invoked. For types a reference to the constructed * type. For parameters, a reference to a local variable of the value that was passed in to the parameter. */ public Statement getAccessStatement(Statement... params) { return decorableType().getAccessStatement(annotated, factory, params); }
final Statement valueAccessor; switch (decorable.decorableType()) { case METHOD: final MetaMethod method = decorable.getAsMethod(); throw new RuntimeException("problem with style binding. element target type is invalid: " + decorable.decorableType());
final Statement valueAccessor; switch (decorable.decorableType()) { case METHOD: final MetaMethod method = decorable.getAsMethod(); throw new RuntimeException("problem with style binding. element target type is invalid: " + decorable.decorableType());
if (componentType.isAssignableTo(Widget.class)) { if (!decorable.get().isAnnotationPresent(Inject.class) && decorable.decorableType().equals(DecorableType.FIELD) && componentType.isDefaultInstantiable()) { Statement widgetInit = Stmt.loadVariable("this").invoke( PrivateAccessUtil.getPrivateFieldAccessorName(decorable.getAsField()),
if (componentType.isAssignableTo(Widget.class)) { if (!decorable.get().isAnnotationPresent(Inject.class) && decorable.decorableType().equals(DecorableType.FIELD) && componentType.isDefaultInstantiable()) { Statement widgetInit = Stmt.loadVariable("this").invoke( PrivateAccessUtil.getPrivateFieldAccessorName(decorable.getAsField()),