Interface ConfigNodePreprocessor
- All Known Implementing Classes:
ReferenceResolvingPreprocessor
public interface ConfigNodePreprocessor
Preprocessor for config nodes before binding.
This interface allows transformation of config nodes before they are
deserialized by the binder. The primary use case is resolving config
references (${...}) to their target values.
If a preprocessor returns a non-null node, that node will be used for deserialization instead of the original. If it returns null, the original node is used.
-
Method Summary
Modifier and TypeMethodDescription@Nullable ConfigNodepreprocess(@NotNull ConfigNode node, @Nullable Field field, @NotNull Type expectedType) Preprocesses a config node before binding.
-
Method Details
-
preprocess
@Nullable @Nullable ConfigNode preprocess(@NotNull @NotNull ConfigNode node, @Nullable @Nullable Field field, @NotNull @NotNull Type expectedType) Preprocesses a config node before binding.This method is called for each node before deserialization. If the preprocessor handles the node (e.g., resolves a reference), it should return the resolved node. Otherwise, return null to use the original.
- Parameters:
node- the original config nodefield- the field being bound (may be null for constructor params or root binding)expectedType- the expected type of the value- Returns:
- the preprocessed node, or null to use the original
-