Package dev.jeka.core.api.file
Class JkResourceProcessor
java.lang.Object
dev.jeka.core.api.file.JkResourceProcessor
This processor basically copies some resource files to a target folder
(generally the class folder). It can also proceed to token replacement, i.e,
replacing strings between
The processor is constructed from a
${
and }
by a specified
values.The processor is constructed from a
JkPathTreeSet
and for
each of them, we can associate a token map for interpolation.-
Method Summary
Modifier and TypeMethodDescriptionaddInterpolation
(String... keyValues) addInterpolator
(String acceptPattern, String... keyValues) addInterpolator
(String acceptPattern, Map<String, String> keyValues) addInterpolator
(PathMatcher pathMatcher, Map<String, String> keyValues) addInterpolator
(Map<String, String> keyValues) addInterpolators
(dev.jeka.core.api.file.JkResourceProcessor.JkInterpolator... interpolators) addInterpolators
(Iterable<dev.jeka.core.api.file.JkResourceProcessor.JkInterpolator> interpolators) Adds specified interpolators to this resource processor.apply
(Consumer<JkResourceProcessor> consumer) Applies the specified consumer to this object.void
generate
(JkPathTreeSet resourceTrees, Path outputDir) Actually processes the resources, meaning copies the getResources to the specified output directory along replacing specified tokens.void
Returns the charset used for interpolationstatic JkResourceProcessor
of()
Creates an empty resource processorsetInterpolationCharset
(Charset interpolationCharset) Set the charset used for interpolation.
-
Method Details
-
apply
Applies the specified consumer to this object. -
of
Creates an empty resource processor -
addInterpolators
public JkResourceProcessor addInterpolators(Iterable<dev.jeka.core.api.file.JkResourceProcessor.JkInterpolator> interpolators) Adds specified interpolators to this resource processor. -
addInterpolators
public JkResourceProcessor addInterpolators(dev.jeka.core.api.file.JkResourceProcessor.JkInterpolator... interpolators) - See Also:
-
addInterpolator
- See Also:
-
addInterpolator
- See Also:
-
addInterpolator
- See Also:
-
addInterpolator
- See Also:
-
addInterpolation
- Parameters:
keyValues
- a sequence of key-value askey1, value1, ke2, value2
- See Also:
-
getInterpolationCharset
Returns the charset used for interpolation -
setInterpolationCharset
Set the charset used for interpolation. This charset is not used if no interpolation occurs. -
generate
- See Also:
-
generate
Actually processes the resources, meaning copies the getResources to the specified output directory along replacing specified tokens.
-