diff options
Diffstat (limited to 'jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java')
-rw-r--r-- | jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java index df5c4bf4bc..d9b7a8ed2f 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/Injection.java @@ -49,11 +49,11 @@ public class Injection private Class<?> _paramClass; private Class<?> _resourceClass; - + public Injection () { } - + /** * @return the _className @@ -67,22 +67,22 @@ public class Injection { return _paramClass; } - + public Class<?> getResourceClass () { return _resourceClass; } - + public boolean isField () { return (_target != null && _target instanceof Field); } - + public boolean isMethod () { return (_target != null && _target instanceof Method); } - + /** * @return the jndiName */ @@ -111,7 +111,7 @@ public class Injection { this._mappingName = mappingName; } - + /** * @return the target */ @@ -119,7 +119,7 @@ public class Injection { return _target; } - + public void setTarget(Class<?> clazz, Field field, Class<?> resourceType) { @@ -127,7 +127,7 @@ public class Injection _target = field; _resourceClass = resourceType; } - + public void setTarget(Class<?> clazz, Method method, Class<?> arg, Class<?> resourceType) { _targetClass = clazz; @@ -135,12 +135,12 @@ public class Injection _resourceClass = resourceType; _paramClass = arg; } - + public void setTarget (Class<?> clazz, String target, Class<?> resourceType) { _targetClass = clazz; _resourceClass = resourceType; - + //first look for a javabeans style setter matching the targetName String setter = "set"+target.substring(0,1).toUpperCase(Locale.ENGLISH)+target.substring(1); try @@ -165,13 +165,13 @@ public class Injection } } - + /** * Inject a value for a Resource from JNDI into an object * @param injectable */ public void inject (Object injectable) - { + { if (_target != null) { if (_target instanceof Field) @@ -183,7 +183,7 @@ public class Injection throw new IllegalStateException ("No method or field to inject with "+getJndiName()); } - + /** * The Resource must already exist in the ENC of this webapp. * @return the injected valud @@ -195,7 +195,7 @@ public class Injection InitialContext context = new InitialContext(); return context.lookup("java:comp/env/"+getJndiName()); } - + /** @@ -204,7 +204,7 @@ public class Injection * @param injectable */ protected void injectField (Field field, Object injectable) - { + { try { boolean accessibility = field.isAccessible(); @@ -239,5 +239,5 @@ public class Injection throw new IllegalStateException("Inject failed for method "+method.getName()); } } - + } |