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
11a15386
Commit
11a15386
authored
Oct 28, 2020
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish 'Support nested @PropertyMapping annotations'
See gh-23146
parent
edf4c833
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
AnnotationsPropertySource.java
...t/autoconfigure/properties/AnnotationsPropertySource.java
+5
-4
AnnotationsPropertySourceTests.java
...oconfigure/properties/AnnotationsPropertySourceTests.java
+1
-1
No files found.
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySource.java
View file @
11a15386
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -73,10 +73,10 @@ public class AnnotationsPropertySource extends EnumerablePropertySource<Class<?>
return
properties
;
}
private
void
collectProperties
(
String
prefix
,
SkipPropertyMapping
defaultS
kip
,
MergedAnnotation
<?>
annotation
,
private
void
collectProperties
(
String
prefix
,
SkipPropertyMapping
s
kip
,
MergedAnnotation
<?>
annotation
,
Method
attribute
,
Map
<
String
,
Object
>
properties
)
{
MergedAnnotation
<?>
attributeMapping
=
MergedAnnotations
.
from
(
attribute
).
get
(
PropertyMapping
.
class
);
SkipPropertyMapping
skip
=
attributeMapping
.
getValue
(
"skip"
,
SkipPropertyMapping
.
class
).
orElse
(
defaultS
kip
);
skip
=
attributeMapping
.
getValue
(
"skip"
,
SkipPropertyMapping
.
class
).
orElse
(
s
kip
);
if
(
skip
==
SkipPropertyMapping
.
YES
)
{
return
;
}
...
...
@@ -127,7 +127,8 @@ public class AnnotationsPropertySource extends EnumerablePropertySource<Class<?>
}
}
else
if
(
value
instanceof
MergedAnnotation
<?>)
{
for
(
Method
attribute
:
((
MergedAnnotation
<?>)
value
).
getType
().
getDeclaredMethods
())
{
MergedAnnotation
<?>
annotation
=
(
MergedAnnotation
<?>)
value
;
for
(
Method
attribute
:
annotation
.
getType
().
getDeclaredMethods
())
{
collectProperties
(
name
,
defaultSkip
,
(
MergedAnnotation
<?>)
value
,
attribute
,
properties
);
}
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/properties/AnnotationsPropertySourceTests.java
View file @
11a15386
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
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