summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-08-12 10:15:30 +0000
committeraclement <aclement>2005-08-12 10:15:30 +0000
commita4e1d6751e7875982992a81e02a6468af692b5c8 (patch)
tree284532442f2b76e527a58ca15209fece881c42d6
parent63c1e34ad3e05449d037f77b979acb9f37fb69a6 (diff)
downloadaspectj-a4e1d6751e7875982992a81e02a6468af692b5c8.tar.gz
aspectj-a4e1d6751e7875982992a81e02a6468af692b5c8.zip
genericitds: fields using target types tvars: New parameterization class that wraps an intertype field binding, like the one that wraps a normal field binding
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/ParameterizedInterTypeFieldBinding.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/ParameterizedInterTypeFieldBinding.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/ParameterizedInterTypeFieldBinding.java
new file mode 100644
index 000000000..55eaee1b9
--- /dev/null
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/ParameterizedInterTypeFieldBinding.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2005 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.ajdt.internal.compiler.lookup;
+
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedFieldBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SyntheticMethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+
+/**
+ * Like the Eclipse type ParameterizedFieldBinding which wraps a FieldBinding, making
+ * it appear as a particular parameterized form, this type wraps an InterTypeFieldBinding
+ * delegating to the InterTypeFieldBinding for answering some questions about visibility
+ * and access methods.
+ */
+public class ParameterizedInterTypeFieldBinding extends ParameterizedFieldBinding {
+
+ public ParameterizedInterTypeFieldBinding(ParameterizedTypeBinding parameterizedDeclaringClass, FieldBinding originalField) {
+ super(parameterizedDeclaringClass, originalField);
+ }
+
+ /*
+ * These methods override the supertypes methods and delegate to the original
+ * field binding which is an InterTypeFieldBinding.
+ */
+
+ public boolean canBeSeenBy(TypeBinding receiverType, InvocationSite invocationSite, Scope scope) {
+ return originalField.canBeSeenBy(receiverType, invocationSite, scope);
+ }
+
+ public SyntheticMethodBinding getAccessMethod(boolean isReadAccess) {
+ return originalField.getAccessMethod(isReadAccess);
+ }
+
+ public boolean alwaysNeedsAccessMethod(boolean isReadAccess) {
+ return originalField.alwaysNeedsAccessMethod(isReadAccess);
+ }
+
+ public ReferenceBinding getTargetType() {
+ return ((InterTypeFieldBinding)originalField).getTargetType();
+ }
+
+}