History log of /frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
11df39c91611b9ff2d7c87a9a9829251a015bccf 16-Mar-2016 George Mount <mount@google.com> Added simple inverted String conversion.

When binding a primitive to an EditText, a common
pattern is to use '@{"" + value}'. This, however,
doesn't allow for a two-way data binding expressions.
To mitigate the need for conversion functions, a simple
inversion for this expression wsa implemented that
just converts value from a String when possible.

This CL also fixes a bug in which a method matching
the first parameter was always chosen, reguardless of
the second and further parameters.

Change-Id: I36828d9f54d2073965358fceb140b2d5e6328919
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java
bb4a033fcd5cd20e5be46ef8ead442dc7db2454d 18-Feb-2016 George Mount <mount@google.com> Have two-way binding use localized variables to prevent NPE.

Bug 26962999

Two-way binding was using the inverted expressions directly
without localizing variables. That meant that if there was
a variable set to null during evaluation, it may get a
NullPointerException even though it checked for null
on the value previously. This CL localizes the variables
so that cannot happen.

Change-Id: Ia55955ce0f1cb750e6a678e72e0cda03f0e3c9b6
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java
6047998943beebd81e0ae1068df39c0cbee38628 02-Feb-2016 Yigit Boyar <yboyar@google.com> Lambda In da house

This CL adds support for assigning callbacks to listeners using lambda expressions.
These expressions can receive either 0 or N arguments where N is equal to the
number of parameters in the callback function.

These expressions are evaluated when the callback is invoked. In other words, they
are independent from the rest of the ExprModel except the Identifier expressions.

Since these are limited to 1 full expression and they don't have any invalidation
flags; we use a verbose branching code generation mode where we calculate all possible
execution paths, eliminate trivial ones and generate the code. This allows callbacks
to be thread safe as well. See ExecutionPath class for details.
It is not efficient but since these are rere occasions, should be OK.

Callback expressions are still forced to be expressions that return value. To handle
`void` case, I've added `void` and `Void` as acceptable symbols. Also, if the callback
method returns void, the expression is free to return `void` or any other value.
¯\\_(ツ)_/¯

I've also moved kotlin to rc0. Although rc0 is unrelated to this task, it made more
sense to upgrade here because most changes it will ask for were already done in
this branch.

Bug: 26849440
Change-Id: I805b3d470f85df9c2ce3f3ed5ca74925a08bb7a5
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java
91beb3a1a89a58b1c0b6b874d889394a3be90b6c 06-Aug-2015 George Mount <mount@google.com> Fix ternary operator with null assigned to listener.

Bug 22907244

When finding a common type, null is an Object and
the listener is an interface, so the types don't
match.

Change-Id: I0c5a88ec02230767b894b2feda17a1a1c8cef9f7
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java
2611838bffef5a009ca71e3e9e59a93f29b098ed 24-Jun-2015 Yigit Boyar <yboyar@google.com> Remove guava from compiler

This CL removes all dependency from guava and replaces it w/ either plain
java or some utilities.

Bug: 22047836
Change-Id: I94be54ed992ab6b5f27c47a8cf400ae60aef02f8
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java
924fa7c597694ebc433fc0379d0015785351d1b7 23-Jun-2015 Yigit Boyar <yboyar@google.com> Fix compiler tests

Compiler tests were broken after the parcelable change.
JavaClassLoader cannot access Parcelable when resolving ObservableXX
from the library. Compiler tests do not need to resolve Observables
so in this CL I override the related method to avoid trying to
load them.
I've also removed the requirement to deploy a libraryJar from the
library. Instead, compiler will directly include the library
sources when it is being compiled for tests.
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java
d37b47419005587c52ca4c099432327b7f06478d 19-Jun-2015 Yigit Boyar <yboyar@google.com> Make observables parcelable

We got some feedback where people want to keep their View presenter
classes parcelable. This CL makes observables parcelable and
their lists transient to allow this.

Bug: 21785040
Change-Id: I76adc7d7ca3876c83fd8749f6dbcf02a926c97c2
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java
de38dd3ef0577d25b2d59863603abe5750d0c231 28-Mar-2015 George Mount <mount@google.com> Make ViewStub support binding variables like include.

Bug 19969378
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java
fead9ca09b117136b35bc5bf137340a754f9eddd 23-Mar-2015 George Mount <mount@google.com> Move to package android.databinding.
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/ModelAnalyzer.java