• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package javassist.bytecode;
18 
19 import java.io.DataInputStream;
20 import java.io.IOException;
21 import java.util.Map;
22 
23 /**
24  * <code>Deprecated_attribute</code>.
25  */
26 public class DeprecatedAttribute extends AttributeInfo {
27     /**
28      * The name of this attribute <code>"Deprecated"</code>.
29      */
30     public static final String tag = "Deprecated";
31 
DeprecatedAttribute(ConstPool cp, int n, DataInputStream in)32     DeprecatedAttribute(ConstPool cp, int n, DataInputStream in)
33         throws IOException
34     {
35         super(cp, n, in);
36     }
37 
38     /**
39      * Constructs a Deprecated attribute.
40      *
41      * @param cp                a constant pool table.
42      */
DeprecatedAttribute(ConstPool cp)43     public DeprecatedAttribute(ConstPool cp) {
44         super(cp, tag, new byte[0]);
45     }
46 
47     /**
48      * Makes a copy.
49      *
50      * @param newCp     the constant pool table used by the new copy.
51      * @param classnames        should be null.
52      */
53     @Override
copy(ConstPool newCp, Map<String,String> classnames)54     public AttributeInfo copy(ConstPool newCp, Map<String,String> classnames) {
55         return new DeprecatedAttribute(newCp);
56     }
57 }
58