001 /*
002 * Sonar, open source software quality management tool.
003 * Copyright (C) 2008-2012 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * Sonar is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * Sonar is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public
017 * License along with Sonar; if not, write to the Free Software
018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
019 */
020 package org.sonar.java.bytecode.asm;
021
022 import java.util.HashSet;
023 import java.util.Set;
024
025 import org.objectweb.asm.signature.SignatureVisitor;
026
027 public class AsmSignatureVisitor implements SignatureVisitor {
028
029 private Set<String> internalNames = new HashSet<String>();
030
031 public Set<String> getInternalNames() {
032 return internalNames;
033 }
034
035 /**
036 * {@inheritDoc}
037 */
038 public void visitClassType(String name) {
039 internalNames.add(name);
040 }
041
042 /**
043 * {@inheritDoc}
044 */
045 public SignatureVisitor visitArrayType() {
046 return this;
047 }
048
049 /**
050 * {@inheritDoc}
051 */
052 public void visitBaseType(char descriptor) {
053 }
054
055 /**
056 * {@inheritDoc}
057 */
058 public SignatureVisitor visitClassBound() {
059 return this;
060 }
061
062 public SignatureVisitor visitExceptionType() {
063 return this;
064 }
065
066 /**
067 * {@inheritDoc}
068 */
069 public void visitFormalTypeParameter(String name) {
070 }
071
072 /**
073 * {@inheritDoc}
074 */
075 public void visitInnerClassType(String name) {
076 }
077
078 /**
079 * {@inheritDoc}
080 */
081 public SignatureVisitor visitInterface() {
082 return this;
083 }
084
085 /**
086 * {@inheritDoc}
087 */
088 public SignatureVisitor visitInterfaceBound() {
089 return this;
090 }
091
092 /**
093 * {@inheritDoc}
094 */
095 public SignatureVisitor visitParameterType() {
096 return this;
097 }
098
099 /**
100 * {@inheritDoc}
101 */
102 public SignatureVisitor visitReturnType() {
103 return this;
104 }
105
106 /**
107 * {@inheritDoc}
108 */
109 public SignatureVisitor visitSuperclass() {
110 return this;
111 }
112
113 /**
114 * {@inheritDoc}
115 */
116 public void visitTypeArgument() {
117 }
118
119 /**
120 * {@inheritDoc}
121 */
122 public SignatureVisitor visitTypeArgument(char wildcard) {
123 return this;
124 }
125
126 /**
127 * {@inheritDoc}
128 */
129 public void visitTypeVariable(String name) {
130 }
131
132 /**
133 * {@inheritDoc}
134 */
135 public void visitEnd() {
136 }
137 }