Commit Graph

91 Commits (f770dbab5225d9d6b9fb9721a3110787ed367dca)

Author SHA1 Message Date
Phillip Webb c9fb9916b8 Reformat code using Eclipse Mars 9 years ago
Phillip Webb e473364e4e Merge branch '1.2.x' 9 years ago
Phillip Webb 6ab376e2e8 Reformat code use Eclipse Mars 9 years ago
Andy Wilkinson 051ebf3fac Polishing: fix a number of compiler warnings reported by Eclipse 9 years ago
Spring Buildmaster 9409c49c10 Next development version 9 years ago
Phillip Webb e674d751de Polish Javadoc 9 years ago
Phillip Webb e07df7e4c6 Remove redundant modifiers 9 years ago
Phillip Webb d09805fd75 Polish license headers 9 years ago
Phillip Webb 6e29ee4557 Polish 9 years ago
Phillip Webb 67402405db Reformat code 9 years ago
Phillip Webb 0335053139 Merge branch '1.2.x' 9 years ago
Phillip Webb 15686ed4fd Reformat code 9 years ago
Phillip Webb 0f6b60d8c8 Organize imports 9 years ago
Stephane Nicoll 35875c7f08 Merge manual item meta-data
Previously, manual meta-data were added to the existing set of entries
which could lead to duplicates if a manual entry is meant to complement
a property that is detected via the processor.

We now match the name and type of the item against the auto-detected
entries. If no match is found, we add the extra entry as we did before.
If a match is found we override the description, default value and
deprecation information.

Closes gh-3562
9 years ago
Stephane Nicoll 3763eda64e Merge branch '1.2.x' 9 years ago
Stephane Nicoll 1ee31e73d3 Avoid NPE if @ConfigurationProperties is not present
The annotation processor detects `@ConfigurationProperties` bean or
method definition and merges manual meta-data. The former step will fail
with a NPE if the annotation is not present on the classpath. This could
happen if the annotation processor is added to a module that is not
actually using Spring Boot.

We now have a defensive check that skips that steps but still attempts to
merge manual meta-data if present.

Closes gh-3720
9 years ago
arghya88 64c6e5b403 Fix typo
Closes gh-3610
9 years ago
Stephane Nicoll 42e230192f Polish 9 years ago
Stephane Nicoll e9a6245a44 Remove unnecessary System.out 9 years ago
Stephane Nicoll 178c690d37 Fix meta-data root attributes ordering 9 years ago
Phillip Webb e9d252e05c Add @DeprecatedConfigurationProperties annotation
Add a new @DeprecatedConfigurationProperties annotation which can be
used by the `ConfigurationMetadataAnnotationProcessor` to generating
meta-data deprecated blocks.

Fixes gh-3543
9 years ago
Phillip Webb 728e64b929 Polish 9 years ago
izeye f4589e7cc3 Fix typos
Closes gh-3504
9 years ago
Stephane Nicoll f2d32d3e98 Add support for property deprecation
Previously, an item could only have a 'deprecated' boolean flag to
indicate that the property is deprecated. It is desirable to provide an
additional description for the deprecation as well as the name of the
property to use instead.

The `deprecated` boolean flag is now supported. Instead, a `deprecated`
object can be specified with two optional attributes: `reason` to provide
an explanation for the deprecation and `replacement` to refer to the
property that should be used instead. If none of them is present, an
empty deprecation object should be set.

For backward compatibility, the `deprecated` field is still set.

Deprecation information can only set via manual meta-data.

Closes gh-3449
9 years ago
izeye 019140c901 Remove redundant check
Closes gh-3497
9 years ago
Phillip Webb f0f5f78e25 Polish 9 years ago
Stephane Nicoll c4c24b1f44 Detect default value from factory method
If a field is initialized via a factory method taking a single argument,
we can relatively safely consider that said argument is a good
representation of its default value. This is typically the case for
Charset or MimeType instances.

We now make sure to detect such use case (i.e. method argument with a
single argument).

Closes gh-3482
9 years ago
Phillip Webb 9ebe15232e Polish 9 years ago
Stephane Nicoll cb5eccb5c1 Add missing handle-as meta-data
Liquibase has a `changeLog` property that is definitely used as a
`Resource` but cannot be defined as such as the original String value
should be kept against an API we don't control.

Update the tests also to make it more clear that if hints are added
against a property that is detected automatically, said property still
keeps all its auto-discovered capabilities.

Closes gh-3457
9 years ago
izeye f85f316873 Polish toString()
Closes gh-3465
9 years ago
Stephane Nicoll 3664895f04 Polish 9 years ago
Stephane Nicoll 97634e85ac Remove unnecessary keyword 9 years ago
Phillip Webb 0cf6efca4f Polish 10 years ago
Stephane Nicoll 162cbdd5cb Fail the build if the meta-data are invalid
Make sure to fail the build with a proper compilation error message if
the user-defined meta-data are invalid. For now, this takes care of the
JSON format but other checks may be added in the future.

Closes gh-3329
10 years ago
Spring Buildmaster 7ce391db4f Next development version 10 years ago
Phillip Webb 7879743b9f Polish 10 years ago
Stephane Nicoll 0ec9de9137 Add support for value provider
Improve the "hints" section of the metadata so that each hint can provide
the reference to a value provider.

A value provider defines how a tool can discover the potential values of
a property based on the context. The provider is identifed by a name and
may have an arbitrary number of parameters.

Closes gh-3303
10 years ago
Phillip Webb 778e3eb091 Polish 10 years ago
Stephane Nicoll bc9321734f Add support for property hint
Create a new section in the meta-data called "hints" where users can
provide hints about a given property. The most basic use case for now
is to provide a list of values that a property can have. Each value may
have a description.

This sample JSON provides a basic example for a property called `foo.mode`
that exposes 3 values: "auto", "basic" and "advanced".

```
 "hints": [
    {
      "id": "foo.mode",
      "values": [
        {
          "value": "auto",
          "description": "Some smart description."
        },
        {
          "name": "basic"
        },
        {
          "name": "advanced"
        }
      ]
    }
]
```

This information can be read by tools (such as IDE) and offer an
auto-completion with the list of values.

Closes gh-2054
10 years ago
Spring Buildmaster 5d81c87b43 Next Development Version 10 years ago
Spring Buildmaster e03c11dda8 Next development version 10 years ago
Phillip Webb a57a88f5cf Move master to 1.3.0.BUILD-SNAPSHOT 10 years ago
Spring Buildmaster 8f0ad02237 Next development version 10 years ago
Phillip Webb 56e31a8c6b Polish 10 years ago
Phillip Webb 1f0d45d795 Protect against NPE and improve error message
Update ConfigurationMetadataAnnotationProcessor so that `prefix` is
only obtained when the annotation is not null. Also improve exception
message by including the element.
10 years ago
Stephane Nicoll e8e39e4bcf polish 10 years ago
Phillip Webb 8e398dc6a7 Polish Javadoc
Update Javadoc to add missing @return and @param elements.
10 years ago
Phillip Webb 072f873f34 Polish 10 years ago
Andy Wilkinson 23c175f674 Polish metadata annotation processor’s incremental build support
The main change in this commit is to introduce a new BuildHandler
abstraction. A BuildHandler is responsible for producing the metadata
for a build. Two implementations are provided; one for standard builds
and one for incremental builds. This change means that the annotation
processor is no longer concerned with the two different build types
and can use the same logic in each case.

The code for reading and writing metadata files has also been moved
out into a separate class, MetadataStore, to allow it to be easily
utilised from multiple places.

Closes gh-2313
10 years ago
Kris De Volder 8df43a8a79 Update the metadata annotation processor to support incremental builds
This commit udpdates the metadata annotation processor so that change
data from an incremental build is merged with the metadata from the
previous build.

Closes gh-2321
10 years ago