X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fadsal%2Fnorthbound%2Fcommons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnorthbound%2Fcommons%2Fquery%2FAccessor.java;fp=opendaylight%2Fadsal%2Fnorthbound%2Fcommons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnorthbound%2Fcommons%2Fquery%2FAccessor.java;h=0000000000000000000000000000000000000000;hb=50f88249a65c52ba56a48852b71ce432fed2bbeb;hp=2d910edc6d7e538fe740157ceadcbbf7d670c63e;hpb=abfa9a03550cbe9fccc4420684dced175dd6d119;p=controller.git diff --git a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/Accessor.java b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/Accessor.java deleted file mode 100644 index 2d910edc6d..0000000000 --- a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/Accessor.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.opendaylight.controller.northbound.commons.query; - -import java.lang.annotation.Annotation; -import java.lang.reflect.AccessibleObject; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Type; - -/*package*/ class Accessor { - protected final AccessibleObject _accessorObj; - - public Accessor(AccessibleObject accessor) { - _accessorObj = accessor; - _accessorObj.setAccessible(true); - } - - public AccessibleObject getAccessibleObject() { - return _accessorObj; - } - - public Annotation[] getAnnotations() { - return _accessorObj.getAnnotations(); - } - - public Object getValue(Object parent) throws QueryException { - try { - if (_accessorObj instanceof Field) { - return ((Field)_accessorObj).get(parent); - } else { - // assume method - return ((Method)_accessorObj).invoke(parent); - } - } catch (Exception e) { - throw new QueryException("Failure in retrieving value", e); - } - } - public Type getGenericType() { - if (_accessorObj instanceof Field) { - return ((Field)_accessorObj).getGenericType(); - } else { - // assume method - return ((Method)_accessorObj).getGenericReturnType(); - } - } - public Class getType() { - - if (_accessorObj instanceof Field) { - return ((Field)_accessorObj).getType(); - } else { - // assume method - return ((Method)_accessorObj).getReturnType(); - } - } - -}