Package org.l2x6.cq
Class PomTransformer.TransformationContext
- java.lang.Object
-
- org.l2x6.cq.PomTransformer.TransformationContext
-
- Enclosing class:
- PomTransformer
public static class PomTransformer.TransformationContext extends Object
A context of a set ofPomTransformer.Transformations.
-
-
Constructor Summary
Constructors Constructor Description TransformationContext(Path pomXmlPath, Document document, String indentationString, XPath xPath)
-
Method Summary
-
-
-
Method Detail
-
getPomXmlPath
public Path getPomXmlPath()
- Returns:
- the path to the
pom.xmlfile that is being transformed
-
getXPath
public XPath getXPath()
- Returns:
- an
XPathinstance that can be used for querying the DOM of the transformedpom.xmlfile
-
getIndentationString
public String getIndentationString()
- Returns:
- an indentation string (without newline characters) as it was autodetected using
PomTransformer.detectIndentation(Node, XPath)
-
indent
public Text indent(int indentCount)
- Parameters:
indentCount- how many times to concatenate theindentationString- Returns:
- a new indentation node containing a newline and
indentCounttimes concatenatedindentationString
-
newLine
public Text newLine()
- Returns:
- a newly created text node having single newline
\nas its content.
-
getOrAddContainerElements
public PomTransformer.ContainerElement getOrAddContainerElements(String elementName, String... furtherNames)
-
getOrAddContainerElement
public PomTransformer.ContainerElement getOrAddContainerElement(String elementName)
-
isEmptyLineNode
public static boolean isEmptyLineNode(Node node)
-
isWhiteSpaceNode
public static boolean isWhiteSpaceNode(Node node)
-
getContainerElement
public Optional<PomTransformer.ContainerElement> getContainerElement(String... path)
-
findDependency
public Optional<PomTransformer.ContainerElement> findDependency(Gavtcs gavtcs)
-
removeDependency
public void removeDependency(Gavtcs removedDependency, boolean removePrecedingComments, boolean removePrecedingWhitespace)
-
addDependencyIfNeeded
public void addDependencyIfNeeded(Gavtcs gavtcs, Comparator<Gavtcs> comparator)
-
removeNode
public void removeNode(String xPathExpression, boolean removePrecedingComments, boolean removePrecedingWhitespace, boolean onlyIfEmpty)
-
hasElementChildren
public static boolean hasElementChildren(Node node)
-
-