Refine search
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { AnnotationValue value = annotationInstance.value(); if (value == null) { return null; } return propertyReplacer.replaceProperties(value.asString()); } }
final AnnotationTarget annotationTarget = annotation.target(); final AnnotationValue nameValue = annotation.value("name"); final String name = (nameValue != null) ? replacer.replaceProperties(nameValue.asString()) : null; final AnnotationValue typeValue = annotation.value("type"); final String type = typeValue != null ? typeValue.asClass().name().toString() : null; if (annotationTarget instanceof FieldInfo) { final FieldInfo fieldInfo = (FieldInfo) annotationTarget; if (annotationTarget instanceof ClassInfo) { final ClassInfo classInfo = (ClassInfo) annotationTarget; final AnnotationInstance[] values = outerAnnotation.value("value").asNestedArray(); for (AnnotationInstance annotation : values) { final AnnotationValue nameValue = annotation.value("name"); final String name = (nameValue != null) ? replacer.replaceProperties(nameValue.asString()) : null; final AnnotationValue typeValue = annotation.value("type"); final String type = (typeValue != null) ? typeValue.asClass().name().toString() : null;
AnnotationTarget target = instance.target(); if (!(target instanceof ClassInfo)) { throw EeLogger.ROOT_LOGGER.classOnlyAnnotation("@ManagedBean", target); final AnnotationValue nameValue = instance.value(); final String beanName = (nameValue == null || nameValue.asString().isEmpty()) ? beanClassName : replacer.replaceProperties(nameValue.asString()); final ManagedBeanComponentDescription componentDescription = new ManagedBeanComponentDescription(beanName, beanClassName, moduleDescription, deploymentUnit.getServiceName());
final AnnotationTarget target = sessionBeanAnnotation.target(); if (!(target instanceof ClassInfo)) { EjbLogger.DEPLOYMENT_LOGGER.warn(EjbLogger.ROOT_LOGGER.annotationOnlyAllowedOnClass(sessionBeanAnnotation.name().toString(), target).getMessage()); continue; final AnnotationValue nameValue = sessionBeanAnnotation.value("name"); final String beanName = (nameValue == null || nameValue.asString().isEmpty()) ? ejbName : propertyReplacer.replaceProperties(nameValue.asString()); final SessionBeanMetaData beanMetaData = getEnterpriseBeanMetaData(deploymentUnit, beanName, SessionBeanMetaData.class); final SessionBeanComponentDescription.SessionBeanType sessionBeanType; final boolean passivationCapableAnnotationValue = sessionBeanAnnotation.value("passivationCapable") == null ? true : sessionBeanAnnotation.value("passivationCapable").asBoolean(); final Boolean passivationCapableDeploymentDescriptorValue; if ((beanMetaData instanceof SessionBean32MetaData)) {
public static String asRequiredString(AnnotationInstance annotationInstance, final String attributeName, PropertyReplacer propertyReplacer) { final AnnotationValue nameValue = annotationInstance.value(attributeName); if (nameValue == null) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } final String nameValueAsString = nameValue.asString(); if (nameValueAsString.isEmpty()) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } return propertyReplacer != null ? propertyReplacer.replaceProperties(nameValueAsString) : nameValueAsString; } }
private Properties getActivationConfigProperties(final AnnotationInstance messageBeanAnnotation, PropertyReplacer propertyReplacer) { final Properties props = new Properties(); final AnnotationValue activationConfig = messageBeanAnnotation.value("activationConfig"); if (activationConfig == null) return props; for (final AnnotationInstance propAnnotation : activationConfig.asNestedArray()) { String propertyName = propAnnotation.value("propertyName").asString(); String propertyValue = propAnnotation.value("propertyValue").asString(); props.put(propertyReplacer.replaceProperties(propertyName), propertyReplacer.replaceProperties(propertyValue)); } return props; }
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; }
@Override protected String interpolate(String text) { if(text == null) { return null; } return replacer.replaceProperties(text); } }
public void set(final AutoTimer timer, final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { final AnnotationValue value = annotationInstance.value(name); if (booleanValue) { if (value == null) { setBoolean(timer, defaultBooleanValue); } else { setBoolean(timer, value.asBoolean()); } } else { if (value == null) { setString(timer, defaultStringValue); } else { setString(timer, propertyReplacer.replaceProperties(value.asString())); } } }
@Override protected String[] fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { String[] values = annotationInstance.value().asStringArray(); for (int i = 0; i < values.length; i++) { values[i] = propertyReplacer.replaceProperties(values[i]); } return values; } }
final AnnotationTarget annotationTarget = annotation.target(); final AnnotationValue nameValue = annotation.value("name"); final String name = (nameValue != null) ? replacer.replaceProperties(nameValue.asString()) : null; final AnnotationValue typeValue = annotation.value("type"); final String type = typeValue != null ? typeValue.asClass().name().toString() : null; if (annotationTarget instanceof FieldInfo) { final FieldInfo fieldInfo = (FieldInfo) annotationTarget; if (annotationTarget instanceof ClassInfo) { final ClassInfo classInfo = (ClassInfo) annotationTarget; final AnnotationInstance[] values = outerAnnotation.value("value").asNestedArray(); for (AnnotationInstance annotation : values) { final AnnotationValue nameValue = annotation.value("name"); final String name = (nameValue != null) ? replacer.replaceProperties(nameValue.asString()) : null; final AnnotationValue typeValue = annotation.value("type"); final String type = (typeValue != null) ? typeValue.asClass().name().toString() : null;
final AnnotationTarget target = messageBeanAnnotation.target(); final ClassInfo beanClassInfo = (ClassInfo) target; if (! EjbValidationsUtil.assertEjbClassValidity(beanClassInfo).isEmpty() ) { final AnnotationValue nameValue = messageBeanAnnotation.value("name"); final String beanName = (nameValue == null || nameValue.asString().isEmpty()) ? ejbName : propertyReplacer.replaceProperties(nameValue.asString()); final MessageDrivenBeanMetaData beanMetaData = getEnterpriseBeanMetaData(deploymentUnit, beanName, MessageDrivenBeanMetaData.class); final String beanClassName;
public static String asRequiredString(AnnotationInstance annotationInstance, final String attributeName, PropertyReplacer propertyReplacer) { final AnnotationValue nameValue = annotationInstance.value(attributeName); if (nameValue == null) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } final String nameValueAsString = nameValue.asString(); if (nameValueAsString.isEmpty()) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } return propertyReplacer != null ? propertyReplacer.replaceProperties(nameValueAsString) : nameValueAsString; } }
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; }
public void setPolicy(String value) { this.policy = (this.replacer != null) ? this.replacer.replaceProperties(value) : value; }
@Override protected String[] fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { String[] values = annotationInstance.value().asStringArray(); for (int i = 0; i < values.length; i++) { values[i] = propertyReplacer.replaceProperties(values[i]); } return values; } }
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { return propertyReplacer.replaceProperties(annotationInstance.value().asString()); } }
final AnnotationTarget annotationTarget = annotation.target(); final AnnotationValue nameValue = annotation.value("name"); final String name = (nameValue != null) ? replacer.replaceProperties(nameValue.asString()) : null; final AnnotationValue typeValue = annotation.value("type"); final String type = typeValue != null ? typeValue.asClass().name().toString() : null; if (annotationTarget instanceof FieldInfo) { final FieldInfo fieldInfo = (FieldInfo) annotationTarget; if (annotationTarget instanceof ClassInfo) { final ClassInfo classInfo = (ClassInfo) annotationTarget; final AnnotationInstance[] values = outerAnnotation.value("value").asNestedArray(); for (AnnotationInstance annotation : values) { final AnnotationValue nameValue = annotation.value("name"); final String name = (nameValue != null) ? replacer.replaceProperties(nameValue.asString()) : null; final AnnotationValue typeValue = annotation.value("type"); final String type = (typeValue != null) ? typeValue.asClass().name().toString() : null;
AnnotationTarget target = instance.target(); if (!(target instanceof ClassInfo)) { throw EeLogger.ROOT_LOGGER.classOnlyAnnotation("@ManagedBean", target); final AnnotationValue nameValue = instance.value(); final String beanName = (nameValue == null || nameValue.asString().isEmpty()) ? beanClassName : replacer.replaceProperties(nameValue.asString()); final ManagedBeanComponentDescription componentDescription = new ManagedBeanComponentDescription(beanName, beanClassName, moduleDescription, deploymentUnit.getServiceName());
public static String asRequiredString(AnnotationInstance annotationInstance, final String attributeName, PropertyReplacer propertyReplacer) { final AnnotationValue nameValue = annotationInstance.value(attributeName); if (nameValue == null) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } final String nameValueAsString = nameValue.asString(); if (nameValueAsString.isEmpty()) { throw ROOT_LOGGER.annotationAttributeMissing(annotationInstance.name().toString(), attributeName); } return propertyReplacer != null ? propertyReplacer.replaceProperties(nameValueAsString) : nameValueAsString; } }