Package org.jboss.errai.codegen.framework.meta

Examples of org.jboss.errai.codegen.framework.meta.MetaField


            for (Field method : fields) {
              final Annotation aInstance = method.getAnnotation(aClass);

              final MetaClass type = MetaClassFactory.get(method.getDeclaringClass());
              final MetaField metaField = MetaClassFactory.get(method);

              entry.addProcessingDelegate(new ProcessingDelegate<MetaField>() {
                @Override
                public boolean process() {
                  injectorFactory.addType(type);
View Full Code Here


  }

  @Override
  public MetaField getField(String name) {
    try {
      MetaField mFld;
      if ("length".equals(name) && getEnclosedMetaObject().isArray()) {
        mFld = new MetaField.ArrayLengthMetaField(this);
      }
      else {
        mFld = new JavaReflectionField(getEnclosedMetaObject().getField(name));
View Full Code Here

  }

  @Override
  public MetaField getDeclaredField(String name) {
    try {
      MetaField mFld;

      if ("length".equals(name) && getEnclosedMetaObject().isArray()) {
        mFld = new MetaField.ArrayLengthMetaField(this);
      }
      else {
View Full Code Here

    MetaParameterizedType pType = null;

    switch (injectableInstance.getTaskType()) {
      case PrivateField:
      case Field:
        MetaField field = injectableInstance.getField();
        type = field.getType();

        pType = type.getParameterizedType();
        // TODO refactor!
        if (pType == null && field instanceof JavaReflectionField) {
          pType = (JavaReflectionParameterizedType) field.getGenericType();
        }
        break;

      case Parameter:
        MetaParameter parm = injectableInstance.getParm();
View Full Code Here

                           final Class<? extends Annotation> annoClass,
                           final IOCProcessingContext context) {

    final Annotation anno = field.getAnnotation(annoClass);
    final MetaClass type = MetaClassFactory.get(field.getDeclaringClass());
    final MetaField metaField = MetaClassFactory.get(field);

    dependencyControl.masqueradeAs(type);

    ProcessingDelegate<MetaField> del = new ProcessingDelegate<MetaField>() {
      @Override
View Full Code Here

    this.fieldName = fieldName;
  }

  @Override
  public void handleCall(final CallWriter writer, final Context context, Statement statement) {
    final MetaField field;
    if (fieldName.equals("this")) {
      // TODO this is a workaround to access the enclosing instance of a type
      field = new BuildMetaField(null, null, Scope.Private, statement.getType(), "this");
    }
    else {
      field = statement.getType().getField(fieldName);
    }

    if (field == null) {
      throw new UndefinedFieldException(fieldName, statement.getType());
    }

    final String currCallString = writer.getCallString();
    writer.reset();

    statement = new VariableReference() {

      @Override
      public String getName() {
        return field.getName();
      }

      @Override
      public Statement getValue() {
        return null;
      }

      @Override
      public String generate(Context context) {
        return currCallString + "." + getName();
      }

      @Override
      public MetaClass getType() {
        return field.getType();
      }
    };

    nextOrReturn(writer, context, statement);
  }
View Full Code Here

    this.fieldName = fieldName;
  }

  @Override
  public void handleCall(final CallWriter writer, final Context context, Statement statement) {
    final MetaField field;
    if (fieldName.equals("this")) {
      // TODO this is a workaround to access the enclosing instance of a type
      field = new BuildMetaField(null, null, Scope.Private, statement.getType(), "this");
    }
    else {
      field = statement.getType().getDeclaredField(fieldName);
    }

    if (field == null) {
      throw new UndefinedFieldException(fieldName, statement.getType());
    }

    final String currCallString = writer.getCallString();
    writer.reset();

    statement = new VariableReference() {

      @Override
      public String getName() {
        return field.getName();
      }

      @Override
      public Statement getValue() {
        return null;
      }

      @Override
      public String generate(Context context) {
        return currCallString + "." + getName();
      }

      @Override
      public MetaClass getType() {
        return field.getType();
      }
    };

    nextOrReturn(writer, context, statement);
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.codegen.framework.meta.MetaField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.