private static void dumpNode()

in AutofillFramework/Application/src/main/java/com/example/android/autofill/app/Util.java [106:153]


    private static void dumpNode(String prefix, ViewNode node) {
        StringBuilder builder = new StringBuilder();
        builder.append(prefix)
                .append("autoFillId: ").append(node.getAutofillId())
                .append("\tidEntry: ").append(node.getIdEntry())
                .append("\tid: ").append(node.getId())
                .append("\tclassName: ").append(node.getClassName())
                .append('\n');

        builder.append(prefix)
                .append("focused: ").append(node.isFocused())
                .append("\tvisibility").append(node.getVisibility())
                .append("\tchecked: ").append(node.isChecked())
                .append("\twebDomain: ").append(node.getWebDomain())
                .append("\thint: ").append(node.getHint())
                .append('\n');

        HtmlInfo htmlInfo = node.getHtmlInfo();

        if (htmlInfo != null) {
            builder.append(prefix)
                    .append("HTML TAG: ").append(htmlInfo.getTag())
                    .append(" attrs: ").append(htmlInfo.getAttributes())
                    .append('\n');
        }

        String[] afHints = node.getAutofillHints();
        CharSequence[] options = node.getAutofillOptions();
        builder.append(prefix).append("afType: ").append(getAutofillTypeAsString(node.getAutofillType()))
                .append("\tafValue:")
                .append(getAutofillValueAndTypeAsString(node.getAutofillValue()))
                .append("\tafOptions:").append(options == null ? "N/A" : Arrays.toString(options))
                .append("\tafHints: ").append(afHints == null ? "N/A" : Arrays.toString(afHints))
                .append("\tinputType:").append(node.getInputType())
                .append('\n');

        int numberChildren = node.getChildCount();
        builder.append(prefix).append("# children: ").append(numberChildren)
                .append("\ttext: ").append(node.getText())
                .append('\n');

        Log.v(TAG, builder.toString());
        final String prefix2 = prefix + "  ";
        for (int i = 0; i < numberChildren; i++) {
            Log.v(TAG, prefix + "child #" + i);
            dumpNode(prefix2, node.getChildAt(i));
        }
    }