Galera estou desenvolvendo um pequeno Framework com anotação, e gostaria de saber como eu posso pegar o valor de uma anotação dentro de outra tentei via getAnnotation só q ele me retorna zero anotações
Segue o Codigo
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import br.com.validator.validators.NotNullValidator;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@ValidationClass(NotNullValidator.class)
@Documented
@Inherited
public @interface NotNull
{
}
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
@Documented
@Inherited
public @interface ValidationClass
{
Class value();
}
E estou querendo verificar se ValidationClass
existe so que so me retorna []
anotações segue o meu codigo
[code] private static void checkAnnotatioValid(ArrayList annotations)
{
int i = 0;
while(i < annotations.size())
{
if(!annotations.get(i).getClass().isAnnotationPresent(ValidationClass.class))
annotations.remove(i);
else
i++;
}
}[/code]