private List<BindingConfiguration> getAnnotatedClassBindingConfigurations(EEModuleDescription moduleDescription, AnnotationInstance annotationInstance) throws DeploymentUnitProcessingException { final AnnotationTarget target = annotationInstance.target(); if (!(target instanceof ClassInfo)) { throw ROOT_LOGGER.classOnlyAnnotation(annotationInstance.toString(), target); } final ClassInfo classInfo = (ClassInfo) target; return moduleDescription.addOrGetLocalClassDescription(classInfo.name().toString()).getBindingConfigurations(); }
@Override public String toString() { return annotation.toString(); }
/** * Returns a string representation for this annotation instance. This method is equivalent * to calling {@link #toString(boolean)} with a value of true. * * @return a simple string representation for this annotation instance */ public String toString() { return toString(true); }
@Override public int hashCode() { return annotation.toString().hashCode(); }
void appendAnnotations(StringBuilder builder) { AnnotationInstance[] annotations = this.annotations; if (annotations.length > 0) { for (AnnotationInstance instance : annotations) { builder.append(instance.toString(true)).append(' '); } } }
private boolean hasCamelActivationAnnotations(final DeploymentUnit depUnit) { boolean result = false; // Search for Camel activation annotations for (String annotationClassName : ACTIVATION_ANNOTATIONS) { if (annotationClassName.equals("org.wildfly.extension.camel.CamelAware")) { AnnotationInstance annotation = getAnnotation(depUnit, annotationClassName); if (annotation != null) { LOGGER.debug("@CamelAware annotation found"); AnnotationValue value = annotation.value(); result = value != null ? value.asBoolean() : true; if (result) { break; } } } else { List<AnnotationInstance> annotations = getAnnotations(depUnit, annotationClassName); if (!annotations.isEmpty()) { LOGGER.debug("{} annotation found", annotations.get(0).toString(true)); result = true; break; } } } return result; }
private boolean hasCamelActivationAnnotations(final DeploymentUnit depUnit) { boolean result = false; // Search for Camel activation annotations for (String annotationClassName : ACTIVATION_ANNOTATIONS) { if (annotationClassName.equals("org.wildfly.extension.camel.CamelAware")) { AnnotationInstance annotation = getAnnotation(depUnit, annotationClassName); if (annotation != null) { LOGGER.debug("@CamelAware annotation found"); AnnotationValue value = annotation.value(); result = value != null ? value.asBoolean() : true; if (result) { break; } } } else { List<AnnotationInstance> annotations = getAnnotations(depUnit, annotationClassName); if (!annotations.isEmpty()) { LOGGER.debug("{} annotation found", annotations.get(0).toString(true)); result = true; break; } } } return result; }
private List<BindingConfiguration> getAnnotatedClassBindingConfigurations(EEModuleDescription moduleDescription, AnnotationInstance annotationInstance) throws DeploymentUnitProcessingException { final AnnotationTarget target = annotationInstance.target(); if (!(target instanceof ClassInfo)) { throw ROOT_LOGGER.classOnlyAnnotation(annotationInstance.toString(), target); } final ClassInfo classInfo = (ClassInfo) target; return moduleDescription.addOrGetLocalClassDescription(classInfo.name().toString()).getBindingConfigurations(); }
private List<BindingConfiguration> getAnnotatedClassBindingConfigurations(EEModuleDescription moduleDescription, AnnotationInstance annotationInstance) throws DeploymentUnitProcessingException { final AnnotationTarget target = annotationInstance.target(); if (!(target instanceof ClassInfo)) { throw ROOT_LOGGER.classOnlyAnnotation(annotationInstance.toString(), target); } final ClassInfo classInfo = (ClassInfo) target; return moduleDescription.addOrGetLocalClassDescription(classInfo.name().toString()).getBindingConfigurations(); }
private PersistenceUnitMetadata getPersistenceUnit(final DeploymentUnit deploymentUnit, final AnnotationInstance annotation, EEModuleClassDescription classDescription) throws DeploymentUnitProcessingException { final AnnotationValue puName = annotation.value("unitName"); String searchName = null; // note: a null searchName will match the first PU definition found if (puName != null && (searchName = puName.asString()) != null) { searchName = SpecDescriptorPropertyReplacement.propertyReplacer(deploymentUnit).replaceProperties(searchName); } ROOT_LOGGER.debugf("persistence unit search for unitName=%s referenced from class=%s (annotation=%s)", searchName, classDescription.getClassName(), annotation.toString()); PersistenceUnitMetadata pu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, searchName); if (null == pu) { classDescription.setInvalid(JpaLogger.ROOT_LOGGER.persistenceUnitNotFound(searchName, deploymentUnit)); return null; } return pu; }
private PersistenceUnitMetadata getPersistenceUnit(final DeploymentUnit deploymentUnit, final AnnotationInstance annotation, EEModuleClassDescription classDescription) throws DeploymentUnitProcessingException { final AnnotationValue puName = annotation.value("unitName"); String searchName = null; // note: a null searchName will match the first PU definition found if (puName != null && (searchName = puName.asString()) != null) { searchName = SpecDescriptorPropertyReplacement.propertyReplacer(deploymentUnit).replaceProperties(searchName); } ROOT_LOGGER.debugf("persistence unit search for unitName=%s referenced from class=%s (annotation=%s)", searchName, classDescription.getClassName(), annotation.toString()); PersistenceUnitMetadata pu = PersistenceUnitSearch.resolvePersistenceUnitSupplier(deploymentUnit, searchName); if (null == pu) { classDescription.setInvalid(JpaLogger.ROOT_LOGGER.persistenceUnitNotFound(searchName, deploymentUnit)); return null; } return pu; }