This repository has been archived by the owner on Nov 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28e81fa
commit 0c2efe9
Showing
7 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,8 @@ | |
import java.lang.annotation.Target; | ||
|
||
/** | ||
* This annotation can be declared on a field of type {@link java.util.Properties} in which all properties of a given | ||
* properties file should be injected. | ||
* This annotation can be declared on a field of type {@link java.util.Properties} | ||
* in which all properties from a given properties file should be injected. | ||
* | ||
* @author Mahmoud Ben Hassine ([email protected]) | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
/** | ||
* Annotation processor interface. | ||
* Implementations should provide the logic to get the value to inject in the target field annotated with T. | ||
* Easy Properties will convert the value to the target field's type and set it in the field. | ||
* Easy Props will convert the value to the target field's type and set it in the field. | ||
* | ||
* @param <T> The annotation type. | ||
* @author Mahmoud Ben Hassine ([email protected]) | ||
|
@@ -41,7 +41,7 @@ public interface AnnotationProcessor<T extends Annotation> { | |
* | ||
* @param annotation the annotation to process. | ||
* @param field the target field | ||
* @return Return the object to set in the annotated field or null if the value should be ignored | ||
* @return Return the object to set in the annotated field or {@code null} if the value should be ignored | ||
* @throws AnnotationProcessingException thrown if an exception occurs during annotation processing | ||
*/ | ||
Object processAnnotation(final T annotation, final Field field) throws AnnotationProcessingException; | ||
|
28 changes: 28 additions & 0 deletions
28
src/main/java/org/jeasy/props/converters/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2020, Mahmoud Ben Hassine ([email protected]) | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
/** | ||
* This package contains built-in type converters. As of v3.0.0, type conversion | ||
* is based on Apache commons-beanutils. | ||
*/ | ||
package org.jeasy.props.converters; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,11 @@ | |
import org.jeasy.props.annotations.EnvironmentVariable; | ||
import org.jeasy.props.api.AnnotationProcessingException; | ||
|
||
/** | ||
* An annotation processor that loads properties from environment variables. | ||
* | ||
* @author Greg Schofield ([email protected]) | ||
*/ | ||
public class EnvironmentVariableAnnotationProcessor extends AbstractAnnotationProcessor<EnvironmentVariable> { | ||
|
||
private static final Logger LOGGER = Logger.getLogger(EnvironmentVariableAnnotationProcessor.class.getName()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,16 +39,14 @@ | |
import static java.lang.String.format; | ||
|
||
/** | ||
* An annotation processor that loads a header value from META-INF/MANIFEST.MF file. | ||
* An annotation processor that loads a header value from {@code META-INF/MANIFEST.MF} file. | ||
* | ||
* @author Mahmoud Ben Hassine ([email protected]) | ||
*/ | ||
public class ManifestPropertyAnnotationProcessor extends AbstractAnnotationProcessor<ManifestProperty> { | ||
|
||
private static final Logger LOGGER = Logger.getLogger(ManifestPropertyAnnotationProcessor.class.getName()); | ||
|
||
private static final String CLASSPATH = System.getProperty("java.class.path"); | ||
|
||
private static final String PATH_SEPARATOR = System.getProperty("path.separator"); | ||
|
||
/** | ||
|