Witam, mam taki o to problem.
Stworzyłem sobie adnotacje w jednym projekcie Java w środowisku Eclipse
package test.annotation
public @INTERFACE myAnnotation {
String[] params() default {""};
}
w tym samym stworzyłem sobie klase
public testMyAdnotation {
@myAnnotation
@ConstructorProperties(value = {""})
public testMyAdnotation() {
};
}
w kolejnym projekcie chce to wykorzytac
String[] t = null;
Constructor<?>[] constructor = testMyAdnotation.class.getConstructors();
for (Constructor<?> constructor2 : constructor) {
myAnnotation hc = constructor2.getAnnotation(myAnnotation.class);
ConstructorProperties cp = constructor2.getAnnotation(ConstructorProperties.class);
if(hc != null ) {
t= hc.params();
break;
}
if(cp != null) {
t= cp.value();
break;
}
}
I problem polega na tym ze constructorPreperties jest a mojej nie ma ktoś ma pomysł ?