/** * @return the last element pushed on the stack which ElementType was * the one passed or null if no stack element is of the given type. */ public AnnotatedElement getLastAnnotatedElement(ElementType type) { for (int i=annotatedElements.size();i!=0;i--) { StackElement e = annotatedElements.get(i - 1); if (e.getElementType().equals(type)) return e.getAnnotatedElement(); } return null; }
/** * @return the top annotated elements stack element type */ private ElementType getTopElementType() { try { StackElement top = annotatedElements.peek(); return top.getElementType(); } catch(EmptyStackException ex) { return null; } } }
private void logStart(AnnotatedElementHandler handler, ElementType type, AnnotatedElement c) throws AnnotationProcessorException { if (AnnotationUtils.shouldLog("types")) { AnnotationUtils.getLogger().finer(type + " START : " + c); } // push it to our annotated element stack annotatedElements.push(new StackElement(type, c)); if(delegate!=null) { delegate.getStack().push(new StackElement(type, c)); } if (handler!=null) { handler.startElement(type, c); } }
/** * @return the top annotated elements stack element type */ private ElementType getTopElementType() { try { StackElement top = annotatedElements.peek(); return top.getElementType(); } catch(EmptyStackException ex) { return null; } } }
private void logStart(AnnotatedElementHandler handler, ElementType type, AnnotatedElement c) throws AnnotationProcessorException { if (AnnotationUtils.shouldLog("types")) { AnnotationUtils.getLogger().finer(type + " START : " + c); } // push it to our annotated element stack annotatedElements.push(new StackElement(type, c)); if(delegate!=null) { delegate.getStack().push(new StackElement(type, c)); } if (handler!=null) { handler.startElement(type, c); } }
/** * @return the last element pushed on the stack which ElementType was * the one passed or null if no stack element is of the given type. */ public AnnotatedElement getLastAnnotatedElement(ElementType type) { for (int i=annotatedElements.size();i!=0;i--) { StackElement e = annotatedElements.get(i - 1); if (e.getElementType().equals(type)) return e.getAnnotatedElement(); } return null; }