Module org.github.gestalt.core
Interface Transformer
-
- All Known Implementing Classes:
Base64DecoderTransformer,Base64EncoderTransformer,ClasspathTransformer,CustomMapTransformer,EnvironmentVariablesTransformer,EnvironmentVariablesTransformerOld,FileTransformer,NodeTransformer,RandomTransformer,SystemPropertiesTransformer,URLDecoderTransformer,URLEncoderTransformer
public interface TransformerAllows you to add your own custom source for the TransformerPostProcessor. Whenever the TransformerPostProcessor sees a value ${name:key} the transform is selected that matches the same name
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidapplyConfig(PostProcessorConfig config)Apply the PostProcessorConfig to the Transformer.java.lang.Stringname()the name that will match the ${name:key} the transform is selected that matches the same name.GResultOf<java.lang.String>process(java.lang.String path, java.lang.String key, java.lang.String rawValue)When a match is found for ${name:key} the key and the path are passed into the process method.
-
-
-
Method Detail
-
name
java.lang.String name()
the name that will match the ${name:key} the transform is selected that matches the same name.- Returns:
- the name of the transform
-
process
GResultOf<java.lang.String> process(java.lang.String path, java.lang.String key, java.lang.String rawValue)
When a match is found for ${name:key} the key and the path are passed into the process method. The returned value replaces the whole ${name:key}- Parameters:
path- the current pathkey- the key to lookup int this transform.rawValue- the whole raw value of the current string to transform.- Returns:
- the value to replace the ${name:key}
-
applyConfig
default void applyConfig(PostProcessorConfig config)
Apply the PostProcessorConfig to the Transformer. Needed when building via the ServiceLoader It is a default method as most Transformer don't need to apply configs.- Parameters:
config- GestaltConfig to update the Post Processor
-
-