DefaultPropertySourceFactory class final

The factory @PropertySource uses when none is named: it reads the file as .properties.

It creates a ResourcePropertySource named after the resource unless a name is given. Applications do not use it directly; it is the default value of PropertySourceProcessor.processPropertySource's factory.

final source = const DefaultPropertySourceFactory().createPropertySource(
  null,
  EncodedResource(FileSystemResource('config/app.properties')),
);

Spring (Java):

PropertySource<?> source = new DefaultPropertySourceFactory()
    .createPropertySource(null, new EncodedResource(
        new FileSystemResource("config/app.properties")));
Implemented types

Constructors

DefaultPropertySourceFactory()
Creates the factory. It holds no state, so a const one can be shared.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createPropertySource(String? name, EncodedResource resource) → AbstractPropertySource<Object>
Reads resource synchronously, decoded with its encoding, and returns its properties as one source. Name the source name when it is given (the annotation's name), otherwise after the resource.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited