Package org.l2x6.cq
Class PomTransformer
- java.lang.Object
-
- org.l2x6.cq.PomTransformer
-
public class PomTransformer extends Object
A utility to transformpom.xmlfiles on the DOM level while keeping the original comments and formatting also on places where commonjavax.xml.transform.Transformerorjavax.xml.parsers.DocumentBuilderbased solutions tend to fail, such as- Order of XML declaration attributes
- Whitespace after the XML declaration
- Line breaks between element attributes
- File final whitespace
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPomTransformer.ContainerElementstatic interfacePomTransformer.TransformationA transformation of a DOMstatic classPomTransformer.TransformationContextA context of a set ofPomTransformer.Transformations.static classPomTransformer.WrappedNode<T extends Node>
-
Constructor Summary
Constructors Constructor Description PomTransformer(Path path, Charset charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtransform(Collection<PomTransformer.Transformation> transformations)Loads the document underpath, applies the giventransformations, mitigates the formatting issues caused byTransformerand finally stores the document back to the file underpath.voidtransform(PomTransformer.Transformation... transformations)Loads the document underpath, applies the giventransformations, mitigates the formatting issues caused byTransformerand finally stores the document back to the file underpath.
-
-
-
Method Detail
-
transform
public void transform(PomTransformer.Transformation... transformations)
Loads the document underpath, applies the giventransformations, mitigates the formatting issues caused byTransformerand finally stores the document back to the file underpath.- Parameters:
transformations- thePomTransformer.Transformations to apply
-
transform
public void transform(Collection<PomTransformer.Transformation> transformations)
Loads the document underpath, applies the giventransformations, mitigates the formatting issues caused byTransformerand finally stores the document back to the file underpath.- Parameters:
transformations- thePomTransformer.Transformations to apply
-
-