/** * Retrieves the annotations from an AnnotatedObject, initializing them if necessary. * * @param ao The annotated object instance with possibly non-initialized annotations * @return The returned annotations are ensured to be initialized * @since 2.4.0 */ public static Collection<Annotation> ensureInitializedAnnotations(AnnotatedObject ao) { Collection<Annotation> annotations; if (IntactCore.isInitialized(ao.getAnnotations())) { annotations = ao.getAnnotations(); } else { annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(ao.getClass(), ao.getAc()); } return annotations; }
/** * Retrieves the annotations from an AnnotatedObject, initializing them if necessary. * * @param ao The annotated object instance with possibly non-initialized annotations * @return The returned annotations are ensured to be initialized * @since 2.4.0 */ public static Collection<Annotation> ensureInitializedAnnotations(AnnotatedObject ao) { Collection<Annotation> annotations; if (IntactCore.isInitialized(ao.getAnnotations())) { annotations = ao.getAnnotations(); } else { annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(ao.getClass(), ao.getAc()); } return annotations; }
private static Collection<Annotation> fetchAnnotations(Interaction interaction) { Collection<Annotation> annotations; if (IntactCore.isInitialized(interaction.getAnnotations())) { annotations = interaction.getAnnotations(); } else { annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(InteractionImpl.class, interaction.getAc()); } return annotations; }
private static Collection<Annotation> fetchAnnotations(Interaction interaction) { Collection<Annotation> annotations; if (IntactCore.isInitialized(interaction.getAnnotations())) { annotations = interaction.getAnnotations(); } else { annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(InteractionImpl.class, interaction.getAc()); } return annotations; }