protected List<TargetAnnotation> fromMultiAnnotation(AnnotationInstance multiAnnotationInstance) { List<TargetAnnotation> instances = new ArrayList<TargetAnnotation>(); final AnnotationInstance[] values = multiAnnotationInstance.value().asNestedArray(); for(AnnotationInstance value : values) { instances.add(new TargetAnnotation(value, multiAnnotationInstance.target())); } return instances; }
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; }
if (collectionAnnotationName != null) { for (AnnotationInstance annotationInstance : index.getAnnotations(collectionAnnotationName)) { final AnnotationInstance[] nestedAnnotationInstances = annotationInstance.value().asNestedArray(); if (nestedAnnotationInstances != null && nestedAnnotationInstances.length > 0) { final List<BindingConfiguration> bindingConfigurations = getAnnotatedClassBindingConfigurations(moduleDescription, annotationInstance);
if (annotationTarget instanceof ClassInfo) { final AnnotationValue annotationValue = annotation.value(); final AnnotationInstance[] ejbAnnotations = annotationValue.asNestedArray(); for (AnnotationInstance ejbAnnotation : ejbAnnotations) { final EJBResourceWrapper annotationWrapper = new EJBResourceWrapper(ejbAnnotation, propertyReplacer);
AnnotationInstance[] initParamsAnnotations = initParamsValue.asNestedArray(); if (initParamsAnnotations != null && initParamsAnnotations.length > 0) { List<ParamValueMetaData> initParams = new ArrayList<ParamValueMetaData>(); AnnotationInstance[] initParamsAnnotations = initParamsValue.asNestedArray(); if (initParamsAnnotations != null && initParamsAnnotations.length > 0) { List<ParamValueMetaData> initParams = new ArrayList<ParamValueMetaData>(); AnnotationValue httpMethodConstraintsValue = annotation.value("httpMethodConstraints"); if (httpMethodConstraintsValue != null) { AnnotationInstance[] httpMethodConstraints = httpMethodConstraintsValue.asNestedArray(); if (httpMethodConstraints.length > 0) { List<HttpMethodConstraintMetaData> methodConstraints = new ArrayList<HttpMethodConstraintMetaData>();
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");
/** * Returns the nested {@link DataSourceDefinition} annotations out of the outer {@link DataSourceDefinitions} annotation * * @param datasourceDefinitions The outer {@link DataSourceDefinitions} annotation * @return */ private List<AnnotationInstance> getNestedDataSourceAnnotations(AnnotationInstance datasourceDefinitions) { if (datasourceDefinitions == null) { return Collections.emptyList(); } AnnotationInstance[] nested = datasourceDefinitions.value().asNestedArray(); return Arrays.asList(nested); }
protected List<TargetAnnotation> fromMultiAnnotation(AnnotationInstance multiAnnotationInstance) { List<TargetAnnotation> instances = new ArrayList<TargetAnnotation>(); final AnnotationInstance[] values = multiAnnotationInstance.value().asNestedArray(); for(AnnotationInstance value : values) { instances.add(new TargetAnnotation(value, multiAnnotationInstance.target())); } return instances; }
protected List<TargetAnnotation> fromMultiAnnotation(AnnotationInstance multiAnnotationInstance) { List<TargetAnnotation> instances = new ArrayList<TargetAnnotation>(); final AnnotationInstance[] values = multiAnnotationInstance.value().asNestedArray(); for(AnnotationInstance value : values) { instances.add(new TargetAnnotation(value, multiAnnotationInstance.target())); } return instances; }
@Override public boolean process(AnnotationInstance annotationInstance) { AnnotationValue value = annotationInstance.value(); AnnotationInstance[] indexedAttributeOverridesValues = value.asNestedArray(); for ( AnnotationInstance ai : indexedAttributeOverridesValues ) { child.process( ai ); } return true; } }
@Override public boolean process(AnnotationInstance annotationInstance) { AnnotationValue value = annotationInstance.value(); AnnotationInstance[] indexedAttributeOverridesValues = value.asNestedArray(); for ( AnnotationInstance ai : indexedAttributeOverridesValues ) { child.process( ai ); } return true; } }
protected List<TargetAnnotation> fromMultiAnnotation(AnnotationInstance multiAnnotationInstance) { List<TargetAnnotation> instances = new ArrayList<TargetAnnotation>(); final AnnotationInstance[] values = multiAnnotationInstance.value().asNestedArray(); for(AnnotationInstance value : values) { instances.add(new TargetAnnotation(value, multiAnnotationInstance.target())); } return instances; }
@Override public void process() { Collection<AnnotationInstance> annos = index.getAnnotations(DotName.createSimple(Advertise.class.getName())); Collection<AnnotationInstance> repeatingAnnos = index.getAnnotations(DotName.createSimple(Advertises.class.getName())); Stream.concat(annos.stream(), repeatingAnnos .stream() .flatMap(anno -> Stream.of(anno.value().asNestedArray()))) .forEach(anno -> advertise(archive, anno)); }
private List<AnnotationInstance> findAssociationOverrides() { List<AnnotationInstance> associationOverrideList = new ArrayList<AnnotationInstance>(); AnnotationInstance associationOverrideAnnotation = JandexHelper.getSingleAnnotation( classInfo, JPADotNames.ASSOCIATION_OVERRIDE ); if ( associationOverrideAnnotation != null ) { associationOverrideList.add( associationOverrideAnnotation ); } AnnotationInstance associationOverridesAnnotation = JandexHelper.getSingleAnnotation( classInfo, JPADotNames.ASSOCIATION_OVERRIDES ); if ( associationOverrideAnnotation != null ) { AnnotationInstance[] attributeOverride = associationOverridesAnnotation.value().asNestedArray(); Collections.addAll( associationOverrideList, attributeOverride ); } return associationOverrideList; }
@Override protected Map<String, String> resolveHibernateTypeParameters(AnnotationInstance typeAnnotation) { HashMap<String, String> typeParameters = new HashMap<String, String>(); AnnotationValue parameterAnnotationValue = typeAnnotation.value( "parameters" ); if ( parameterAnnotationValue != null ) { AnnotationInstance[] parameterAnnotations = parameterAnnotationValue.asNestedArray(); for ( AnnotationInstance parameterAnnotationInstance : parameterAnnotations ) { typeParameters.put( JandexHelper.getValue( parameterAnnotationInstance, "name", String.class ), JandexHelper.getValue( parameterAnnotationInstance, "value", String.class ) ); } } return typeParameters; }
@Override protected Map<String, String> resolveHibernateTypeParameters(AnnotationInstance typeAnnotation) { HashMap<String, String> typeParameters = new HashMap<String, String>(); AnnotationValue parameterAnnotationValue = typeAnnotation.value( "parameters" ); if ( parameterAnnotationValue != null ) { AnnotationInstance[] parameterAnnotations = parameterAnnotationValue.asNestedArray(); for ( AnnotationInstance parameterAnnotationInstance : parameterAnnotations ) { typeParameters.put( JandexHelper.getValue( parameterAnnotationInstance, "name", String.class ), JandexHelper.getValue( parameterAnnotationInstance, "value", String.class ) ); } } return typeParameters; }
private List<AnnotationInstance> findAssociationOverrides() { List<AnnotationInstance> associationOverrideList = new ArrayList<AnnotationInstance>(); AnnotationInstance associationOverrideAnnotation = JandexHelper.getSingleAnnotation( classInfo, JPADotNames.ASSOCIATION_OVERRIDE ); if ( associationOverrideAnnotation != null ) { associationOverrideList.add( associationOverrideAnnotation ); } AnnotationInstance associationOverridesAnnotation = JandexHelper.getSingleAnnotation( classInfo, JPADotNames.ASSOCIATION_OVERRIDES ); if ( associationOverrideAnnotation != null ) { AnnotationInstance[] attributeOverride = associationOverridesAnnotation.value().asNestedArray(); Collections.addAll( associationOverrideList, attributeOverride ); } return associationOverrideList; }
private Properties getActivationConfigProperties(final AnnotationInstance messageBeanAnnotation) { final Properties props = new Properties(); final AnnotationValue activationConfig = messageBeanAnnotation.value("activationConfig"); if (activationConfig == null) return props; for (final AnnotationInstance propAnnotation : activationConfig.asNestedArray()) { props.put(propAnnotation.value("propertyName").asString(), propAnnotation.value("propertyValue").asString()); } return props; }
private void createUniqueConstraints(AnnotationInstance tableAnnotation, String tableName) { AnnotationValue value = tableAnnotation.value( "uniqueConstraints" ); if ( value == null ) { return; } AnnotationInstance[] uniqueConstraints = value.asNestedArray(); for ( AnnotationInstance unique : uniqueConstraints ) { String name = unique.value( "name" ) == null ? null : unique.value( "name" ).asString(); String[] columnNames = unique.value( "columnNames" ).asStringArray(); UniqueConstraintSourceImpl uniqueConstraintSource = new UniqueConstraintSourceImpl( name, tableName, Arrays.asList( columnNames ) ); constraintSources.add( uniqueConstraintSource ); } }
private void createUniqueConstraints(AnnotationInstance tableAnnotation, String tableName) { AnnotationValue value = tableAnnotation.value( "uniqueConstraints" ); if ( value == null ) { return; } AnnotationInstance[] uniqueConstraints = value.asNestedArray(); for ( AnnotationInstance unique : uniqueConstraints ) { String name = unique.value( "name" ) == null ? null : unique.value( "name" ).asString(); String[] columnNames = unique.value( "columnNames" ).asStringArray(); UniqueConstraintSourceImpl uniqueConstraintSource = new UniqueConstraintSourceImpl( name, tableName, Arrays.asList( columnNames ) ); constraintSources.add( uniqueConstraintSource ); } }