xref: /aosp_15_r20/external/javassist/src/main/javassist/bytecode/SyntheticAttribute.java (revision f1fbf3c2ab775ce834e0af96b7a85bdc7a0eac65)
1*f1fbf3c2SXin Li /*
2*f1fbf3c2SXin Li  * Javassist, a Java-bytecode translator toolkit.
3*f1fbf3c2SXin Li  * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
4*f1fbf3c2SXin Li  *
5*f1fbf3c2SXin Li  * The contents of this file are subject to the Mozilla Public License Version
6*f1fbf3c2SXin Li  * 1.1 (the "License"); you may not use this file except in compliance with
7*f1fbf3c2SXin Li  * the License.  Alternatively, the contents of this file may be used under
8*f1fbf3c2SXin Li  * the terms of the GNU Lesser General Public License Version 2.1 or later,
9*f1fbf3c2SXin Li  * or the Apache License Version 2.0.
10*f1fbf3c2SXin Li  *
11*f1fbf3c2SXin Li  * Software distributed under the License is distributed on an "AS IS" basis,
12*f1fbf3c2SXin Li  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13*f1fbf3c2SXin Li  * for the specific language governing rights and limitations under the
14*f1fbf3c2SXin Li  * License.
15*f1fbf3c2SXin Li  */
16*f1fbf3c2SXin Li 
17*f1fbf3c2SXin Li package javassist.bytecode;
18*f1fbf3c2SXin Li 
19*f1fbf3c2SXin Li import java.io.DataInputStream;
20*f1fbf3c2SXin Li import java.io.IOException;
21*f1fbf3c2SXin Li import java.util.Map;
22*f1fbf3c2SXin Li 
23*f1fbf3c2SXin Li /**
24*f1fbf3c2SXin Li  * <code>Synthetic_attribute</code>.
25*f1fbf3c2SXin Li  */
26*f1fbf3c2SXin Li public class SyntheticAttribute extends AttributeInfo {
27*f1fbf3c2SXin Li     /**
28*f1fbf3c2SXin Li      * The name of this attribute <code>"Synthetic"</code>.
29*f1fbf3c2SXin Li      */
30*f1fbf3c2SXin Li     public static final String tag = "Synthetic";
31*f1fbf3c2SXin Li 
SyntheticAttribute(ConstPool cp, int n, DataInputStream in)32*f1fbf3c2SXin Li     SyntheticAttribute(ConstPool cp, int n, DataInputStream in)
33*f1fbf3c2SXin Li         throws IOException
34*f1fbf3c2SXin Li     {
35*f1fbf3c2SXin Li         super(cp, n, in);
36*f1fbf3c2SXin Li     }
37*f1fbf3c2SXin Li 
38*f1fbf3c2SXin Li     /**
39*f1fbf3c2SXin Li      * Constructs a Synthetic attribute.
40*f1fbf3c2SXin Li      *
41*f1fbf3c2SXin Li      * @param cp                a constant pool table.
42*f1fbf3c2SXin Li      */
SyntheticAttribute(ConstPool cp)43*f1fbf3c2SXin Li     public SyntheticAttribute(ConstPool cp) {
44*f1fbf3c2SXin Li         super(cp, tag, new byte[0]);
45*f1fbf3c2SXin Li     }
46*f1fbf3c2SXin Li 
47*f1fbf3c2SXin Li     /**
48*f1fbf3c2SXin Li      * Makes a copy.
49*f1fbf3c2SXin Li      *
50*f1fbf3c2SXin Li      * @param newCp     the constant pool table used by the new copy.
51*f1fbf3c2SXin Li      * @param classnames        should be null.
52*f1fbf3c2SXin Li      */
53*f1fbf3c2SXin Li     @Override
copy(ConstPool newCp, Map<String,String> classnames)54*f1fbf3c2SXin Li     public AttributeInfo copy(ConstPool newCp, Map<String,String> classnames) {
55*f1fbf3c2SXin Li         return new SyntheticAttribute(newCp);
56*f1fbf3c2SXin Li     }
57*f1fbf3c2SXin Li }
58