You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2014/05/06 16:58:02 UTC
svn commit: r1592766 -
/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java
Author: clement
Date: Tue May 6 14:58:01 2014
New Revision: 1592766
URL: http://svn.apache.org/r1592766
Log:
To avoid breaking the APi, re-add a getNode method returning object (FELIX-4509).
Modified:
felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java
Modified: felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java?rev=1592766&r1=1592765&r2=1592766&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java (original)
+++ felix/trunk/ipojo/manipulator/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/spi/BindingContext.java Tue May 6 14:58:01 2014
@@ -131,4 +131,32 @@ public class BindingContext {
public Object getVisitor() {
return visitor;
}
+
+ /**
+ * This method is just to support the compatibility with the previous version. It returns an ASM node of the
+ * member on which the annotation is 'attached'. The type of the node depends on this element. It can be a {@link
+ * org.objectweb.asm.tree.FieldNode}, a {@link org.objectweb.asm.tree.MethodNode} or a
+ * {@link org.objectweb.asm.tree.ClassNode}. It actually checks the current node and returns the first set ones
+ * in this order: field, method, class.
+ * <p/>
+ * The type of the returned object can be determined using the {@link #getElementType} method. However it is
+ * recommended to use one of the following method: {@link #getFieldNode()}, {@link #getMethodNode()} or
+ * {@link #getClassNode()}.
+ *
+ * @return the node.
+ * @deprecated
+ */
+ public Object getNode() {
+ if (field != null) {
+ return field;
+ }
+ if (method != null) {
+ return method;
+ }
+ if (clazz != null) {
+ return clazz;
+ }
+ // No node ?
+ return null;
+ }
}