|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Linkable.Utility.MetaData
Field Summary | |
private Creation |
c
|
private static boolean |
DEBUG
|
private org.w3c.dom.Document |
doc
|
private javax.xml.parsers.DocumentBuilder |
domParser
|
private static uk.ac.soton.harvester.EntityDecode |
ed
|
private javax.xml.parsers.DocumentBuilderFactory |
factory
|
private static java.lang.String |
ME
|
Constructor Summary | |
MetaData(Creation _c)
|
Method Summary | |
static java.lang.String |
containsDate(java.lang.String inDate)
containsDate is a convenience routine to rewrite an input string, which contains a date, into "yyyy-mm-dd" format |
private void |
cookAuthors()
|
private void |
cookDate()
|
private void |
cookFullID()
|
private void |
cookTitle()
|
static void |
dumpNodes(org.w3c.dom.Document doc)
|
static java.lang.String |
getAttr(org.w3c.dom.Document doc,
java.lang.String name,
java.lang.String attr)
getAttr - Accesses a specific attribute of a specific node name |
static java.lang.String |
getData(java.lang.String filename)
Reads everything in from what is presumably an XML file and returns it to the caller; |
static java.lang.String |
getDate(java.lang.String url)
getDate - given an XML file of metadata return contents of a date entry |
static org.w3c.dom.Document |
getDOM(java.lang.String bytes)
getDOM - given an XML file of metadata as a byte[] array, construct a parse tree. |
static java.lang.String |
getValue(org.w3c.dom.Document doc,
java.lang.String name)
getValue - give the name of a tag in a Document, return the first value |
static java.lang.String |
getValue(org.w3c.dom.Node nameNode)
getValue - give the name of a tag in an Element, return the element's value. |
static java.lang.String[] |
getValues(org.w3c.dom.Document doc,
java.lang.String name)
getValues - give the name of a tag in a Document, return all values |
private void |
handleAuthorName(java.lang.String text)
|
private void |
handleTitle(java.lang.String text)
|
void |
setFile(java.lang.String mf)
setFile - gives this MetaData object a file to parse cook local metadata into canonical form, and see what it matches in the Creation database. |
static java.lang.String |
toOAMS(java.lang.String inDate)
toOAMS is a convenience routine to rewrite an input string, which is a date, into OAMS format, which is yyyy-mm-dd |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final java.lang.String ME
private static boolean DEBUG
private static uk.ac.soton.harvester.EntityDecode ed
private javax.xml.parsers.DocumentBuilderFactory factory
private javax.xml.parsers.DocumentBuilder domParser
private org.w3c.dom.Document doc
private Creation c
Constructor Detail |
public MetaData(Creation _c)
Method Detail |
public void setFile(java.lang.String mf)
-
- the XML file describing this work
Note: a Side Effect is that authors extracted from the metadata
are added to the Author database and to Creation c. Creation c
is added to the Creation database if not previously there.
Note: at present this procedure is invoked only by BibData.public static org.w3c.dom.Document getDOM(java.lang.String bytes)
-
- String is XML data to be parsed.
returns Document representing the XML file.public static java.lang.String getDate(java.lang.String url)
-
- the URL of the metadata filepublic static java.lang.String getValue(org.w3c.dom.Node nameNode)
-
- root Node of an XML subtree-
- the String which specifies the tag name
returns a String which is the first value of the first tag with
this name (or "");public static java.lang.String getValue(org.w3c.dom.Document doc, java.lang.String name)
-
- doc is the Document object representing an XML tree-
- name -s the String which specifies the tag name
returns a String which is the first value of the first tag with
this name (or "");public static java.lang.String[] getValues(org.w3c.dom.Document doc, java.lang.String name)
-
- doc is the Document object representing an XML tree-
- name -s the String which specifies the tag name
returns an array of Strings which are values of the first tag with
this name (or null);public static java.lang.String getAttr(org.w3c.dom.Document doc, java.lang.String name, java.lang.String attr)
The
- Document containing the XML treeThe
- name of the node of interestThe
- name of the attribute of interestpublic static void dumpNodes(org.w3c.dom.Document doc)
public static java.lang.String containsDate(java.lang.String inDate)
the
- string that potentially contains a datepublic static java.lang.String toOAMS(java.lang.String inDate)
the
- unformatted date, as a stringpublic static java.lang.String getData(java.lang.String filename)
the
- absolute pathname of the file to be read inprivate void cookFullID()
private void cookTitle()
private void cookDate()
private void cookAuthors()
private void handleTitle(java.lang.String text)
private void handleAuthorName(java.lang.String text)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |