public class XmlUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
log |
Constructor and Description |
---|
XmlUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.maven.project.MavenProject |
extractMavenProject(org.eclipse.jface.text.ITextViewer sourceViewer) |
static org.eclipse.core.resources.IProject |
extractProject(org.eclipse.jface.text.ITextViewer sourceViewer)
what is this method supposed to do? for the sourceViewer find the associated file on disk and for that one find the
IProject it belongs to.
|
static java.io.File |
fileForInputLocation(org.apache.maven.model.InputLocation location,
org.apache.maven.project.MavenProject origin)
converts an InputLocation to a file path on the local disk, null if not available.
|
static org.w3c.dom.Element |
findChild(org.w3c.dom.Element parent,
java.lang.String name) |
static org.w3c.dom.Element |
findChild(org.w3c.dom.Element parent,
java.lang.String name,
PomEdits.Matcher... matchers)
finds exactly one (first) occurence of child element with the given name (eg.
|
static java.util.List<org.w3c.dom.Element> |
findChilds(org.w3c.dom.Element parent,
java.lang.String name) |
static java.lang.String |
getTextValue(org.w3c.dom.Node element) |
static java.lang.String |
pathUp(org.w3c.dom.Node node,
int level) |
static void |
performOnCurrentElement(org.eclipse.jface.text.IDocument document,
int offset,
NodeOperation<org.w3c.dom.Node> operation)
originally copied from org.eclipse.wst.xml.ui.internal.hyperlink.XMLHyperlinkDetector this method grabs the
IDOMModel for the IDocument, performs the passed operation on the node at the offset and then releases the
IDOMModel operation's Node value is also an instance of IndexedRegion
|
static void |
performOnRootElement(org.eclipse.jface.text.IDocument doc,
NodeOperation<org.w3c.dom.Element> operation)
this method grabs the IDOMModel for the IDocument, performs the passed operation on the root element of the
document and then releases the IDOMModel root Element value is also an instance of IndexedRegion
|
static void |
performOnRootElement(org.eclipse.core.resources.IFile resource,
NodeOperation<org.w3c.dom.Element> operation) |
static void |
performOnRootElement(org.eclipse.core.resources.IFile resource,
NodeOperation<org.w3c.dom.Element> operation,
boolean autoSave) |
public static org.w3c.dom.Element findChild(org.w3c.dom.Element parent, java.lang.String name)
public static java.util.List<org.w3c.dom.Element> findChilds(org.w3c.dom.Element parent, java.lang.String name)
public static java.lang.String getTextValue(org.w3c.dom.Node element)
public static org.w3c.dom.Element findChild(org.w3c.dom.Element parent, java.lang.String name, PomEdits.Matcher... matchers)
parent
- name
- matchers
- public static org.eclipse.core.resources.IProject extractProject(org.eclipse.jface.text.ITextViewer sourceViewer)
sourceViewer
- public static org.apache.maven.project.MavenProject extractMavenProject(org.eclipse.jface.text.ITextViewer sourceViewer)
public static java.io.File fileForInputLocation(org.apache.maven.model.InputLocation location, org.apache.maven.project.MavenProject origin)
location
- public static void performOnCurrentElement(org.eclipse.jface.text.IDocument document, int offset, NodeOperation<org.w3c.dom.Node> operation)
offset
- public static void performOnRootElement(org.eclipse.jface.text.IDocument doc, NodeOperation<org.w3c.dom.Element> operation)
doc
- operation
- public static void performOnRootElement(org.eclipse.core.resources.IFile resource, NodeOperation<org.w3c.dom.Element> operation) throws java.io.IOException, org.eclipse.core.runtime.CoreException
java.io.IOException
org.eclipse.core.runtime.CoreException
public static void performOnRootElement(org.eclipse.core.resources.IFile resource, NodeOperation<org.w3c.dom.Element> operation, boolean autoSave) throws java.io.IOException, org.eclipse.core.runtime.CoreException
java.io.IOException
org.eclipse.core.runtime.CoreException
public static java.lang.String pathUp(org.w3c.dom.Node node, int level)