Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Ragdoc Builder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
Ragdoc Builder
Commits
6c30dab2
Commit
6c30dab2
authored
8 years ago
by
Jesper
Browse files
Options
Downloads
Patches
Plain Diff
Code cleanup
parent
997bda6d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/java/org/extendj/ragdoc/JsonBuilder.java
+13
-13
13 additions, 13 deletions
src/java/org/extendj/ragdoc/JsonBuilder.java
with
13 additions
and
13 deletions
src/java/org/extendj/ragdoc/JsonBuilder.java
+
13
−
13
View file @
6c30dab2
...
@@ -86,7 +86,7 @@ public class JsonBuilder {
...
@@ -86,7 +86,7 @@ public class JsonBuilder {
JsonObject
doc
=
constr
.
jsonDocObject
();
JsonObject
doc
=
constr
.
jsonDocObject
();
if
(
shouldDocument
(
constr
,
doc
))
{
if
(
shouldDocument
(
constr
,
doc
))
{
JsonObject
obj
=
new
JsonObject
();
JsonObject
obj
=
new
JsonObject
();
obj
.
add
(
"name"
,
new
JsonString
(
constr
.
name
()));
obj
.
add
(
"name"
,
Json
.
of
(
constr
.
name
()));
JsonArray
modifiers
=
constr
.
getModifiers
().
toJson
();
JsonArray
modifiers
=
constr
.
getModifiers
().
toJson
();
if
(!
modifiers
.
isEmpty
())
{
if
(!
modifiers
.
isEmpty
())
{
obj
.
add
(
"mods"
,
modifiers
);
obj
.
add
(
"mods"
,
modifiers
);
...
@@ -130,7 +130,7 @@ public class JsonBuilder {
...
@@ -130,7 +130,7 @@ public class JsonBuilder {
JsonObject
doc
=
method
.
jsonDocObject
();
JsonObject
doc
=
method
.
jsonDocObject
();
if
(
shouldDocument
(
method
,
doc
))
{
if
(
shouldDocument
(
method
,
doc
))
{
JsonObject
obj
=
new
JsonObject
();
JsonObject
obj
=
new
JsonObject
();
obj
.
add
(
"name"
,
new
JsonString
(
method
.
name
()));
obj
.
add
(
"name"
,
Json
.
of
(
method
.
name
()));
JsonArray
modifiers
=
method
.
getModifiers
().
toJson
();
JsonArray
modifiers
=
method
.
getModifiers
().
toJson
();
if
(!
modifiers
.
isEmpty
())
{
if
(!
modifiers
.
isEmpty
())
{
obj
.
add
(
"mods"
,
modifiers
);
obj
.
add
(
"mods"
,
modifiers
);
...
@@ -229,7 +229,7 @@ public class JsonBuilder {
...
@@ -229,7 +229,7 @@ public class JsonBuilder {
if
(
shouldDocument
(
field
,
doc
))
{
if
(
shouldDocument
(
field
,
doc
))
{
for
(
Declarator
declarator
:
field
.
getDeclaratorList
())
{
for
(
Declarator
declarator
:
field
.
getDeclaratorList
())
{
JsonObject
obj
=
new
JsonObject
();
JsonObject
obj
=
new
JsonObject
();
obj
.
add
(
"name"
,
new
JsonString
(
declarator
.
name
()));
obj
.
add
(
"name"
,
Json
.
of
(
declarator
.
name
()));
obj
.
add
(
"type"
,
typeRef
(
declarator
.
type
()));
obj
.
add
(
"type"
,
typeRef
(
declarator
.
type
()));
JsonArray
modifiers
=
field
.
getModifiers
().
toJson
();
JsonArray
modifiers
=
field
.
getModifiers
().
toJson
();
if
(!
modifiers
.
isEmpty
())
{
if
(!
modifiers
.
isEmpty
())
{
...
@@ -275,25 +275,25 @@ public class JsonBuilder {
...
@@ -275,25 +275,25 @@ public class JsonBuilder {
}
}
}
}
doc
.
add
(
"ragFile"
,
Json
.
of
(
relativePath
));
doc
.
add
(
"ragFile"
,
Json
.
of
(
relativePath
));
doc
.
add
(
"line"
,
new
JsonString
(
lineno
));
doc
.
add
(
"line"
,
Json
.
of
(
lineno
));
}
}
break
;
break
;
case
"aspect"
:
case
"aspect"
:
aspectName
=
tag
.
text
;
aspectName
=
tag
.
text
;
doc
.
add
(
"aspect"
,
new
JsonString
(
aspectName
));
doc
.
add
(
"aspect"
,
Json
.
of
(
aspectName
));
break
;
break
;
case
"param"
:
case
"param"
:
params
.
add
(
tag
.
text
);
params
.
add
(
tag
.
text
);
break
;
break
;
default
:
default
:
doc
.
add
(
tag
.
tag
,
new
JsonString
(
tag
.
text
));
doc
.
add
(
tag
.
tag
,
Json
.
of
(
tag
.
text
));
break
;
break
;
}
}
}
}
if
(!
params
.
isEmpty
())
{
if
(!
params
.
isEmpty
())
{
doc
.
add
(
"params"
,
params
);
doc
.
add
(
"params"
,
params
);
}
}
doc
.
add
(
"description"
,
new
JsonString
(
javadoc
));
doc
.
add
(
"description"
,
Json
.
of
(
javadoc
));
if
(
aspectName
!=
null
)
{
if
(
aspectName
!=
null
)
{
aspects
.
add
(
aspectName
);
aspects
.
add
(
aspectName
);
}
}
...
@@ -316,7 +316,7 @@ public class JsonBuilder {
...
@@ -316,7 +316,7 @@ public class JsonBuilder {
for
(
TypeDecl
type
:
unit
.
localTypes
())
{
for
(
TypeDecl
type
:
unit
.
localTypes
())
{
if
(
JsonBuilder
.
shouldDocument
(
type
))
{
if
(
JsonBuilder
.
shouldDocument
(
type
))
{
JsonObject
typeJson
=
typeJson
(
type
);
JsonObject
typeJson
=
typeJson
(
type
);
typeJson
.
add
(
"id"
,
new
JsonString
(
typeId
(
type
)));
typeJson
.
add
(
"id"
,
Json
.
of
(
typeId
(
type
)));
TypeDecl
enclosing
=
type
.
enclosingType
();
TypeDecl
enclosing
=
type
.
enclosingType
();
if
(
enclosing
!=
null
)
{
if
(
enclosing
!=
null
)
{
typeJson
.
add
(
"enclosing"
,
typeRef
(
enclosing
));
typeJson
.
add
(
"enclosing"
,
typeRef
(
enclosing
));
...
@@ -330,9 +330,9 @@ public class JsonBuilder {
...
@@ -330,9 +330,9 @@ public class JsonBuilder {
private
JsonObject
typeJson
(
TypeDecl
type
)
{
private
JsonObject
typeJson
(
TypeDecl
type
)
{
JsonObject
obj
=
new
JsonObject
();
JsonObject
obj
=
new
JsonObject
();
obj
.
add
(
"kind"
,
new
JsonString
(
type
.
objectKind
()));
obj
.
add
(
"kind"
,
Json
.
of
(
type
.
objectKind
()));
obj
.
add
(
"name"
,
new
JsonString
(
type
.
nameWithTypeArgs
()));
obj
.
add
(
"name"
,
Json
.
of
(
type
.
nameWithTypeArgs
()));
obj
.
add
(
"pkg"
,
new
JsonString
(
type
.
packageName
()));
obj
.
add
(
"pkg"
,
Json
.
of
(
type
.
packageName
()));
if
(
type
instanceof
ClassDecl
)
{
if
(
type
instanceof
ClassDecl
)
{
ClassDecl
klass
=
(
ClassDecl
)
type
;
ClassDecl
klass
=
(
ClassDecl
)
type
;
if
(
klass
.
hasSuperclass
())
{
if
(
klass
.
hasSuperclass
())
{
...
@@ -478,7 +478,7 @@ public class JsonBuilder {
...
@@ -478,7 +478,7 @@ public class JsonBuilder {
for
(
String
kind
:
kinds
)
{
for
(
String
kind
:
kinds
)
{
if
(
groupMap
.
containsKey
(
kind
))
{
if
(
groupMap
.
containsKey
(
kind
))
{
JsonObject
group
=
new
JsonObject
();
JsonObject
group
=
new
JsonObject
();
group
.
add
(
"kind"
,
new
JsonString
(
kind
));
group
.
add
(
"kind"
,
Json
.
of
(
kind
));
JsonArray
members
=
groupMap
.
get
(
kind
);
JsonArray
members
=
groupMap
.
get
(
kind
);
sortArrayBy
(
members
,
"name"
);
sortArrayBy
(
members
,
"name"
);
group
.
add
(
"members"
,
members
);
group
.
add
(
"members"
,
members
);
...
@@ -508,7 +508,7 @@ public class JsonBuilder {
...
@@ -508,7 +508,7 @@ public class JsonBuilder {
}
}
JsonObject
entry
=
new
JsonObject
();
JsonObject
entry
=
new
JsonObject
();
entry
.
add
(
"name"
,
new
JsonString
(
packageName
));
entry
.
add
(
"name"
,
Json
.
of
(
packageName
));
JsonArray
groups
=
groupify
(
groupMap
,
TYPE_KINDS
);
JsonArray
groups
=
groupify
(
groupMap
,
TYPE_KINDS
);
entry
.
add
(
"groups"
,
groups
);
entry
.
add
(
"groups"
,
groups
);
packageIndex
.
add
(
entry
);
packageIndex
.
add
(
entry
);
...
...
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