[cdi-dev] [JBoss JIRA] (CDI-503) Properties injection from files to classes

Nikos Ballas (JIRA) issues at jboss.org
Fri Jan 30 15:20:49 EST 2015


     [ https://issues.jboss.org/browse/CDI-503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nikos Ballas updated CDI-503:
-----------------------------
    Summary: Properties injection from files to classes  (was: Properties injection from files to classes that are valid beans)


> Properties injection from files to classes
> ------------------------------------------
>
>                 Key: CDI-503
>                 URL: https://issues.jboss.org/browse/CDI-503
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Contexts, Packaging and Deployment
>            Reporter: Nikos Ballas
>
> I would like to be able to provide under META-INF folder my .properties file and have the the values automatically injected(loaded) into my bean using annotation injection. DeltaSpike offers something similar but with alot of tricky code.I would like to be able to do the following:
> case 1:
> public MyClass{
>  @PropertiesInjection(file = "/path/to/file")
>  private Properties properties
> }
> case 2:
> @PropertyPlaceholder(file = "path/to/file")
> public MyClass {
>    @InjectProperty(name="property.name")
>    private String propertyName
>    
>    @PropertyPlaceholder(file = "path/to/other/file") 
>    public void someMethod(){
>      @InjectProperty(name = "other.property")
>       String propertyName;
>       endpoint = propertyName+port;
>    }
> }
> Again it should be stated that would be nice to be able to apply the @PropertyPlaceholder annotation either as classlevel annotation and being able to override the value if it's  in method level with different parameters.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the cdi-dev mailing list