1 /* 2 * Copyright (C) 2007 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.dx.cf.iface; 18 19 import com.android.dx.util.ByteArray; 20 21 /** 22 * Observer of parsing in action. This is used to supply feedback from 23 * the various things that parse particularly to the dumping utilities. 24 */ 25 public interface ParseObserver { 26 /** 27 * Indicate that the level of indentation for a dump should increase 28 * or decrease (positive or negative argument, respectively). 29 * 30 * @param indentDelta the amount to change indentation 31 */ changeIndent(int indentDelta)32 public void changeIndent(int indentDelta); 33 34 /** 35 * Indicate that a particular member is now being parsed. 36 * 37 * @param bytes {@code non-null;} the source that is being parsed 38 * @param offset offset into {@code bytes} for the start of the 39 * member 40 * @param name {@code non-null;} name of the member 41 * @param descriptor {@code non-null;} descriptor of the member 42 */ startParsingMember(ByteArray bytes, int offset, String name, String descriptor)43 public void startParsingMember(ByteArray bytes, int offset, String name, 44 String descriptor); 45 46 /** 47 * Indicate that a particular member is no longer being parsed. 48 * 49 * @param bytes {@code non-null;} the source that was parsed 50 * @param offset offset into {@code bytes} for the end of the 51 * member 52 * @param name {@code non-null;} name of the member 53 * @param descriptor {@code non-null;} descriptor of the member 54 * @param member {@code non-null;} the actual member that was parsed 55 */ endParsingMember(ByteArray bytes, int offset, String name, String descriptor, Member member)56 public void endParsingMember(ByteArray bytes, int offset, String name, 57 String descriptor, Member member); 58 59 /** 60 * Indicate that some parsing happened. 61 * 62 * @param bytes {@code non-null;} the source that was parsed 63 * @param offset offset into {@code bytes} for what was parsed 64 * @param len number of bytes parsed 65 * @param human {@code non-null;} human form for what was parsed 66 */ parsed(ByteArray bytes, int offset, int len, String human)67 public void parsed(ByteArray bytes, int offset, int len, String human); 68 } 69