1612997fe2e41366573855f56898b27d4c8787244George Mount/*
2612997fe2e41366573855f56898b27d4c8787244George Mount * Copyright (C) 2015 The Android Open Source Project
3612997fe2e41366573855f56898b27d4c8787244George Mount *
4612997fe2e41366573855f56898b27d4c8787244George Mount * Licensed under the Apache License, Version 2.0 (the "License");
5612997fe2e41366573855f56898b27d4c8787244George Mount * you may not use this file except in compliance with the License.
6612997fe2e41366573855f56898b27d4c8787244George Mount * You may obtain a copy of the License at
7612997fe2e41366573855f56898b27d4c8787244George Mount *
8612997fe2e41366573855f56898b27d4c8787244George Mount *      http://www.apache.org/licenses/LICENSE-2.0
9612997fe2e41366573855f56898b27d4c8787244George Mount *
10612997fe2e41366573855f56898b27d4c8787244George Mount * Unless required by applicable law or agreed to in writing, software
11612997fe2e41366573855f56898b27d4c8787244George Mount * distributed under the License is distributed on an "AS IS" BASIS,
12612997fe2e41366573855f56898b27d4c8787244George Mount * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13612997fe2e41366573855f56898b27d4c8787244George Mount * See the License for the specific language governing permissions and
14612997fe2e41366573855f56898b27d4c8787244George Mount * limitations under the License.
15612997fe2e41366573855f56898b27d4c8787244George Mount */
16fead9ca09b117136b35bc5bf137340a754f9edddGeorge Mountpackage android.databinding;
17612997fe2e41366573855f56898b27d4c8787244George Mount
18d3f2b9229472c9dae9bf4ae8b3e2d653b5653b01George Mountimport java.lang.annotation.ElementType;
19d3f2b9229472c9dae9bf4ae8b3e2d653b5653b01George Mountimport java.lang.annotation.Target;
20d3f2b9229472c9dae9bf4ae8b3e2d653b5653b01George Mount
21c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount/**
22c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount * Used within an {@link BindingMethods} annotation to describe a renaming of an attribute to
23c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount * the setter used to set that attribute. By default, an attribute attr will be associated with
24c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount * setter setAttr.
25c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount */
26d3f2b9229472c9dae9bf4ae8b3e2d653b5653b01George Mount@Target(ElementType.ANNOTATION_TYPE)
273561e3e665698843b1c664385a842e779198960bGeorge Mountpublic @interface BindingMethod {
28c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount
29c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount    /**
30c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount     * @return the View Class that the attribute is associated with.
31c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount     */
32c619d8f69127c1200103d8119101c5f0675661d0George Mount    Class type();
33c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount
34c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount    /**
35c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount     * @return The attribute to rename. Use android: namespace for all android attributes or
36c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount     * no namespace for application attributes.
37c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount     */
38612997fe2e41366573855f56898b27d4c8787244George Mount    String attribute();
39c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount
40c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount    /**
41c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount     * @return The method to call to set the attribute value.
42c9a5d6f140f732ca0ff279a4b1ee315072e1c422George Mount     */
433561e3e665698843b1c664385a842e779198960bGeorge Mount    String method();
44612997fe2e41366573855f56898b27d4c8787244George Mount}
45