1c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver/*
2c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * Copyright 2012, Google Inc.
3c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * All rights reserved.
4c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver *
5c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * Redistribution and use in source and binary forms, with or without
6c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * modification, are permitted provided that the following conditions are
7c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * met:
8c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver *
9c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver *     * Redistributions of source code must retain the above copyright
10c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * notice, this list of conditions and the following disclaimer.
11c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver *     * Redistributions in binary form must reproduce the above
12c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * copyright notice, this list of conditions and the following disclaimer
13c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * in the documentation and/or other materials provided with the
14c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * distribution.
15c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver *     * Neither the name of Google Inc. nor the names of its
16c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * contributors may be used to endorse or promote products derived from
17c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * this software without specific prior written permission.
18c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver *
19c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver */
31c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver
32c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruverpackage org.jf.dexlib2.iface;
33c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver
34bfe20a295d95301f9aa470c17df03e5370e8e437Ben Gruverimport org.jf.dexlib2.iface.debug.LocalInfo;
35b7b15efc03b6fbd158a40fe2bbd95df37432f826Ben Gruverimport org.jf.dexlib2.iface.reference.TypeReference;
36bfe20a295d95301f9aa470c17df03e5370e8e437Ben Gruver
37c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruverimport javax.annotation.Nonnull;
38bfe20a295d95301f9aa470c17df03e5370e8e437Ben Gruverimport javax.annotation.Nullable;
3922c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruverimport java.util.Set;
40c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver
4122c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver/**
4222c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver * This class represents a method parameter.
4322c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver *
4422c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver * It also acts as a TypeReference to the type of this parameter. Any equality/comparison is based on its identity as a
4522c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver * TypeReference, and should not take into account any details other than the parameter type.
4622c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver *
4722c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver * It also acts as a LocalInfo object, and conceptually defines the debug information for any parameter register at the
4822c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver * beginning of the method.
4922c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver */
50b7b15efc03b6fbd158a40fe2bbd95df37432f826Ben Gruverpublic interface MethodParameter extends TypeReference, LocalInfo {
5122c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver    /**
5222c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * The type of this method parameter.
5322c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     *
5422c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * This may be any type, including primitive or array types, other than the void (V) type.
5522c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     *
5622c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * @return The type of this method parameter
5722c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     */
58c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver    @Nonnull String getType();
5922c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver
6022c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver    /**
6122c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * Gets a set of the annotations that are applied to this parameter.
6222c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     *
6322c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * The annotations in the returned set are guaranteed to have unique types.
6422c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     *
6522c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * @return A set of the annotations that are applied to this parameter
6622c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     */
6722c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver    @Nonnull Set<? extends Annotation> getAnnotations();
6822c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver
6922c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver    /**
7022c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * Gets the name of this parameter, if available.
7122c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     *
7222c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * @return The name of this parameter, or null if the name is not available.
7322c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     */
74bfe20a295d95301f9aa470c17df03e5370e8e437Ben Gruver    @Nullable String getName();
7522c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver
7622c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver    /**
7722c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * Gets the signature of this parameter, if available.
7822c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     *
7922c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * The signature of a parameter is defined to be the concatenated version of the dalvik.annotation.Signature
8022c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * annotation applied to this parameter, or null if there is no dalvik.annotation.Signature annotation.
8122c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     *
8222c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     * @return The signature of this parameter, or null if not available
8322c3185bb7c8618437eabe6c597549e0989ec4e6Ben Gruver     */
84bfe20a295d95301f9aa470c17df03e5370e8e437Ben Gruver    @Nullable String getSignature();
85c05d8d40e0160037cd2294dbcd82ba3101d9a834Ben Gruver}
86