/* * Copyright (C) 2007 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 com.android.dx.cf.iface; import com.android.dx.rop.cst.ConstantPool; import com.android.dx.rop.cst.CstType; import com.android.dx.rop.cst.CstUtf8; import com.android.dx.rop.type.TypeList; /** * Interface for things which purport to be class files or reasonable * facsimiles thereof. * *

Note: The fields referred to in this documentation are of the * ClassFile structure defined in vmspec-2 sec4.1. */ public interface ClassFile { /** * Gets the field magic. * * @return the value in question */ public int getMagic(); /** * Gets the field minor_version. * * @return the value in question */ public int getMinorVersion(); /** * Gets the field major_version. * * @return the value in question */ public int getMajorVersion(); /** * Gets the field access_flags. * * @return the value in question */ public int getAccessFlags(); /** * Gets the field this_class, interpreted as a type constant. * * @return non-null; the value in question */ public CstType getThisClass(); /** * Gets the field super_class, interpreted as a type constant * if non-zero. * * @return null-ok; the value in question */ public CstType getSuperclass(); /** * Gets the field constant_pool (along with * constant_pool_count). * * @return non-null; the constant pool */ public ConstantPool getConstantPool(); /** * Gets the field interfaces (along with * interfaces_count). * * @return non-null; the list of interfaces */ public TypeList getInterfaces(); /** * Gets the field fields (along with * fields_count). * * @return non-null; the list of fields */ public FieldList getFields(); /** * Gets the field methods (along with * methods_count). * * @return non-null; the list of fields */ public MethodList getMethods(); /** * Gets the field attributes (along with * attributes_count). * * @return non-null; the list of attributes */ public AttributeList getAttributes(); /** * Gets the name out of the SourceFile attribute of this * file, if any. This is a convenient shorthand for scrounging around * the class's attributes. * * @return non-null; the constant pool */ public CstUtf8 getSourceFile(); }