author | psandoz |
Fri, 08 Sep 2017 10:46:46 -0700 | |
changeset 48826 | c4d9d1b08e2e |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
40596 | 1 |
/* |
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package com.sun.tools.jdeprscan.scan; |
|
27 |
||
28 |
import com.sun.tools.classfile.ConstantPool; |
|
48826 | 29 |
import com.sun.tools.classfile.ConstantPool.CONSTANT_Dynamic_info; |
40596 | 30 |
|
31 |
/** |
|
32 |
* A visitor that selects constant pool entries by type and adds |
|
33 |
* them to the given CPEntries object. |
|
34 |
*/ |
|
35 |
class CPSelector implements ConstantPool.Visitor<Void,CPEntries> { |
|
36 |
@Override |
|
37 |
public Void visitClass(ConstantPool.CONSTANT_Class_info info, CPEntries p) { |
|
38 |
p.classes.add(info); |
|
39 |
return null; |
|
40 |
} |
|
41 |
||
42 |
@Override |
|
43 |
public Void visitDouble(ConstantPool.CONSTANT_Double_info info, CPEntries p) { |
|
44 |
return null; |
|
45 |
} |
|
46 |
||
47 |
@Override |
|
48 |
public Void visitFieldref(ConstantPool.CONSTANT_Fieldref_info info, CPEntries p) { |
|
49 |
p.fieldRefs.add(info); |
|
50 |
return null; |
|
51 |
} |
|
52 |
||
53 |
@Override |
|
54 |
public Void visitFloat(ConstantPool.CONSTANT_Float_info info, CPEntries p) { |
|
55 |
return null; |
|
56 |
} |
|
57 |
||
58 |
@Override |
|
59 |
public Void visitInteger(ConstantPool.CONSTANT_Integer_info info, CPEntries p) { |
|
60 |
return null; |
|
61 |
} |
|
62 |
||
63 |
@Override |
|
64 |
public Void visitInterfaceMethodref(ConstantPool.CONSTANT_InterfaceMethodref_info info, CPEntries p) { |
|
65 |
p.intfMethodRefs.add(info); |
|
66 |
return null; |
|
67 |
} |
|
68 |
||
69 |
@Override |
|
70 |
public Void visitInvokeDynamic(ConstantPool.CONSTANT_InvokeDynamic_info info, CPEntries p) { |
|
71 |
return null; |
|
72 |
} |
|
73 |
||
48826 | 74 |
public Void visitDynamicConstant(CONSTANT_Dynamic_info info, CPEntries p) { |
75 |
return null; |
|
76 |
} |
|
77 |
||
40596 | 78 |
@Override |
79 |
public Void visitLong(ConstantPool.CONSTANT_Long_info info, CPEntries p) { |
|
80 |
return null; |
|
81 |
} |
|
82 |
||
83 |
@Override |
|
84 |
public Void visitMethodref(ConstantPool.CONSTANT_Methodref_info info, CPEntries p) { |
|
85 |
p.methodRefs.add(info); |
|
86 |
return null; |
|
87 |
} |
|
88 |
||
89 |
@Override |
|
90 |
public Void visitMethodHandle(ConstantPool.CONSTANT_MethodHandle_info info, CPEntries p) { |
|
91 |
return null; |
|
92 |
} |
|
93 |
||
94 |
@Override |
|
95 |
public Void visitMethodType(ConstantPool.CONSTANT_MethodType_info info, CPEntries p) { |
|
96 |
return null; |
|
97 |
} |
|
98 |
||
99 |
@Override |
|
42822
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
100 |
public Void visitModule(ConstantPool.CONSTANT_Module_info info, CPEntries p) { |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
101 |
return null; |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
102 |
} |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
103 |
|
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
104 |
@Override |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
105 |
public Void visitNameAndType(ConstantPool.CONSTANT_NameAndType_info info, CPEntries p) { |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
106 |
return null; |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
107 |
} |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
108 |
|
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
109 |
@Override |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
110 |
public Void visitPackage(ConstantPool.CONSTANT_Package_info info, CPEntries p) { |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
111 |
return null; |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
112 |
} |
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
113 |
|
a84956e7ee4d
8170987: Module system implementation refresh (12/2016)
alanb
parents:
40596
diff
changeset
|
114 |
@Override |
40596 | 115 |
public Void visitString(ConstantPool.CONSTANT_String_info info, CPEntries p) { |
116 |
return null; |
|
117 |
} |
|
118 |
||
119 |
@Override |
|
120 |
public Void visitUtf8(ConstantPool.CONSTANT_Utf8_info info, CPEntries p) { |
|
121 |
return null; |
|
122 |
} |
|
123 |
} |