public class XmlUtils extends Object
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 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 Element |
findChild(Element parent,
String name) |
static Element |
findChild(Element parent,
String name,
PomEdits.Matcher... matchers)
finds exactly one (first) occurence of child element with the given name (eg.
|
static List<Element> |
findChilds(Element parent,
String name) |
static String |
getTextValue(Node element) |
static String |
pathUp(Node node,
int level) |
static void |
performOnCurrentElement(org.eclipse.jface.text.IDocument document,
int offset,
NodeOperation<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<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<Element> operation) |
public static Element findChild(Element parent, 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 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<Node> operation)
offset
- public static void performOnRootElement(org.eclipse.jface.text.IDocument doc, NodeOperation<Element> operation)
doc
- operation
- public static void performOnRootElement(org.eclipse.core.resources.IFile resource, NodeOperation<Element> operation) throws IOException, org.eclipse.core.runtime.CoreException
IOException
org.eclipse.core.runtime.CoreException
Copyright © 2005–2015 Sonatype, Inc.. All rights reserved.