diff options
author | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-04-16 09:26:46 +0200 |
---|---|---|
committer | Jean-Baptiste Vilain <jean-baptiste.vilain@sonarsource.com> | 2013-04-16 09:26:46 +0200 |
commit | ff0068f0e79c4ac5373c0254e97052ab462033ec (patch) | |
tree | 1bb780d3f2b8658619d45624cb933a82c1915958 /sonar-plugin-api | |
parent | b2333a80fa1a54be00db5b2d7b3c97c8c331cf1b (diff) | |
download | sonarqube-ff0068f0e79c4ac5373c0254e97052ab462033ec.tar.gz sonarqube-ff0068f0e79c4ac5373c0254e97052ab462033ec.zip |
SONAR-3893 First symbol API version
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/scan/source/Symbol.java | 30 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/scan/source/SymbolPerspective.java | 54 |
2 files changed, 84 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/source/Symbol.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/source/Symbol.java new file mode 100644 index 00000000000..a5d7c17a9d8 --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/scan/source/Symbol.java @@ -0,0 +1,30 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2012 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ + +package org.sonar.api.scan.source; + +public interface Symbol { + + public int getDeclarationStartOffset(); + + public int getDeclarationEndOffset(); + + public String getFullyQualifiedName(); +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/source/SymbolPerspective.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/source/SymbolPerspective.java new file mode 100644 index 00000000000..7c1248d4f18 --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/scan/source/SymbolPerspective.java @@ -0,0 +1,54 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2012 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ + +package org.sonar.api.scan.source; + +import org.sonar.api.component.Perspective; + +/** + * @since 3.6 + */ +public interface SymbolPerspective extends Perspective { + + interface SymbolBuilder { + + SymbolBuilder setDeclaration(int startOffset, int endOffset); + + SymbolBuilder setFullyQualifiedName(String fullyQualifiedName); + + Symbol build(); + } + + interface ReferencesBuilder { + + ReferencesBuilder addReference(int startOffset); + } + + SymbolPerspective begin(); + + SymbolBuilder newSymbol(); + + ReferencesBuilder declareReferences(Symbol symbol); + + void end(); +} + + + |