You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LocalVariableTypeAttribute.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Javassist, a Java-bytecode translator toolkit.
  3. * Copyright (C) 1999- 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. * or the Apache License Version 2.0.
  10. *
  11. * Software distributed under the License is distributed on an "AS IS" basis,
  12. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. * for the specific language governing rights and limitations under the
  14. * License.
  15. */
  16. package javassist.bytecode;
  17. import java.io.DataInputStream;
  18. import java.io.IOException;
  19. import java.util.Map;
  20. /**
  21. * <code>LocalVariableTypeTable_attribute</code>.
  22. *
  23. * @since 3.11
  24. */
  25. public class LocalVariableTypeAttribute extends LocalVariableAttribute {
  26. /**
  27. * The name of the attribute <code>"LocalVariableTypeTable"</code>.
  28. */
  29. public static final String tag = LocalVariableAttribute.typeTag;
  30. /**
  31. * Constructs an empty LocalVariableTypeTable.
  32. */
  33. public LocalVariableTypeAttribute(ConstPool cp) {
  34. super(cp, tag, new byte[2]);
  35. ByteArray.write16bit(0, info, 0);
  36. }
  37. LocalVariableTypeAttribute(ConstPool cp, int n, DataInputStream in)
  38. throws IOException
  39. {
  40. super(cp, n, in);
  41. }
  42. private LocalVariableTypeAttribute(ConstPool cp, byte[] dest) {
  43. super(cp, tag, dest);
  44. }
  45. @Override
  46. String renameEntry(String desc, String oldname, String newname) {
  47. return SignatureAttribute.renameClass(desc, oldname, newname);
  48. }
  49. @Override
  50. String renameEntry(String desc, Map<String,String> classnames) {
  51. return SignatureAttribute.renameClass(desc, classnames);
  52. }
  53. @Override
  54. LocalVariableAttribute makeThisAttr(ConstPool cp, byte[] dest) {
  55. return new LocalVariableTypeAttribute(cp, dest);
  56. }
  57. }