Home | History | Annotate | Download | only in bytecode
      1 /*
      2  * Javassist, a Java-bytecode translator toolkit.
      3  * Copyright (C) 1999-2007 Shigeru Chiba. All Rights Reserved.
      4  *
      5  * The contents of this file are subject to the Mozilla Public License Version
      6  * 1.1 (the "License"); you may not use this file except in compliance with
      7  * the License.  Alternatively, the contents of this file may be used under
      8  * the terms of the GNU Lesser General Public License Version 2.1 or later.
      9  *
     10  * Software distributed under the License is distributed on an "AS IS" basis,
     11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
     12  * for the specific language governing rights and limitations under the
     13  * License.
     14  */
     15 
     16 package javassist.bytecode;
     17 
     18 import java.io.DataInputStream;
     19 import java.io.IOException;
     20 import java.util.Map;
     21 
     22 /**
     23  * <code>LocalVariableTypeTable_attribute</code>.
     24  *
     25  * @since 3.11
     26  */
     27 public class LocalVariableTypeAttribute extends LocalVariableAttribute {
     28     /**
     29      * The name of the attribute <code>"LocalVariableTypeTable"</code>.
     30      */
     31     public static final String tag = LocalVariableAttribute.typeTag;
     32 
     33     /**
     34      * Constructs an empty LocalVariableTypeTable.
     35      */
     36     public LocalVariableTypeAttribute(ConstPool cp) {
     37         super(cp, tag, new byte[2]);
     38         ByteArray.write16bit(0, info, 0);
     39     }
     40 
     41     LocalVariableTypeAttribute(ConstPool cp, int n, DataInputStream in)
     42         throws IOException
     43     {
     44         super(cp, n, in);
     45     }
     46 
     47     private LocalVariableTypeAttribute(ConstPool cp, byte[] dest) {
     48         super(cp, tag, dest);
     49     }
     50 
     51     String renameEntry(String desc, String oldname, String newname) {
     52         return SignatureAttribute.renameClass(desc, oldname, newname);
     53     }
     54 
     55     String renameEntry(String desc, Map classnames) {
     56         return SignatureAttribute.renameClass(desc, classnames);
     57     }
     58 
     59     LocalVariableAttribute makeThisAttr(ConstPool cp, byte[] dest) {
     60         return new LocalVariableTypeAttribute(cp, dest);
     61     }
     62 }
     63