Package org.dlese.dpc.xml.nldr
Class NldrMetadataRecordExporter
java.lang.Object
org.dlese.dpc.xml.nldr.NldrMetadataRecordExporter
- Direct Known Subclasses:
OsmRecordExporter
Reads XML records and converts to an exported form (i.e., "containing
citableUrls"). NLDR metadata records may involve mulitple-namespaces and may conttain "assets"
(primary content in the NLDR).
- Author:
- Jonathan Ostwald
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor that loads the given record. -
Method Summary
Modifier and TypeMethodDescriptionabstract ListGets the assetNodes attribute of the NldrMetadataRecord objectprotected static final StringReturn a string for the current time and date, sutiable for display in log files and output to standout:abstract StringgetId()Gets the id attribute of the NldrMetadataRecord objectgetTextAtPath(String path) Gets the textAtPath attribute of the NldrMetadataRecord objectgetXml()Gets the xml attribute of the NldrMetadataRecord objectorg.dom4j.NodeGets the xmlNode attribute of the NldrMetadataRecord objectGets the xml stripped of the XML declaration and DTD declaration.static StringExpands xpath into namespace-aware version, hanlding attributes and attribute/value specifiers.protected static final voidpp(org.dom4j.Node node) Description of the Methodprotected final voidOutput a line of text to error out, with datestamp.selectNodes(String xpath) Select Nodes for provided xpathorg.dom4j.NodeselectSingleNode(String xpath) Select Single node for provided xpathstatic voidsetDebug(boolean db) Sets the debug attribute of the objectvoidsetTextAtPath(String xpath, String value) Sets the textAtPath attribute of the NldrMetadataRecord objecttoString()Get a String representation of this XML.
-
Constructor Details
-
NldrMetadataRecordExporter
Constructor that loads the given record. No validation is performed.- Parameters:
xml- The XML to start with- Throws:
org.dom4j.DocumentException- If error parsing the XML
-
-
Method Details
-
getId
Gets the id attribute of the NldrMetadataRecord object- Returns:
- The id value
-
getAssetNodes
Gets the assetNodes attribute of the NldrMetadataRecord object- Returns:
- The assetNodes value
-
getTextAtPath
Gets the textAtPath attribute of the NldrMetadataRecord object- Parameters:
path- NOT YET DOCUMENTED- Returns:
- The textAtPath value
-
setTextAtPath
Sets the textAtPath attribute of the NldrMetadataRecord object- Parameters:
xpath- xpath of elementvalue- text to set
-
selectNodes
Select Nodes for provided xpath- Parameters:
xpath- xpath- Returns:
- list of selected nodes
-
selectSingleNode
Select Single node for provided xpath- Parameters:
xpath- xpath- Returns:
- NOT YET DOCUMENTED
-
makeXPath
Expands xpath into namespace-aware version, hanlding attributes and attribute/value specifiers.- /record/relation
- /*[local-name()='record']/*[local-name()='relation'
- //relation/@type
- //*[local-name()='relation']/@type
- /record/relation[@type='Has part']
- /*[local-name()='record']/*[local-name()='relation'][@type='Has part']
- Parameters:
s- xpath as a qualifed string- Returns:
- namespace aware xpath
-
getXmlNode
public org.dom4j.Node getXmlNode()Gets the xmlNode attribute of the NldrMetadataRecord object- Returns:
- The xmlNode value
-
getXml
Gets the xml attribute of the NldrMetadataRecord object- Returns:
- The xml value
-
getXmlStripped
Gets the xml stripped of the XML declaration and DTD declaration.- Returns:
- The xml value
-
toString
Get a String representation of this XML. -
getDateStamp
Return a string for the current time and date, sutiable for display in log files and output to standout:- Returns:
- The dateStamp value
-
pp
protected static final void pp(org.dom4j.Node node) Description of the Method- Parameters:
node- Description of the Parameter
-
prtlnErr
Output a line of text to error out, with datestamp.- Parameters:
s- The text that will be output to error out.
-
setDebug
public static void setDebug(boolean db) Sets the debug attribute of the object- Parameters:
db- The new debug value
-