Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7177077b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove unused @InspectableNodeName"

parents 1dd20206 b948bcd4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -53507,7 +53507,6 @@ package android.view.inputmethod {
package android.view.inspector {
  public interface InspectionCompanion<T> {
    method @Nullable public default String getNodeName();
    method public void mapProperties(@NonNull android.view.inspector.PropertyMapper);
    method public void readProperties(@NonNull T, @NonNull android.view.inspector.PropertyReader);
  }
+0 −4
Original line number Diff line number Diff line
@@ -3186,10 +3186,6 @@ package android.view.inputmethod {

package android.view.inspector {

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public @interface InspectableNodeName {
    method public abstract String value();
  }

  @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD}) public @interface InspectableProperty {
    method public abstract int attributeId() default android.content.res.Resources.ID_NULL;
    method public abstract android.view.inspector.InspectableProperty.EnumEntry[] enumMapping() default {};
+0 −52
Original line number Diff line number Diff line
/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.view.inspector;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.SOURCE;

import android.annotation.TestApi;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * Marks the node name to display to a developer in the inspection tree.
 *
 * This annotation is optional to marking a class as inspectable. If it is omitted, the node name
 * will be inferred using the semantics of {@link Class#getSimpleName()}. The fully qualified class
 * name is always available in the tree, this is for display purposes only. If a class is inflated
 * from XML and the tag it inflates from does not match its simple name, this annotation should be
 * used to inform the inspector to display the XML tag name in the inspection tree view.
 *
 * This annotation does not inherit. If a class extends an annotated parent class, but does not
 * annotate itself, its node name will be inferred from its Java name.
 *
 * @see InspectionCompanion#getNodeName()
 * @hide
 */
@Target({TYPE})
@Retention(SOURCE)
@TestApi
public @interface InspectableNodeName {
    /**
     * The display name for nodes of this type.
     *
     * @return The name for nodes of this type
     */
    String value();
}
+0 −22
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.view.inspector;

import android.annotation.NonNull;
import android.annotation.Nullable;

/**
 * An interface for companion objects used to inspect views.
@@ -33,11 +32,6 @@ import android.annotation.Nullable;
 * parent class via the parent's inspection companion, and the child companion will only read
 * properties added or changed since the parent was defined.
 *
 * Only one child traversal is considered for each class. If a descendant class defines a
 * different child traversal than its parent, only the bottom traversal is used. If a class does
 * not define its own child traversal, but one of its ancestors does, the bottom-most ancestor's
 * traversal will be used.
 *
 * @param <T> The type of inspectable this is the companion to
 */
public interface InspectionCompanion<T> {
@@ -67,22 +61,6 @@ public interface InspectionCompanion<T> {
     */
    void readProperties(@NonNull T inspectable, @NonNull PropertyReader propertyReader);

    /**
     * Get an optional name to display to developers for inspection nodes of this companion's type.
     *
     * The default implementation returns null, which will cause the runtime to use the class's
     * simple name as defined by {@link Class#getSimpleName()} as the node name.
     *
     * If the type of this companion is inflated from XML, this method should be overridden to
     * return the string used as the tag name for this type in XML.
     *
     * @return A string to use as the node name, or null to use the simple class name fallback.
     */
    @Nullable
    default String getNodeName() {
        return null;
    }

    /**
     * Thrown by {@link #readProperties(Object, PropertyReader)} if called before
     * {@link #mapProperties(PropertyMapper)}.
+0 −10
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import java.util.Optional;
public final class InspectableClassModel {
    private final @NonNull ClassName mClassName;
    private final @NonNull Map<String, Property> mPropertyMap;
    private @NonNull Optional<String> mNodeName = Optional.empty();

    /**
     * @param className The name of the modeled class
@@ -54,15 +53,6 @@ public final class InspectableClassModel {
        return mClassName;
    }

    @NonNull
    public Optional<String> getNodeName() {
        return mNodeName;
    }

    public void setNodeName(@NonNull Optional<String> nodeName) {
        mNodeName = nodeName;
    }

    /**
     * Add a property to the model, replacing an existing property of the same name.
     *
Loading