You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

KnownFieldReference.java 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Common Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/cpl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler.ast;
  13. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
  14. import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
  15. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
  16. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
  17. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
  18. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
  19. public class KnownFieldReference extends QualifiedNameReference {
  20. //XXX handle source locations
  21. public KnownFieldReference(FieldBinding binding, long pos) {
  22. super(new char[][] {binding.name},new long[1], 0, 0);
  23. this.binding = this.codegenBinding = binding;
  24. this.constant = Constant.NotAConstant;
  25. this.actualReceiverType = binding.declaringClass;
  26. this.bits = Binding.FIELD;
  27. //this.receiver = AstUtil.makeTypeReference(binding.declaringClass);
  28. }
  29. public TypeBinding resolveType(BlockScope scope) {
  30. return fieldBinding().type;
  31. }
  32. }