org.eclipse.xtend.lib.macro.declaration.MutableFieldDeclaration Java Examples

The following examples show how to use org.eclipse.xtend.lib.macro.declaration.MutableFieldDeclaration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PropertyProcessor.java    From xtext-lib with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public void doTransform(final MutableFieldDeclaration it, @Extension final TransformationContext context) {
  @Extension
  final AccessorsProcessor.Util util = new AccessorsProcessor.Util(context);
  boolean _hasGetter = util.hasGetter(it);
  boolean _not = (!_hasGetter);
  if (_not) {
    util.addGetter(it, Visibility.PUBLIC);
  }
  if (((!it.isFinal()) && (!util.hasSetter(it)))) {
    util.addSetter(it, Visibility.PUBLIC);
  }
  String _firstLower = StringExtensions.toFirstLower(it.getSimpleName());
  String _plus = ("_" + _firstLower);
  it.setSimpleName(_plus);
}
 
Example #2
Source File: DeclarationsTest.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testAnnotation2() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("class MyClass {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("@com.google.inject.Inject() MyClass foo");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    TypeDeclaration _head = IterableExtensions.head(it.getSourceTypeDeclarations());
    final ClassDeclaration sourceClazz = ((ClassDeclaration) _head);
    final MutableClassDeclaration javaClass = it.getTypeLookup().findClass("MyClass");
    Assert.assertEquals(javaClass.getQualifiedName(), sourceClazz.getQualifiedName());
    final FieldDeclaration field = IterableExtensions.head(sourceClazz.getDeclaredFields());
    Assert.assertEquals(Boolean.FALSE, IterableExtensions.head(field.getAnnotations()).getValue("optional"));
    final MutableFieldDeclaration javaField = IterableExtensions.head(javaClass.getDeclaredFields());
    Object _value = IterableExtensions.head(javaField.getAnnotations()).getValue("optional");
    Assert.assertFalse((((Boolean) _value)).booleanValue());
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
Example #3
Source File: DotAttributeProcessor.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
private Object annotationValue(MutableFieldDeclaration field,
		TransformationContext context, String property) {
	for (AnnotationReference reference : field.getAnnotations()) {
		if (DotAttribute.class.getName().equals(reference
				.getAnnotationTypeDeclaration().getQualifiedName())) {
			return reference.getValue(property);
		}
	}
	throw new IllegalArgumentException("No DotAttribute annotation found.");
}
 
Example #4
Source File: SarlAccessorsProcessor.java    From sarl with Apache License 2.0 5 votes vote down vote up
/** Apply the minimum and maximum visibilities to the given one.
 *
 * @param visibility the visibility.
 * @param it the field associated to the accessors to generate.
 * @param context the transformation context.
 * @return the given {@code visibility}, or the min/max visibility if the given one is too high.
 */
@SuppressWarnings("static-method")
protected Visibility applyMinMaxVisibility(Visibility visibility, MutableFieldDeclaration it, TransformationContext context) {
	if (context.findTypeGlobally(Agent.class).isAssignableFrom(it.getDeclaringType())) {
		if (visibility.compareTo(Visibility.PROTECTED) > 0) {
			return Visibility.PROTECTED;
		}
	}
	return visibility;
}
 
Example #5
Source File: TagCompilationParticipant.java    From dsl-devkit with Eclipse Public License 1.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void doTransform(final List<? extends MutableFieldDeclaration> annotatedTargetElements, @Extension final TransformationContext context) {
  int counter = COUNTER_BASE;
  for (MutableFieldDeclaration field : annotatedTargetElements) {
    field.setInitializer(new IntegerLiteral(counter++));
  }

}
 
Example #6
Source File: JsonRpcDataProcessor.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
protected void addEitherSetter(final MutableFieldDeclaration field, final String setterName, final EitherTypeArgument argument, @Extension final JsonRpcDataTransformationContext context) {
  final Procedure1<MutableMethodDeclaration> _function = (MutableMethodDeclaration method) -> {
    context.setPrimarySourceElement(method, context.getPrimarySourceElement(field));
    method.addParameter(field.getSimpleName(), argument.getType());
    method.setStatic(field.isStatic());
    method.setVisibility(Visibility.PUBLIC);
    method.setReturnType(context.getPrimitiveVoid());
    final CompilationStrategy _function_1 = (CompilationStrategy.CompilationContext ctx) -> {
      return this.compileEitherSetterBody(field, argument, field.getSimpleName(), ctx, context);
    };
    method.setBody(_function_1);
  };
  field.getDeclaringType().addMethod(setterName, _function);
}
 
Example #7
Source File: JvmAnnotationTypeDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public MutableFieldDeclaration addField(final String name, final Procedure1<MutableFieldDeclaration> initializer) {
  String _simpleName = this.getSimpleName();
  String _plus = ("The annotation \'" + _simpleName);
  String _plus_1 = (_plus + "\' cannot declare any fields.");
  throw new UnsupportedOperationException(_plus_1);
}
 
Example #8
Source File: JvmTypeDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
public MutableFieldDeclaration addField(final String name, final Procedure1<MutableFieldDeclaration> initializer) {
  this.checkMutable();
  ConditionUtils.checkJavaIdentifier(name, "name");
  Preconditions.checkArgument((initializer != null), "initializer cannot be null");
  final JvmField newField = TypesFactory.eINSTANCE.createJvmField();
  newField.setSimpleName(name);
  newField.setVisibility(JvmVisibility.PRIVATE);
  this.getDelegate().getMembers().add(newField);
  MemberDeclaration _memberDeclaration = this.getCompilationUnit().toMemberDeclaration(newField);
  final MutableFieldDeclaration mutableFieldDeclaration = ((MutableFieldDeclaration) _memberDeclaration);
  initializer.apply(mutableFieldDeclaration);
  return mutableFieldDeclaration;
}
 
Example #9
Source File: FileProcessor.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void doTransform(final MutableClassDeclaration annotatedClass, @Extension final TransformationContext context) {
  final Path path = annotatedClass.getCompilationUnit().getFilePath();
  final String contents = context.getContents(context.getProjectFolder(path).append("res/template.txt")).toString();
  final String[] segments = contents.trim().split(",");
  for (final String segment : segments) {
    final Procedure1<MutableFieldDeclaration> _function = (MutableFieldDeclaration it) -> {
      it.setType(context.getString());
    };
    annotatedClass.addField(segment, _function);
  }
}
 
Example #10
Source File: _TESTDATA_InternalClassProcessor.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void doTransform(final MutableClassDeclaration annotatedClass, @Extension final TransformationContext context) {
  String _qualifiedName = annotatedClass.getQualifiedName();
  String _plus = (_qualifiedName + ".InternalClass");
  MutableClassDeclaration _findClass = context.findClass(_plus);
  final Procedure1<MutableClassDeclaration> _function = (MutableClassDeclaration it) -> {
    final Procedure1<MutableFieldDeclaration> _function_1 = (MutableFieldDeclaration it_1) -> {
      it_1.setType(context.getString());
    };
    it.addField("myField", _function_1);
  };
  ObjectExtensions.<MutableClassDeclaration>operator_doubleArrow(_findClass, _function);
}
 
Example #11
Source File: DeclarationsTest.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * see https://bugs.eclipse.org/bugs/show_bug.cgi?id=465007
 */
@Test
public void testAnnotation4() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("class MyClass {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("@test.Annotation2 String foo");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("@test.Annotation2(\"hubble\") String foo2");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("@test.Annotation2(value=\"hubble\") String foo3");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    final AnnotationReference anno = IterableExtensions.head(IterableExtensions.head(it.getTypeLookup().findClass("MyClass").getDeclaredFields()).getAnnotations());
    final AnnotationReference copied = it.getAnnotationReferenceProvider().newAnnotationReference(anno);
    Assert.assertTrue(((JvmAnnotationReferenceImpl) copied).getDelegate().getExplicitValues().isEmpty());
    final AnnotationReference anno2 = IterableExtensions.head((((MutableFieldDeclaration[])Conversions.unwrapArray(it.getTypeLookup().findClass("MyClass").getDeclaredFields(), MutableFieldDeclaration.class))[1]).getAnnotations());
    final AnnotationReference copied2 = it.getAnnotationReferenceProvider().newAnnotationReference(anno2);
    Assert.assertEquals(1, ((JvmAnnotationReferenceImpl) copied2).getDelegate().getExplicitValues().size());
    final AnnotationReference anno3 = IterableExtensions.head((((MutableFieldDeclaration[])Conversions.unwrapArray(it.getTypeLookup().findClass("MyClass").getDeclaredFields(), MutableFieldDeclaration.class))[2]).getAnnotations());
    final AnnotationReference copied3 = it.getAnnotationReferenceProvider().newAnnotationReference(anno3);
    Assert.assertEquals(1, ((JvmAnnotationReferenceImpl) copied3).getDelegate().getExplicitValues().size());
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
Example #12
Source File: CheckMutableFieldDeclarationProcessor.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void doTransform(final MutableFieldDeclaration annotatedField, @Extension final TransformationContext context) {
  final Procedure0 _function = () -> {
    annotatedField.setInitializer(((CompilationStrategy) null));
  };
  MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, "initializer cannot be null", _function);
  final Procedure0 _function_1 = () -> {
    annotatedField.setType(null);
  };
  MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, "type cannot be null", _function_1);
}
 
Example #13
Source File: DotAttributeProcessor.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
private List<Context> usedBy(MutableFieldDeclaration field) {
	List<Context> applicableContexts = new ArrayList<>();
	Matcher matcher = NAMING_PATTERN.matcher(field.getSimpleName());

	if (!matcher.matches()) {
		throw new IllegalArgumentException(
				"Field name does not match naming pattern "
						+ NAMING_PATTERN);
	}

	// determine which contexts apply
	if (!matcher.group(1).isEmpty()) {
		applicableContexts.add(Context.GRAPH);
	}
	if (!matcher.group(2).isEmpty()) {
		applicableContexts.add(Context.SUBGRAPH);
	}
	if (!matcher.group(3).isEmpty()) {
		applicableContexts.add(Context.CLUSTER);
	}
	if (!matcher.group(4).isEmpty()) {
		applicableContexts.add(Context.NODE);
	}
	if (!matcher.group(5).isEmpty()) {
		applicableContexts.add(Context.EDGE);
	}
	return applicableContexts;
}
 
Example #14
Source File: DotAttributeProcessor.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
private String attributeName(MutableFieldDeclaration field) {
	String rawValue = field.getInitializer().toString()
			.replaceAll("^\"|\"$", "");
	Matcher matcher = CAMEL_CASE_REPLACEMENT_PATTERN.matcher(rawValue);
	if (matcher.matches()) {
		return matcher.group(1) + toFirstUpper(matcher.group(2));
	}
	return rawValue;
}
 
Example #15
Source File: EqualsHashCodeProcessor.java    From xtext-lib with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void doTransform(final MutableClassDeclaration it, @Extension final TransformationContext context) {
  AnnotationReference _findAnnotation = it.findAnnotation(context.findTypeGlobally(Data.class));
  boolean _tripleNotEquals = (_findAnnotation != null);
  if (_tripleNotEquals) {
    return;
  }
  @Extension
  final EqualsHashCodeProcessor.Util util = new EqualsHashCodeProcessor.Util(context);
  boolean _hasEquals = util.hasEquals(it);
  if (_hasEquals) {
    final AnnotationReference annotation = it.findAnnotation(context.findTypeGlobally(EqualsHashCode.class));
    context.addWarning(annotation, "equals is already defined, this annotation has no effect");
  } else {
    boolean _hasHashCode = util.hasHashCode(it);
    if (_hasHashCode) {
      context.addWarning(it, "hashCode is already defined, this annotation has no effect");
    } else {
      final Function1<MutableFieldDeclaration, Boolean> _function = (MutableFieldDeclaration it_1) -> {
        return Boolean.valueOf((((!it_1.isStatic()) && (!it_1.isTransient())) && context.isThePrimaryGeneratedJavaElement(it_1)));
      };
      final Iterable<? extends MutableFieldDeclaration> fields = IterableExtensions.filter(it.getDeclaredFields(), _function);
      util.addEquals(it, fields, util.hasSuperEquals(it));
      util.addHashCode(it, fields, util.hasSuperHashCode(it));
    }
  }
}
 
Example #16
Source File: ToStringProcessor.java    From xtext-lib with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void doTransform(final MutableClassDeclaration it, @Extension final TransformationContext context) {
  AnnotationReference _findAnnotation = it.findAnnotation(context.findTypeGlobally(Data.class));
  boolean _tripleNotEquals = (_findAnnotation != null);
  if (_tripleNotEquals) {
    return;
  }
  @Extension
  final ToStringProcessor.Util util = new ToStringProcessor.Util(context);
  final AnnotationReference annotation = it.findAnnotation(context.findTypeGlobally(ToString.class));
  final ToStringConfiguration configuration = new ToStringConfiguration(annotation);
  boolean _hasToString = util.hasToString(it);
  if (_hasToString) {
    context.addWarning(annotation, "toString is already defined, this annotation has no effect.");
  } else {
    TypeReference _extendedClass = it.getExtendedClass();
    TypeReference _object = context.getObject();
    boolean _notEquals = (!Objects.equal(_extendedClass, _object));
    if (_notEquals) {
      util.addReflectiveToString(it, configuration);
    } else {
      final Function1<MutableFieldDeclaration, Boolean> _function = (MutableFieldDeclaration it_1) -> {
        return Boolean.valueOf(((context.isThePrimaryGeneratedJavaElement(it_1) && (!it_1.isStatic())) && (!it_1.isTransient())));
      };
      util.addToString(it, IterableExtensions.filter(it.getDeclaredFields(), _function), configuration);
    }
  }
}
 
Example #17
Source File: AccessorsProcessor.java    From xtext-lib with Eclipse Public License 2.0 5 votes vote down vote up
public void transform(final MutableMemberDeclaration it, final TransformationContext context) {
  if (it instanceof MutableClassDeclaration) {
    _transform((MutableClassDeclaration)it, context);
    return;
  } else if (it instanceof MutableFieldDeclaration) {
    _transform((MutableFieldDeclaration)it, context);
    return;
  } else {
    throw new IllegalArgumentException("Unhandled parameter types: " +
      Arrays.<Object>asList(it, context).toString());
  }
}
 
Example #18
Source File: AccessorsProcessor.java    From xtext-lib with Eclipse Public License 2.0 5 votes vote down vote up
public void validateSetter(final MutableFieldDeclaration field) {
  boolean _isFinal = field.isFinal();
  if (_isFinal) {
    this.context.addError(field, "Cannot set a final field");
  }
  if (((field.getType() == null) || field.getType().isInferred())) {
    this.context.addError(field, "Type cannot be inferred.");
    return;
  }
}
 
Example #19
Source File: AccessorsProcessor.java    From xtext-lib with Eclipse Public License 2.0 5 votes vote down vote up
private Object fieldOwner(final MutableFieldDeclaration it) {
  Object _xifexpression = null;
  boolean _isStatic = it.isStatic();
  if (_isStatic) {
    _xifexpression = this.context.newTypeReference(it.getDeclaringType());
  } else {
    _xifexpression = "this";
  }
  return _xifexpression;
}
 
Example #20
Source File: DotAttributeProcessor.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
private String rawGetterName(MutableFieldDeclaration field) {
	return getterName(field) + "Raw";
}
 
Example #21
Source File: DataProcessor.java    From xtext-lib with Eclipse Public License 2.0 4 votes vote down vote up
public Iterable<? extends MutableFieldDeclaration> getDataFields(final MutableClassDeclaration it) {
  final Function1<MutableFieldDeclaration, Boolean> _function = (MutableFieldDeclaration it_1) -> {
    return Boolean.valueOf(((!it_1.isStatic()) && this.context.isThePrimaryGeneratedJavaElement(it_1)));
  };
  return IterableExtensions.filter(it.getDeclaredFields(), _function);
}
 
Example #22
Source File: JsonRpcDataProcessor.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
protected CharSequence compileEitherSetterBody(final MutableFieldDeclaration field, final EitherTypeArgument argument, final String variableName, @Extension final CompilationStrategy.CompilationContext compilationContext, @Extension final JsonRpcDataTransformationContext context) {
  CharSequence _xblockexpression = null;
  {
    AnnotationReference _findAnnotation = field.findAnnotation(context.newTypeReference(NonNull.class).getType());
    final boolean hasNonNull = (_findAnnotation != null);
    final String newVariableName = ("_" + variableName);
    StringConcatenation _builder = new StringConcatenation();
    String _javaCode = compilationContext.toJavaCode(context.getEitherType());
    _builder.append(_javaCode);
    _builder.append(".for");
    {
      boolean _isRight = argument.isRight();
      if (_isRight) {
        _builder.append("Right");
      } else {
        _builder.append("Left");
      }
    }
    _builder.append("(");
    _builder.append(variableName);
    _builder.append(")");
    final CharSequence compileNewEither = _builder;
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("if (");
    _builder_1.append(variableName);
    _builder_1.append(" == null) {");
    _builder_1.newLineIfNotEmpty();
    {
      if (hasNonNull) {
        _builder_1.append("  ");
        TypeReference _preconditionsUtil = this.getPreconditionsUtil(field.getDeclaringType(), context);
        _builder_1.append(_preconditionsUtil, "  ");
        _builder_1.append(".checkNotNull(");
        _builder_1.append(variableName, "  ");
        _builder_1.append(", \"");
        String _simpleName = field.getSimpleName();
        _builder_1.append(_simpleName, "  ");
        _builder_1.append("\");");
        _builder_1.newLineIfNotEmpty();
      }
    }
    _builder_1.append("  ");
    _builder_1.append("this.");
    String _simpleName_1 = field.getSimpleName();
    _builder_1.append(_simpleName_1, "  ");
    _builder_1.append(" = null;");
    _builder_1.newLineIfNotEmpty();
    _builder_1.append("  ");
    _builder_1.append("return;");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    {
      EitherTypeArgument _parent = argument.getParent();
      boolean _tripleNotEquals = (_parent != null);
      if (_tripleNotEquals) {
        _builder_1.append("final ");
        String _javaCode_1 = compilationContext.toJavaCode(argument.getParent().getType());
        _builder_1.append(_javaCode_1);
        _builder_1.append(" ");
        _builder_1.append(newVariableName);
        _builder_1.append(" = ");
        _builder_1.append(compileNewEither);
        _builder_1.append(";");
        _builder_1.newLineIfNotEmpty();
        CharSequence _compileEitherSetterBody = this.compileEitherSetterBody(field, argument.getParent(), newVariableName, compilationContext, context);
        _builder_1.append(_compileEitherSetterBody);
        _builder_1.newLineIfNotEmpty();
      } else {
        _builder_1.append("this.");
        String _simpleName_2 = field.getSimpleName();
        _builder_1.append(_simpleName_2);
        _builder_1.append(" = ");
        _builder_1.append(compileNewEither);
        _builder_1.append(";");
        _builder_1.newLineIfNotEmpty();
      }
    }
    _xblockexpression = _builder_1;
  }
  return _xblockexpression;
}
 
Example #23
Source File: MutableJvmInterfaceDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Iterable<? extends MutableFieldDeclaration> getDeclaredFields() {
  Iterable<? extends FieldDeclaration> _declaredFields = super.getDeclaredFields();
  return ((Iterable<? extends MutableFieldDeclaration>) _declaredFields);
}
 
Example #24
Source File: MutableJvmInterfaceDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public MutableFieldDeclaration findDeclaredField(final String name) {
  FieldDeclaration _findDeclaredField = super.findDeclaredField(name);
  return ((MutableFieldDeclaration) _findDeclaredField);
}
 
Example #25
Source File: MutableJvmEnumerationTypeDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Iterable<? extends MutableFieldDeclaration> getDeclaredFields() {
  Iterable<? extends FieldDeclaration> _declaredFields = super.getDeclaredFields();
  return ((Iterable<? extends MutableFieldDeclaration>) _declaredFields);
}
 
Example #26
Source File: MutableJvmEnumerationTypeDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public MutableFieldDeclaration findDeclaredField(final String name) {
  FieldDeclaration _findDeclaredField = super.findDeclaredField(name);
  return ((MutableFieldDeclaration) _findDeclaredField);
}
 
Example #27
Source File: FinalFieldsConstructorProcessor.java    From xtext-lib with Eclipse Public License 2.0 4 votes vote down vote up
public Iterable<? extends MutableFieldDeclaration> getFinalFields(final MutableTypeDeclaration it) {
  final Function1<MutableFieldDeclaration, Boolean> _function = (MutableFieldDeclaration it_1) -> {
    return Boolean.valueOf(((((!it_1.isStatic()) && (it_1.isFinal() == true)) && (it_1.getInitializer() == null)) && this.context.isThePrimaryGeneratedJavaElement(it_1)));
  };
  return IterableExtensions.filter(it.getDeclaredFields(), _function);
}
 
Example #28
Source File: AccessorsProcessor.java    From xtext-lib with Eclipse Public License 2.0 4 votes vote down vote up
public Object validateGetter(final MutableFieldDeclaration field) {
  return null;
}
 
Example #29
Source File: MutableJvmClassDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Iterable<? extends MutableFieldDeclaration> getDeclaredFields() {
  Iterable<? extends FieldDeclaration> _declaredFields = super.getDeclaredFields();
  return ((Iterable<? extends MutableFieldDeclaration>) _declaredFields);
}
 
Example #30
Source File: MutableJvmClassDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public MutableFieldDeclaration findDeclaredField(final String name) {
  FieldDeclaration _findDeclaredField = super.findDeclaredField(name);
  return ((MutableFieldDeclaration) _findDeclaredField);
}