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.

DeprecatedAttribute.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Javassist, a Java-bytecode translator toolkit.
  3. * Copyright (C) 1999-2006 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. package javassist.bytecode;
  16. import java.io.DataInputStream;
  17. import java.io.IOException;
  18. import java.util.Map;
  19. /**
  20. * <code>Deprecated_attribute</code>.
  21. */
  22. public class DeprecatedAttribute extends AttributeInfo {
  23. /**
  24. * The name of this attribute <code>"Deprecated"</code>.
  25. */
  26. public static final String tag = "Deprecated";
  27. DeprecatedAttribute(ConstPool cp, int n, DataInputStream in)
  28. throws IOException
  29. {
  30. super(cp, n, in);
  31. }
  32. /**
  33. * Constructs a Deprecated attribute.
  34. *
  35. * @param cp a constant pool table.
  36. */
  37. public DeprecatedAttribute(ConstPool cp) {
  38. super(cp, tag, new byte[0]);
  39. }
  40. /**
  41. * Makes a copy.
  42. *
  43. * @param newCp the constant pool table used by the new copy.
  44. * @param classnames should be null.
  45. */
  46. public AttributeInfo copy(ConstPool newCp, Map classnames) {
  47. return new DeprecatedAttribute(newCp);
  48. }
  49. }