Author: dan.j.allen
Date: 2009-12-23 16:46:11 -0500 (Wed, 23 Dec 2009)
New Revision: 11879
Modified:
modules/envconfig/trunk/readme.txt
modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/Bind.java
modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/JndiBinder.java
Log:
change jndiAddress attribute to value to simplify annotation declaration
Modified: modules/envconfig/trunk/readme.txt
===================================================================
--- modules/envconfig/trunk/readme.txt 2009-12-23 21:42:36 UTC (rev 11878)
+++ modules/envconfig/trunk/readme.txt 2009-12-23 21:46:11 UTC (rev 11879)
@@ -12,7 +12,7 @@
public @EnvironmentBinding class EnvironmentVars
{
- @Bind(jndiAddress="msg") private final String msg = "Hello
World!";
+ @Bind("msg") private final String msg = "Hello World!";
}
You can then inject the value into a managed bean as follows:
Modified: modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/Bind.java
===================================================================
--- modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/Bind.java 2009-12-23
21:42:36 UTC (rev 11878)
+++ modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/Bind.java 2009-12-23
21:46:11 UTC (rev 11879)
@@ -28,6 +28,6 @@
@Retention(RetentionPolicy.RUNTIME)
public @interface Bind
{
- String jndiAddress();
+ String value();
boolean overwrite() default true;
}
Modified:
modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/JndiBinder.java
===================================================================
---
modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/JndiBinder.java 2009-12-23
21:42:36 UTC (rev 11878)
+++
modules/envconfig/trunk/src/main/java/org/jboss/seam/envconfig/extension/JndiBinder.java 2009-12-23
21:46:11 UTC (rev 11879)
@@ -67,7 +67,7 @@
field.setAccessible(true);
Bind ann = field.getAnnotation(Bind.class);
- String jndi = ann.jndiAddress();
+ String jndi = ann.value();
boolean overwrite = ann.overwrite();
Object val = field.get(beanInstance);
Show replies by date