summaryrefslogtreecommitdiff
path: root/compiler/src/main/java/android/databinding/tool/reflection
diff options
context:
space:
mode:
authorEsteban de la Canal <estebandlc@google.com>2016-09-28 19:19:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-09-28 19:19:54 +0000
commit83bcfb874866a2f6f74f7700fe2c67f0af2a3c20 (patch)
tree4049367484c8bd2f81338e2dc260c705b60edbf6 /compiler/src/main/java/android/databinding/tool/reflection
parent33c0fd970325ee1ba47a68842bc20bb26506ddab (diff)
parent729298e98a96730a9fbcf8c1d2575a8f0da7cc70 (diff)
downloaddata-binding-83bcfb874866a2f6f74f7700fe2c67f0af2a3c20.tar.gz
Merge "Revert "Add support for dependent bindable properties."" into studio-master-dev
Diffstat (limited to 'compiler/src/main/java/android/databinding/tool/reflection')
-rw-r--r--compiler/src/main/java/android/databinding/tool/reflection/Callable.java7
-rw-r--r--compiler/src/main/java/android/databinding/tool/reflection/InjectedField.java7
-rw-r--r--compiler/src/main/java/android/databinding/tool/reflection/InjectedMethod.java7
-rw-r--r--compiler/src/main/java/android/databinding/tool/reflection/ModelClass.java13
-rw-r--r--compiler/src/main/java/android/databinding/tool/reflection/ModelField.java7
-rw-r--r--compiler/src/main/java/android/databinding/tool/reflection/ModelMethod.java5
-rw-r--r--compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationField.java5
-rw-r--r--compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationMethod.java5
8 files changed, 4 insertions, 52 deletions
diff --git a/compiler/src/main/java/android/databinding/tool/reflection/Callable.java b/compiler/src/main/java/android/databinding/tool/reflection/Callable.java
index 54db94e3..5088523d 100644
--- a/compiler/src/main/java/android/databinding/tool/reflection/Callable.java
+++ b/compiler/src/main/java/android/databinding/tool/reflection/Callable.java
@@ -15,8 +15,6 @@
*/
package android.databinding.tool.reflection;
-import android.databinding.Bindable;
-
import org.jetbrains.annotations.Nullable;
public class Callable {
@@ -44,10 +42,8 @@ public class Callable {
private final int mParameterCount;
- public final Bindable bindableAnnotation;
-
public Callable(Type type, String name, String setterName, ModelClass resolvedType,
- int parameterCount, int flags, ModelMethod method, Bindable bindable) {
+ int parameterCount, int flags, ModelMethod method) {
this.type = type;
this.name = name;
this.resolvedType = resolvedType;
@@ -55,7 +51,6 @@ public class Callable {
this.setterName = setterName;
mFlags = flags;
this.method = method;
- this.bindableAnnotation = bindable;
}
public String getTypeCodeName() {
diff --git a/compiler/src/main/java/android/databinding/tool/reflection/InjectedField.java b/compiler/src/main/java/android/databinding/tool/reflection/InjectedField.java
index 985962d9..85719f1c 100644
--- a/compiler/src/main/java/android/databinding/tool/reflection/InjectedField.java
+++ b/compiler/src/main/java/android/databinding/tool/reflection/InjectedField.java
@@ -16,8 +16,6 @@
package android.databinding.tool.reflection;
-import android.databinding.Bindable;
-
import java.util.Map;
/**
@@ -64,9 +62,4 @@ public class InjectedField extends ModelField {
public ModelClass getFieldType() {
return ModelAnalyzer.getInstance().findClass(mType, null);
}
-
- @Override
- public Bindable getBindableAnnotation() {
- return null;
- }
}
diff --git a/compiler/src/main/java/android/databinding/tool/reflection/InjectedMethod.java b/compiler/src/main/java/android/databinding/tool/reflection/InjectedMethod.java
index 726673f2..f47442b7 100644
--- a/compiler/src/main/java/android/databinding/tool/reflection/InjectedMethod.java
+++ b/compiler/src/main/java/android/databinding/tool/reflection/InjectedMethod.java
@@ -16,8 +16,6 @@
package android.databinding.tool.reflection;
-import android.databinding.Bindable;
-
import java.util.List;
import java.util.Map;
@@ -110,11 +108,6 @@ public class InjectedMethod extends ModelMethod {
}
@Override
- public Bindable getBindableAnnotation() {
- return null;
- }
-
- @Override
public int getMinApi() {
return 0;
}
diff --git a/compiler/src/main/java/android/databinding/tool/reflection/ModelClass.java b/compiler/src/main/java/android/databinding/tool/reflection/ModelClass.java
index d408405e..813b72e1 100644
--- a/compiler/src/main/java/android/databinding/tool/reflection/ModelClass.java
+++ b/compiler/src/main/java/android/databinding/tool/reflection/ModelClass.java
@@ -15,7 +15,6 @@
*/
package android.databinding.tool.reflection;
-import android.databinding.Bindable;
import android.databinding.tool.reflection.Callable.Type;
import android.databinding.tool.util.L;
import android.databinding.tool.util.StringUtils;
@@ -418,7 +417,7 @@ public abstract class ModelClass {
public Callable findGetterOrField(String name, boolean staticOnly) {
if ("length".equals(name) && isArray()) {
return new Callable(Type.FIELD, name, null,
- ModelAnalyzer.getInstance().loadPrimitive("int"), 0, 0, null, null);
+ ModelAnalyzer.getInstance().loadPrimitive("int"), 0, 0, null);
}
String capitalized = StringUtils.capitalize(name);
String[] methodNames = {
@@ -436,10 +435,8 @@ public abstract class ModelClass {
if (method.isStatic()) {
flags |= STATIC;
}
- final Bindable bindable;
if (method.isBindable()) {
flags |= CAN_BE_INVALIDATED;
- bindable = method.getBindableAnnotation();
} else {
// if method is not bindable, look for a backing field
final ModelField backingField = getField(name, true, method.isStatic());
@@ -447,16 +444,13 @@ public abstract class ModelClass {
backingField == null ? "NOT FOUND" : backingField.getName());
if (backingField != null && backingField.isBindable()) {
flags |= CAN_BE_INVALIDATED;
- bindable = backingField.getBindableAnnotation();
- } else {
- bindable = null;
}
}
final ModelMethod setterMethod = findSetter(method, name);
final String setterName = setterMethod == null ? null : setterMethod.getName();
final Callable result = new Callable(Callable.Type.METHOD, methodName,
setterName, method.getReturnType(null), method.getParameterTypes().length,
- flags, method, bindable);
+ flags, method);
return result;
}
}
@@ -490,8 +484,7 @@ public abstract class ModelClass {
if (publicField.isBindable()) {
flags |= CAN_BE_INVALIDATED;
}
- return new Callable(Callable.Type.FIELD, name, setterFieldName, fieldType, 0, flags, null,
- publicField.getBindableAnnotation());
+ return new Callable(Callable.Type.FIELD, name, setterFieldName, fieldType, 0, flags, null);
}
public ModelMethod findInstanceGetter(String name) {
diff --git a/compiler/src/main/java/android/databinding/tool/reflection/ModelField.java b/compiler/src/main/java/android/databinding/tool/reflection/ModelField.java
index a0a4b370..0cde85b0 100644
--- a/compiler/src/main/java/android/databinding/tool/reflection/ModelField.java
+++ b/compiler/src/main/java/android/databinding/tool/reflection/ModelField.java
@@ -15,8 +15,6 @@
*/
package android.databinding.tool.reflection;
-import android.databinding.Bindable;
-
public abstract class ModelField {
/**
@@ -48,9 +46,4 @@ public abstract class ModelField {
* @return The declared type of the field variable.
*/
public abstract ModelClass getFieldType();
-
- /**
- * @return the Bindable annotation on the field or null if there isn't one.
- */
- public abstract Bindable getBindableAnnotation();
}
diff --git a/compiler/src/main/java/android/databinding/tool/reflection/ModelMethod.java b/compiler/src/main/java/android/databinding/tool/reflection/ModelMethod.java
index ac3f8e4d..01500706 100644
--- a/compiler/src/main/java/android/databinding/tool/reflection/ModelMethod.java
+++ b/compiler/src/main/java/android/databinding/tool/reflection/ModelMethod.java
@@ -44,11 +44,6 @@ public abstract class ModelMethod {
public abstract boolean isBindable();
/**
- * @return the Bindable annotation on the method or null if it doesn't exist.
- */
- public abstract Bindable getBindableAnnotation();
-
- /**
* Since when this method is available. Important for Binding expressions so that we don't
* call non-existing APIs when setting UI.
*
diff --git a/compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationField.java b/compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationField.java
index be860570..9373c6c9 100644
--- a/compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationField.java
+++ b/compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationField.java
@@ -70,11 +70,6 @@ class AnnotationField extends ModelField {
}
@Override
- public Bindable getBindableAnnotation() {
- return mField.getAnnotation(Bindable.class);
- }
-
- @Override
public boolean equals(Object obj) {
if (obj instanceof AnnotationField) {
AnnotationField that = (AnnotationField) obj;
diff --git a/compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationMethod.java b/compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationMethod.java
index 839aa282..66c1dbc5 100644
--- a/compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationMethod.java
+++ b/compiler/src/main/java/android/databinding/tool/reflection/annotation/AnnotationMethod.java
@@ -147,11 +147,6 @@ class AnnotationMethod extends ModelMethod {
}
@Override
- public Bindable getBindableAnnotation() {
- return mExecutableElement.getAnnotation(Bindable.class);
- }
-
- @Override
public int getMinApi() {
if (mApiLevel == -1) {
mApiLevel = SdkUtil.getMinApi(this);