Class PropertiesTransformer
java.lang.Object
org.apache.maven.plugins.shade.resource.properties.PropertiesTransformer
- All Implemented Interfaces:
ReproducibleResourceTransformer,ResourceTransformer
- Direct Known Subclasses:
MicroprofileConfigTransformer,OpenWebBeansPropertiesTransformer
Enables to merge a set of properties respecting priority between them.
- Since:
- 3.2.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate intprivate Stringprivate final List<Properties>private Stringprivate booleanprivate long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPropertiesTransformer(String resource, String ordinalKey, int defaultOrdinal, boolean reversed) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanTransformResource(String resource) private intbooleanprivate static PropertiesmergeProperties(List<Properties> sortedProperties) voidfinal voidprocessResource(String resource, InputStream is, List<Relocator> relocators) Transform an individual resourcevoidprocessResource(String resource, InputStream is, List<Relocator> relocators, long time) Transform an individual resourcevoidsetAlreadyMergedKey(String alreadyMergedKey) voidsetDefaultOrdinal(int defaultOrdinal) voidsetOrdinalKey(String ordinalKey) voidsetResource(String resource) voidsetReverseOrder(boolean reverseOrder) private List<Properties>
-
Field Details
-
resource
-
alreadyMergedKey
-
ordinalKey
-
defaultOrdinal
private int defaultOrdinal -
reverseOrder
private boolean reverseOrder -
time
private long time -
properties
-
-
Constructor Details
-
PropertiesTransformer
public PropertiesTransformer() -
PropertiesTransformer
-
-
Method Details
-
canTransformResource
- Specified by:
canTransformResourcein interfaceResourceTransformer
-
processResource
public final void processResource(String resource, InputStream is, List<Relocator> relocators) throws IOException Description copied from interface:ResourceTransformerTransform an individual resource- Specified by:
processResourcein interfaceResourceTransformer- Parameters:
resource- The resource nameis- An input stream for the resource, the implementation should *not* close this streamrelocators- A list of relocators- Throws:
IOException- When the IO blows up
-
processResource
public void processResource(String resource, InputStream is, List<Relocator> relocators, long time) throws IOException Description copied from interface:ReproducibleResourceTransformerTransform an individual resource- Specified by:
processResourcein interfaceReproducibleResourceTransformer- Parameters:
resource- The resource nameis- An input stream for the resource, the implementation should *not* close this streamrelocators- A list of relocatorstime- the time of the resource to process- Throws:
IOException- When the IO blows up
-
hasTransformedResource
public boolean hasTransformedResource()- Specified by:
hasTransformedResourcein interfaceResourceTransformer
-
modifyOutputStream
- Specified by:
modifyOutputStreamin interfaceResourceTransformer- Throws:
IOException
-
setReverseOrder
public void setReverseOrder(boolean reverseOrder) -
setResource
-
setOrdinalKey
-
setDefaultOrdinal
public void setDefaultOrdinal(int defaultOrdinal) -
setAlreadyMergedKey
-
sortProperties
-
getConfigurationOrdinal
-
mergeProperties
-