/** * Represents a cache miss, and will fetch all of the information needed about the * AnnotatedElement in order to quickly determine what its resolver would be * * @param annotatedElement The raw annotated element that can be used to * calculate the information needed to determine the resolver * @return An annotated element constructed from the information in the annotatedElement */ static AnnotatedElementAnnotationInfo computeAEAI(AnnotatedElement annotatedElement) { if (annotatedElement instanceof Method) { final Method m = (Method) annotatedElement; return new AnnotatedElementAnnotationInfo(m.getAnnotations(), true, m.getParameterAnnotations(), false); } else if (annotatedElement instanceof Constructor) { final Constructor<?> c = (Constructor<?>) annotatedElement; return new AnnotatedElementAnnotationInfo(c.getAnnotations(), true, c.getParameterAnnotations(), true); } else { return new AnnotatedElementAnnotationInfo(annotatedElement.getAnnotations(), false, new Annotation[0][], false); } }
private AnnotatedElementAnnotationInfo computeElementAnnotationInfo(AnnotatedElement ae) { AnnotatedElementAnnotationInfo hard; SoftAnnotatedElementAnnotationInfo soft = threadLocalAnnotationCache.get().get(ae); if (soft != null) { hard = soft.harden(ae); } else { hard = Utilities.computeAEAI(ae); soft = hard.soften(); threadLocalAnnotationCache.get().put(ae, soft); } return hard; }
private AnnotatedElementAnnotationInfo computeElementAnnotationInfo(AnnotatedElement ae) { AnnotatedElementAnnotationInfo hard; SoftAnnotatedElementAnnotationInfo soft = threadLocalAnnotationCache.get().get(ae); if (soft != null) { hard = soft.harden(ae); } else { hard = Utilities.computeAEAI(ae); soft = hard.soften(); threadLocalAnnotationCache.get().put(ae, soft); } return hard; }
AnnotatedElementAnnotationInfo harden(AnnotatedElement ae) { Annotation[] hardenedElementAnnotations = elementAnnotationsReference.get(); Annotation[][] hardenedParamAnnotations = paramAnnotationsReference.get(); if (!Utilities.USE_SOFT_REFERENCE || (hardenedElementAnnotations == null) || (hardenedParamAnnotations == null)) { return Utilities.computeAEAI(ae); } return new AnnotatedElementAnnotationInfo(hardenedElementAnnotations, hasParams, hardenedParamAnnotations, isConstructor); } }
private AnnotatedElementAnnotationInfo computeElementAnnotationInfo(AnnotatedElement ae) { AnnotatedElementAnnotationInfo hard; SoftAnnotatedElementAnnotationInfo soft = threadLocalAnnotationCache.get().get(ae); if (soft != null) { hard = soft.harden(ae); } else { hard = Utilities.computeAEAI(ae); soft = hard.soften(); threadLocalAnnotationCache.get().put(ae, soft); } return hard; }
/** * Represents a cache miss, and will fetch all of the information needed about the * AnnotatedElement in order to quickly determine what its resolver would be * * @param annotatedElement The raw annotated element that can be used to * calculate the information needed to determine the resolver * @return An annotated element constructed from the information in the annotatedElement */ static AnnotatedElementAnnotationInfo computeAEAI(AnnotatedElement annotatedElement) { if (annotatedElement instanceof Method) { final Method m = (Method) annotatedElement; return new AnnotatedElementAnnotationInfo(m.getAnnotations(), true, m.getParameterAnnotations(), false); } else if (annotatedElement instanceof Constructor) { final Constructor<?> c = (Constructor<?>) annotatedElement; return new AnnotatedElementAnnotationInfo(c.getAnnotations(), true, c.getParameterAnnotations(), true); } else { return new AnnotatedElementAnnotationInfo(annotatedElement.getAnnotations(), false, new Annotation[0][], false); } }
private AnnotatedElementAnnotationInfo computeElementAnnotationInfo(AnnotatedElement ae) { AnnotatedElementAnnotationInfo hard; SoftAnnotatedElementAnnotationInfo soft = threadLocalAnnotationCache.get().get(ae); if (soft != null) { hard = soft.harden(ae); } else { hard = Utilities.computeAEAI(ae); soft = hard.soften(); threadLocalAnnotationCache.get().put(ae, soft); } return hard; }
/** * Represents a cache miss, and will fetch all of the information needed about the * AnnotatedElement in order to quickly determine what its resolver would be * * @param annotatedElement The raw annotated element that can be used to * calculate the information needed to determine the resolver * @return An annotated element constructed from the information in the annotatedElement */ static AnnotatedElementAnnotationInfo computeAEAI(AnnotatedElement annotatedElement) { if (annotatedElement instanceof Method) { final Method m = (Method) annotatedElement; return new AnnotatedElementAnnotationInfo(m.getAnnotations(), true, m.getParameterAnnotations(), false); } else if (annotatedElement instanceof Constructor) { final Constructor<?> c = (Constructor<?>) annotatedElement; return new AnnotatedElementAnnotationInfo(c.getAnnotations(), true, c.getParameterAnnotations(), true); } else { return new AnnotatedElementAnnotationInfo(annotatedElement.getAnnotations(), false, new Annotation[0][], false); } }
/** * Represents a cache miss, and will fetch all of the information needed about the * AnnotatedElement in order to quickly determine what its resolver would be * * @param annotatedElement The raw annotated element that can be used to * calculate the information needed to determine the resolver * @return An annotated element constructed from the information in the annotatedElement */ static AnnotatedElementAnnotationInfo computeAEAI(AnnotatedElement annotatedElement) { if (annotatedElement instanceof Method) { final Method m = (Method) annotatedElement; return new AnnotatedElementAnnotationInfo(m.getAnnotations(), true, m.getParameterAnnotations(), false); } else if (annotatedElement instanceof Constructor) { final Constructor<?> c = (Constructor<?>) annotatedElement; return new AnnotatedElementAnnotationInfo(c.getAnnotations(), true, c.getParameterAnnotations(), true); } else { return new AnnotatedElementAnnotationInfo(annotatedElement.getAnnotations(), false, new Annotation[0][], false); } }
AnnotatedElementAnnotationInfo harden(AnnotatedElement ae) { Annotation[] hardenedElementAnnotations = elementAnnotationsReference.get(); Annotation[][] hardenedParamAnnotations = paramAnnotationsReference.get(); if (!Utilities.USE_SOFT_REFERENCE || (hardenedElementAnnotations == null) || (hardenedParamAnnotations == null)) { return Utilities.computeAEAI(ae); } return new AnnotatedElementAnnotationInfo(hardenedElementAnnotations, hasParams, hardenedParamAnnotations, isConstructor); } }
AnnotatedElementAnnotationInfo harden(AnnotatedElement ae) { Annotation[] hardenedElementAnnotations = elementAnnotationsReference.get(); Annotation[][] hardenedParamAnnotations = paramAnnotationsReference.get(); if (!Utilities.USE_SOFT_REFERENCE || (hardenedElementAnnotations == null) || (hardenedParamAnnotations == null)) { return Utilities.computeAEAI(ae); } return new AnnotatedElementAnnotationInfo(hardenedElementAnnotations, hasParams, hardenedParamAnnotations, isConstructor); } }
AnnotatedElementAnnotationInfo harden(AnnotatedElement ae) { Annotation[] hardenedElementAnnotations = elementAnnotationsReference.get(); Annotation[][] hardenedParamAnnotations = paramAnnotationsReference.get(); if (!Utilities.USE_SOFT_REFERENCE || (hardenedElementAnnotations == null) || (hardenedParamAnnotations == null)) { return Utilities.computeAEAI(ae); } return new AnnotatedElementAnnotationInfo(hardenedElementAnnotations, hasParams, hardenedParamAnnotations, isConstructor); } }