public abstract class LMSXmlDocument
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LMSXmlDocument.InitFrom |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
dir |
protected org.w3c.dom.Document |
doc |
protected java.lang.String |
filepath |
protected static org.slf4j.Logger |
LOGGER |
(package private) LMSCollectionXmlDocument |
parent |
protected javax.xml.xpath.XPath |
xPath |
Constructor and Description |
---|
LMSXmlDocument(java.lang.String xml) |
LMSXmlDocument(java.lang.String filepath,
LMSCollectionXmlDocument parent) |
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
fileExists(java.lang.String path)
Checks if file at path exists and corrects paths to be case sensitive
|
protected java.lang.String |
getAttr(org.w3c.dom.Node node,
java.lang.String attrName)
Returns the value of an attribute of a node, if existing
|
protected org.w3c.dom.Node |
GetChildWithName(org.w3c.dom.Node node,
java.lang.String name) |
org.w3c.dom.Document |
getDoc() |
java.lang.String |
getFilepath() |
java.util.List<java.lang.String> |
getParentFiles()
Returns all files which directly or indirectly reference this LMS xml file.
|
private void |
initFromFilepath(java.lang.String filepath) |
private void |
initFromXmlString(java.lang.String xml) |
java.lang.String |
nodeToString(org.w3c.dom.Node node) |
protected java.lang.String |
parseFilePath(java.lang.String refPath)
Translates Leica XML file paths to absolute url decoded paths
|
java.lang.String |
toString() |
org.w3c.dom.NodeList |
xPath(org.w3c.dom.Node node,
java.lang.String expression)
Searches a node for expressions using xPath.
|
org.w3c.dom.NodeList |
xPath(java.lang.String expression)
Searches the XML document for expressions using xPath.
|
protected org.w3c.dom.Document doc
protected javax.xml.xpath.XPath xPath
protected java.lang.String dir
protected java.lang.String filepath
protected static final org.slf4j.Logger LOGGER
LMSCollectionXmlDocument parent
public LMSXmlDocument(java.lang.String xml)
public LMSXmlDocument(java.lang.String filepath, LMSCollectionXmlDocument parent)
public org.w3c.dom.Document getDoc()
public java.lang.String getFilepath()
private void initFromXmlString(java.lang.String xml)
private void initFromFilepath(java.lang.String filepath)
public org.w3c.dom.NodeList xPath(java.lang.String expression)
expression
- expression in xPath syntaxpublic org.w3c.dom.NodeList xPath(org.w3c.dom.Node node, java.lang.String expression)
node
- node in which to searchexpression
- expression in xPath syntaxpublic java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getAttr(org.w3c.dom.Node node, java.lang.String attrName)
node
- node in which to search for the attributeattrName
- name of the attributeprotected java.lang.String parseFilePath(java.lang.String refPath)
refPath
- path string found in Leica XML referencepublic java.lang.String nodeToString(org.w3c.dom.Node node)
protected org.w3c.dom.Node GetChildWithName(org.w3c.dom.Node node, java.lang.String name)
public java.util.List<java.lang.String> getParentFiles()
protected static java.lang.String fileExists(java.lang.String path)
path
- whole file pathCopyright © 2024 Open Microscopy Environment