Skip to content

io microsphere spring core annotation ResolvablePlaceholderAnnotationAttributes

github-actions[bot] edited this page Jul 11, 2026 · 26 revisions

ResolvablePlaceholderAnnotationAttributes

Type: Class | Module: microsphere-spring-context | Package: io.microsphere.spring.core.annotation | Since: 1.0.0

Source: microsphere-spring-context/src/main/java/io/microsphere/spring/core/annotation/ResolvablePlaceholderAnnotationAttributes.java

Overview

The resolvable placeholders of AnnotationAttributes

Declaration

public class ResolvablePlaceholderAnnotationAttributes<A extends Annotation> extends GenericAnnotationAttributes<A>

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.36-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

Method Examples

of

// Given an annotation instance and a PropertyResolver
MyAnnotation annotation = ...;
PropertyResolver resolver = ...;

// Create ResolvablePlaceholderAnnotationAttributes with placeholder resolution
ResolvablePlaceholderAnnotationAttributes<MyAnnotation> resolvableAttrs =
    new ResolvablePlaceholderAnnotationAttributes<>(annotation, resolver);
// Given an existing GenericAnnotationAttributes instance
GenericAnnotationAttributes<MyAnnotation> attrs = ...;

// Create a ResolvablePlaceholderAnnotationAttributes without resolving placeholders
ResolvablePlaceholderAnnotationAttributes<MyAnnotation> resolvableAttrs =
    ResolvablePlaceholderAnnotationAttributes.of(attrs);

of

// Given an existing GenericAnnotationAttributes instance and a PropertyResolver
GenericAnnotationAttributes<MyAnnotation> attrs = ...;
PropertyResolver resolver = ...;

// Create a ResolvablePlaceholderAnnotationAttributes with placeholder resolution
ResolvablePlaceholderAnnotationAttributes<MyAnnotation> resolvableAttrs =
    ResolvablePlaceholderAnnotationAttributes.of(attrs, resolver);

of

// Given an annotation instance and a PropertyResolver
MyAnnotation annotation = ...;
PropertyResolver resolver = ...;

// Create a ResolvablePlaceholderAnnotationAttributes with placeholder resolution
ResolvablePlaceholderAnnotationAttributes<MyAnnotation> resolvableAttrs =
    ResolvablePlaceholderAnnotationAttributes.of(annotation, resolver);

of

// Given a map of attributes, annotation type, and a PropertyResolver
Map<String, Object> attrs = new HashMap<>();
attrs.put("value", "${my.property}");
Class<MyAnnotation> annotationType = MyAnnotation.class;
PropertyResolver resolver = ...;

// Create a ResolvablePlaceholderAnnotationAttributes with placeholder resolution
ResolvablePlaceholderAnnotationAttributes<MyAnnotation> resolvableAttrs =
    ResolvablePlaceholderAnnotationAttributes.of(attrs, annotationType, resolver);

ofSet

// Given an array of GenericAnnotationAttributes and a PropertyResolver
GenericAnnotationAttributes<MyAnnotation>[] attrsArray = ...;
PropertyResolver resolver = ...;

// Create a Set of ResolvablePlaceholderAnnotationAttributes with placeholder resolution
Set<AnnotationAttributes> resolvableAttrsSet =
    ResolvablePlaceholderAnnotationAttributes.ofSet(attrsArray, resolver);

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-spring-context</artifactId>
    <version>${microsphere-spring.version}</version>
</dependency>

Tip: Use the BOM (microsphere-spring-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.spring.core.annotation.ResolvablePlaceholderAnnotationAttributes;

API Reference

Public Methods

Method Description
of Constructs a new ResolvablePlaceholderAnnotationAttributes instance from the specified Annotation.
of Creates a ResolvablePlaceholderAnnotationAttributes instance from the given GenericAnnotationAttributes
of Creates a ResolvablePlaceholderAnnotationAttributes instance from the given Annotation
of Creates a ResolvablePlaceholderAnnotationAttributes instance from the given map of attributes,
ofSet Creates a Set of AnnotationAttributes from the given array of GenericAnnotationAttributes,

Method Details

of

public static <A extends Annotation> ResolvablePlaceholderAnnotationAttributes<A> of(@Nonnull GenericAnnotationAttributes<A> attributes)

Constructs a new ResolvablePlaceholderAnnotationAttributes instance from the specified Annotation.

Placeholders in the annotation attribute values will be resolved using the provided PropertyResolver. If the propertyResolver is null, placeholders will remain unresolved.

of

public static <A extends Annotation> ResolvablePlaceholderAnnotationAttributes<A> of(@Nonnull GenericAnnotationAttributes<A> attributes,
                                                                                         @Nullable PropertyResolver propertyResolver)

Creates a ResolvablePlaceholderAnnotationAttributes instance from the given GenericAnnotationAttributes and resolves placeholders using the provided PropertyResolver.

If the propertyResolver is null, placeholders in the attributes will not be resolved.

Example Usage

`// Given an existing GenericAnnotationAttributes instance and a PropertyResolver
GenericAnnotationAttributes attrs = ...;
PropertyResolver resolver = ...;

// Create a ResolvablePlaceholderAnnotationAttributes with placeholder resolution
ResolvablePlaceholderAnnotationAttributes resolvableAttrs =
    ResolvablePlaceholderAnnotationAttributes.of(attrs, resolver);
`

of

public static <A extends Annotation> ResolvablePlaceholderAnnotationAttributes<A> of(@Nonnull A annotation,
                                                                                         @Nullable PropertyResolver propertyResolver)

Creates a ResolvablePlaceholderAnnotationAttributes instance from the given Annotation and resolves placeholders using the provided PropertyResolver.

If the propertyResolver is null, placeholders in the annotation attribute values will not be resolved.

Example Usage

`// Given an annotation instance and a PropertyResolver
MyAnnotation annotation = ...;
PropertyResolver resolver = ...;

// Create a ResolvablePlaceholderAnnotationAttributes with placeholder resolution
ResolvablePlaceholderAnnotationAttributes resolvableAttrs =
    ResolvablePlaceholderAnnotationAttributes.of(annotation, resolver);
`

of

public static <A extends Annotation> ResolvablePlaceholderAnnotationAttributes<A> of(@Nonnull Map<String, Object> attributes,
                                                                                         Class<A> annotationType,
                                                                                         @Nullable PropertyResolver propertyResolver)

Creates a ResolvablePlaceholderAnnotationAttributes instance from the given map of attributes, annotation type, and resolves placeholders using the provided PropertyResolver.

If the propertyResolver is null, placeholders in the attribute values will not be resolved.

Example Usage

`// Given a map of attributes, annotation type, and a PropertyResolver
Map attrs = new HashMap<>();
attrs.put("value", "${my.property`");
Class annotationType = MyAnnotation.class;
PropertyResolver resolver = ...;

// Create a ResolvablePlaceholderAnnotationAttributes with placeholder resolution
ResolvablePlaceholderAnnotationAttributes resolvableAttrs =
    ResolvablePlaceholderAnnotationAttributes.of(attrs, annotationType, resolver);
}

ofSet

public static Set<AnnotationAttributes> ofSet(@Nullable GenericAnnotationAttributes[] attributesArray, @Nullable PropertyResolver propertyResolver)

Creates a Set of AnnotationAttributes from the given array of GenericAnnotationAttributes, resolving placeholders using the provided PropertyResolver.

If the propertyResolver is null, placeholders in the attribute values will not be resolved. If the attributesArray is null or empty, an empty set is returned.

Example Usage

`// Given an array of GenericAnnotationAttributes and a PropertyResolver
GenericAnnotationAttributes[] attrsArray = ...;
PropertyResolver resolver = ...;

// Create a Set of ResolvablePlaceholderAnnotationAttributes with placeholder resolution
Set resolvableAttrsSet =
    ResolvablePlaceholderAnnotationAttributes.ofSet(attrsArray, resolver);
`

See Also

  • GenericAnnotationAttributes

This documentation was auto-generated from the source code of microsphere-spring.

Home

spring-context

spring-guice

spring-jdbc

spring-test

spring-web

spring-webflux

spring-webmvc

Clone this wiki locally