Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Webtools Releng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
webtools
Releng
Webtools Releng
Commits
76e49b4f
Commit
76e49b4f
authored
19 years ago
by
jeffliu
Browse files
Options
Downloads
Patches
Plain Diff
[115141] The API Scanner should be able to run from within the Eclipse workspace
parent
ff5aca05
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
archive/releng.builder/tools/apitools/org.eclipse.wtp.releng.tools.component.core/src/org/eclipse/wtp/releng/tools/component/api/API2ComponentAPI.java
+88
-24
88 additions, 24 deletions
...ipse/wtp/releng/tools/component/api/API2ComponentAPI.java
with
88 additions
and
24 deletions
archive/releng.builder/tools/apitools/org.eclipse.wtp.releng.tools.component.core/src/org/eclipse/wtp/releng/tools/component/api/API2ComponentAPI.java
+
88
−
24
View file @
76e49b4f
...
...
@@ -151,26 +151,62 @@ public class API2ComponentAPI implements IClassVisitor
public
List
getImplClasses
(
String
interfaceName
)
{
List
list
=
new
ArrayList
();
getImplClasses
(
interfaceName
,
list
);
return
list
;
}
private
void
getImplClasses
(
String
interfaceName
,
List
list
)
{
List
implClasses
=
(
List
)
interface2ImplClasses
.
get
(
interfaceName
);
if
(
implClasses
!=
null
)
{
list
.
addAll
(
implClasses
);
for
(
Iterator
it
=
implClasses
.
iterator
();
it
.
hasNext
();)
getSubClasses
((
String
)
it
.
next
(),
list
);
{
String
className
=
(
String
)
it
.
next
();
if
(
interface2ImplClasses
.
get
(
className
)
!=
null
)
getImplClasses
(
className
,
list
);
else
{
getSubClasses
(
className
,
list
);
getSuperClasses
(
className
,
list
);
}
}
}
return
list
;
}
private
void
getSu
b
Classes
(
String
superC
lassName
,
List
list
)
private
void
getSu
per
Classes
(
String
c
lassName
,
List
list
)
{
List
subClasses
=
(
List
)
super2SubClasses
.
get
(
superC
lassName
);
if
(
subClasses
!=
null
)
ClassHierarchyInfo
info
=
(
ClassHierarchyInfo
)
super2SubClasses
.
get
(
c
lassName
);
if
(
info
!=
null
)
{
list
.
addAll
(
subClasses
);
for
(
Iterator
it
=
subClasses
.
iterator
();
it
.
hasNext
();)
getSubClasses
((
String
)
it
.
next
(),
list
);
String
superClassName
=
info
.
getSuperClass
();
while
(
superClassName
!=
null
)
{
list
.
add
(
superClassName
);
superClassName
=
null
;
info
=
(
ClassHierarchyInfo
)
super2SubClasses
.
get
(
superClassName
);
if
(
info
!=
null
)
superClassName
=
info
.
getSuperClass
();
}
}
}
private
void
getSubClasses
(
String
className
,
List
list
)
{
ClassHierarchyInfo
info
=
(
ClassHierarchyInfo
)
super2SubClasses
.
get
(
className
);
if
(
info
!=
null
)
{
List
subClasses
=
info
.
getSubClass
();
if
(
subClasses
!=
null
)
{
list
.
addAll
(
subClasses
);
for
(
Iterator
it
=
subClasses
.
iterator
();
it
.
hasNext
();)
getSubClasses
((
String
)
it
.
next
(),
list
);
}
}
}
private
Map
pluginId2CompXML
=
new
HashMap
();
public
void
execute
()
...
...
@@ -259,27 +295,27 @@ public class API2ComponentAPI implements IClassVisitor
if
(
readInterface
)
{
String
superClassName
=
new
String
(
reader
.
getSuperclassName
()).
replace
(
'/'
,
'.'
);
List
subClasses
=
(
List
)
super2SubClasses
.
get
(
superClassName
);
if
(
subClasses
==
null
)
ClassHierarchyInfo
info
=
new
ClassHierarchyInfo
();
info
.
setSuperClass
(
superClassName
);
super2SubClasses
.
put
(
className
,
info
);
info
=
(
ClassHierarchyInfo
)
super2SubClasses
.
get
(
superClassName
);
if
(
info
==
null
)
{
subClasses
=
new
ArrayList
(
1
);
super2SubClasses
.
put
(
superClassName
,
subClasses
);
info
=
new
ClassHierarchyInfo
(
);
super2SubClasses
.
put
(
superClassName
,
info
);
}
subClasses
.
add
(
className
);
if
(!
reader
.
isInterface
())
info
.
addSubClass
(
className
);
char
[][]
names
=
reader
.
getInterfaceNames
();
for
(
int
j
=
0
;
j
<
names
.
length
;
j
++)
{
char
[][]
names
=
reader
.
getInterfaceNames
();
for
(
int
j
=
0
;
j
<
names
.
length
;
j
++)
String
interfaceName
=
new
String
(
names
[
j
]).
replace
(
'/'
,
'.'
);
List
implClasses
=
(
List
)
interface2ImplClasses
.
get
(
interfaceName
);
if
(
implClasses
==
null
)
{
String
interfaceName
=
new
String
(
names
[
j
]).
replace
(
'/'
,
'.'
);
List
implClasses
=
(
List
)
interface2ImplClasses
.
get
(
interfaceName
);
if
(
implClasses
==
null
)
{
implClasses
=
new
ArrayList
(
1
);
interface2ImplClasses
.
put
(
interfaceName
,
implClasses
);
}
implClasses
.
add
(
className
);
implClasses
=
new
ArrayList
(
1
);
interface2ImplClasses
.
put
(
interfaceName
,
implClasses
);
}
implClasses
.
add
(
className
);
}
}
if
(!
isSkipAPIGen
()
&&
isAPI
)
...
...
@@ -545,6 +581,34 @@ public class API2ComponentAPI implements IClassVisitor
}
}
private
class
ClassHierarchyInfo
{
private
String
superClass
;
private
List
subClass
;
public
List
getSubClass
()
{
return
subClass
;
}
public
void
addSubClass
(
String
subClass
)
{
if
(
this
.
subClass
==
null
)
this
.
subClass
=
new
ArrayList
(
1
);
this
.
subClass
.
add
(
subClass
);
}
public
String
getSuperClass
()
{
return
superClass
;
}
public
void
setSuperClass
(
String
superClass
)
{
this
.
superClass
=
superClass
;
}
}
public
static
void
main
(
String
[]
args
)
{
CommandOptionParser
optionParser
=
new
CommandOptionParser
(
args
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment