controller.addInitializationStatements( Collections.<Statement>singletonList( controller.setReferenceStmt(MODEL_VAR_NAME, DecorableType.PARAM.getAccessStatement(mp, decorable.getFactoryMetaClass())))); dataBinderRef = controller.getInstancePropertyStmt( controller.getReferenceStmt(MODEL_VAR_NAME, dataModelType), BINDER_VAR_NAME, DecorableType.FIELD.getAccessStatement(field, decorable.getFactoryMetaClass()), BINDER_VAR_NAME, DataBinder.class);
controller.addInitializationStatements( Collections.<Statement>singletonList( controller.setReferenceStmt(MODEL_VAR_NAME, DecorableType.PARAM.getAccessStatement(mp, decorable.getFactoryMetaClass())))); dataBinderRef = controller.getInstancePropertyStmt( controller.getReferenceStmt(MODEL_VAR_NAME, dataModelType), BINDER_VAR_NAME, DecorableType.FIELD.getAccessStatement(field, decorable.getFactoryMetaClass()), BINDER_VAR_NAME, DataBinder.class);
return DecorableType.PARAM.getAccessStatement(paramDep.getParameter(), decorable.getFactoryMetaClass()); } else { break; controller.exposedFieldStmt(fieldDep.getField()); return DecorableType.FIELD.getAccessStatement(fieldDep.getField(), decorable.getFactoryMetaClass());
dataBinderRef = DecorableType.FIELD.getAccessStatement(field, decorable.getFactoryMetaClass()); if (!field.isPublic()) { controller.addExposedField(field);
dataBinderRef = DecorableType.FIELD.getAccessStatement(field, decorable.getFactoryMetaClass()); if (!field.isPublic()) { controller.addExposedField(field);
return DecorableType.PARAM.getAccessStatement(paramDep.getParameter(), decorable.getFactoryMetaClass()); } else { break; controller.exposedFieldStmt(fieldDep.getField()); return DecorableType.FIELD.getAccessStatement(fieldDep.getField(), decorable.getFactoryMetaClass());
/** * 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); }
/** * This should only be called for non-public methods. This method forces a * private accessor to be generated for the method. Dispatches to variable * {@code instance}. * * @param method * A method, static or non-static. * @param params * Statements for the values to be passed in as parameters. * @return A statement for accessing invoking the given method. */ public ContextualStatementBuilder exposedMethodStmt(final MetaMethod method, final Statement... params) { if (!method.isPublic()) { addExposedMethod(method); } return DecorableType.METHOD.getAccessStatement(method, factory, params); }
/** * This should only be called for non-public fields. This method forces a * private accessor to be generated for the field. * * @param field * A field, static or non-static. * @return A statement for accessing the value of a field. */ public ContextualStatementBuilder exposedFieldStmt(final MetaField field) { if (!field.isPublic()) { addExposedField(field); } return DecorableType.FIELD.getAccessStatement(field, factory); }
public ContextualStatementBuilder call(final HasAnnotations annotated, final BuildMetaClass factory, Statement... params) { return getAccessStatement(annotated, factory, params); } public String getName(HasAnnotations annotated) {
public abstract ContextualStatementBuilder getAccessStatement(final HasAnnotations annotated, final BuildMetaClass factory); public abstract ContextualStatementBuilder call(final Statement instance, final HasAnnotations annotated, final BuildMetaClass factory, Statement... params);