Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
f2d3f51f
Commit
f2d3f51f
authored
Jan 08, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
c7f5f073
4568f14c
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2446 additions
and
2268 deletions
+2446
-2268
JSON.java
...pringframework/boot/configurationprocessor/json/JSON.java
+103
-89
JSONArray.java
...framework/boot/configurationprocessor/json/JSONArray.java
+639
-564
JSONException.java
...ework/boot/configurationprocessor/json/JSONException.java
+3
-3
JSONObject.java
...ramework/boot/configurationprocessor/json/JSONObject.java
+788
-694
JSONStringer.java
...mework/boot/configurationprocessor/json/JSONStringer.java
+405
-371
JSONTokener.java
...amework/boot/configurationprocessor/json/JSONTokener.java
+508
-547
No files found.
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSON.java
View file @
f2d3f51f
...
...
@@ -30,11 +30,13 @@ class JSON {
static
Boolean
toBoolean
(
Object
value
)
{
if
(
value
instanceof
Boolean
)
{
return
(
Boolean
)
value
;
}
else
if
(
value
instanceof
String
)
{
}
else
if
(
value
instanceof
String
)
{
String
stringValue
=
(
String
)
value
;
if
(
"true"
.
equalsIgnoreCase
(
stringValue
))
{
return
true
;
}
else
if
(
"false"
.
equalsIgnoreCase
(
stringValue
))
{
}
else
if
(
"false"
.
equalsIgnoreCase
(
stringValue
))
{
return
false
;
}
}
...
...
@@ -44,12 +46,15 @@ class JSON {
static
Double
toDouble
(
Object
value
)
{
if
(
value
instanceof
Double
)
{
return
(
Double
)
value
;
}
else
if
(
value
instanceof
Number
)
{
}
else
if
(
value
instanceof
Number
)
{
return
((
Number
)
value
).
doubleValue
();
}
else
if
(
value
instanceof
String
)
{
}
else
if
(
value
instanceof
String
)
{
try
{
return
Double
.
valueOf
((
String
)
value
);
}
catch
(
NumberFormatException
ignored
)
{
}
catch
(
NumberFormatException
ignored
)
{
}
}
return
null
;
...
...
@@ -58,12 +63,15 @@ class JSON {
static
Integer
toInteger
(
Object
value
)
{
if
(
value
instanceof
Integer
)
{
return
(
Integer
)
value
;
}
else
if
(
value
instanceof
Number
)
{
}
else
if
(
value
instanceof
Number
)
{
return
((
Number
)
value
).
intValue
();
}
else
if
(
value
instanceof
String
)
{
}
else
if
(
value
instanceof
String
)
{
try
{
return
(
int
)
Double
.
parseDouble
((
String
)
value
);
}
catch
(
NumberFormatException
ignored
)
{
}
catch
(
NumberFormatException
ignored
)
{
}
}
return
null
;
...
...
@@ -72,12 +80,15 @@ class JSON {
static
Long
toLong
(
Object
value
)
{
if
(
value
instanceof
Long
)
{
return
(
Long
)
value
;
}
else
if
(
value
instanceof
Number
)
{
}
else
if
(
value
instanceof
Number
)
{
return
((
Number
)
value
).
longValue
();
}
else
if
(
value
instanceof
String
)
{
}
else
if
(
value
instanceof
String
)
{
try
{
return
(
long
)
Double
.
parseDouble
((
String
)
value
);
}
catch
(
NumberFormatException
ignored
)
{
}
catch
(
NumberFormatException
ignored
)
{
}
}
return
null
;
...
...
@@ -86,7 +97,8 @@ class JSON {
static
String
toString
(
Object
value
)
{
if
(
value
instanceof
String
)
{
return
(
String
)
value
;
}
else
if
(
value
!=
null
)
{
}
else
if
(
value
!=
null
)
{
return
String
.
valueOf
(
value
);
}
return
null
;
...
...
@@ -96,7 +108,8 @@ class JSON {
String
requiredType
)
throws
JSONException
{
if
(
actual
==
null
)
{
throw
new
JSONException
(
"Value at "
+
indexOrName
+
" is null."
);
}
else
{
}
else
{
throw
new
JSONException
(
"Value "
+
actual
+
" at "
+
indexOrName
+
" of type "
+
actual
.
getClass
().
getName
()
+
" cannot be converted to "
+
requiredType
);
...
...
@@ -107,7 +120,8 @@ class JSON {
throws
JSONException
{
if
(
actual
==
null
)
{
throw
new
JSONException
(
"Value is null."
);
}
else
{
}
else
{
throw
new
JSONException
(
"Value "
+
actual
+
" of type "
+
actual
.
getClass
().
getName
()
+
" cannot be converted to "
+
requiredType
);
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONArray.java
View file @
f2d3f51f
This diff is collapsed.
Click to expand it.
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONException.java
View file @
f2d3f51f
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONObject.java
View file @
f2d3f51f
This diff is collapsed.
Click to expand it.
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java
View file @
f2d3f51f
This diff is collapsed.
Click to expand it.
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java
View file @
f2d3f51f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment