Hello Guys,
我试图在JDK 1.5中从字段中获取注释,但我得到了上图中提到的异常。
private WorkFlowHeader getFlowHeader(Field field)
{
for(Annotation annotationL:field.getAnnotations())
{if(annotationL instanceof WorkFlowHeader)
return (WorkFlowHeader) annotationL;
}
return null;
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface WorkFlowHeader {
}