4 */ 5 /* 6 * Licensed to the Apache Software Foundation (ASF) under one or more 7 * contributor license agreements. See the NOTICE file distributed with 8 * this work for additional information regarding copyright ownership. 9 * The ASF licenses this file to You under the Apache License, Version 2.0 10 * (the "License"); you may not use this file except in compliance with 11 * the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22 package com.sun.org.apache.bcel.internal.classfile; 23 24 25 import com.sun.org.apache.bcel.internal.Constants; 26 import java.io.*; 27 28 /** 29 * This class represents a constant pool reference to a method. 30 * 31 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> 32 */ 33 public final class ConstantMethodref extends ConstantCP { 34 /** 35 * Initialize from another object. 36 */ 37 public ConstantMethodref(ConstantMethodref c) { 38 super(Constants.CONSTANT_Methodref, c.getClassIndex(), c.getNameAndTypeIndex()); 39 } 40 41 /** 42 * Initialize instance from file data. 43 * 44 * @param file input stream 45 * @throws IOException 46 */ 47 ConstantMethodref(DataInputStream file) throws IOException 48 { 49 super(Constants.CONSTANT_Methodref, file); 50 } 51 52 /** 53 * @param class_index Reference to the class containing the method 54 * @param name_and_type_index and the method signature 55 */ 56 public ConstantMethodref(int class_index, 57 int name_and_type_index) { 58 super(Constants.CONSTANT_Methodref, class_index, name_and_type_index); 59 } 60 61 /** 62 * Called by objects that are traversing the nodes of the tree implicitely 63 * defined by the contents of a Java class. I.e., the hierarchy of methods, 64 * fields, attributes, etc. spawns a tree of objects. 65 * 66 * @param v Visitor object 67 */ 68 public void accept(Visitor v) { 69 v.visitConstantMethodref(this); 70 } 71 } | 4 */ 5 /* 6 * Licensed to the Apache Software Foundation (ASF) under one or more 7 * contributor license agreements. See the NOTICE file distributed with 8 * this work for additional information regarding copyright ownership. 9 * The ASF licenses this file to You under the Apache License, Version 2.0 10 * (the "License"); you may not use this file except in compliance with 11 * the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22 package com.sun.org.apache.bcel.internal.classfile; 23 24 import java.io.DataInput; 25 import java.io.IOException; 26 27 import com.sun.org.apache.bcel.internal.Const; 28 29 /** 30 * This class represents a constant pool reference to a method. 31 * 32 * @version $Id: ConstantMethodref.java 1747278 2016-06-07 17:28:43Z britter $ 33 */ 34 public final class ConstantMethodref extends ConstantCP { 35 36 /** 37 * Initialize from another object. 38 */ 39 public ConstantMethodref(final ConstantMethodref c) { 40 super(Const.CONSTANT_Methodref, c.getClassIndex(), c.getNameAndTypeIndex()); 41 } 42 43 44 /** 45 * Initialize instance from input data. 46 * 47 * @param input input stream 48 * @throws IOException 49 */ 50 ConstantMethodref(final DataInput input) throws IOException { 51 super(Const.CONSTANT_Methodref, input); 52 } 53 54 55 /** 56 * @param class_index Reference to the class containing the method 57 * @param name_and_type_index and the method signature 58 */ 59 public ConstantMethodref(final int class_index, final int name_and_type_index) { 60 super(Const.CONSTANT_Methodref, class_index, name_and_type_index); 61 } 62 63 64 /** 65 * Called by objects that are traversing the nodes of the tree implicitely 66 * defined by the contents of a Java class. I.e., the hierarchy of methods, 67 * fields, attributes, etc. spawns a tree of objects. 68 * 69 * @param v Visitor object 70 */ 71 @Override 72 public void accept( final Visitor v ) { 73 v.visitConstantMethodref(this); 74 } 75 } |