public class DleseXMLReader extends java.lang.Object implements XMLMap
The accessor methods act as an interface with the XMLNode
and XMLRecord
classes. The XML processing details are handled by those classes,
but the one requirement of this class is to have knowledge of the paths
structure. Paths are used as keys into the XMLRecord map.
Modifier and Type | Field and Description |
---|---|
protected boolean |
isValid
boolean value indicates success of initialization
|
protected java.util.HashMap |
map
mapping of user-defined names to metadata values
|
protected java.io.File |
xmlFile
source XML file
|
protected XMLRecord |
xmlRecord
convenience abstraction of the XML DOM
|
Modifier | Constructor and Description |
---|---|
protected |
DleseXMLReader()
Default constructor is restricted to assure that a file directory is
provided on object creation.
|
|
DleseXMLReader(java.io.File xmlfile) |
|
DleseXMLReader(java.lang.String filepath) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Releases all resources and calls finalize method.
|
protected java.lang.String |
getAccessionedDate()
Retrieves the date the catalog record was created.
|
protected java.util.List |
getAnnotations()
Retrieves the list of lifecycle contributors to a resource from the current
record.
|
protected java.util.List |
getAudiences()
Retrieves the list of intended audiences for a resource from the current
record.
|
protected java.lang.String |
getComment(java.lang.String key,
java.lang.String identifier)
Retrieves a specific comment from the XML node identified by the key.
|
protected java.lang.String |
getCopyright()
Retreives the copright information of a resource from the current record.
|
protected java.lang.String |
getCost()
Retrieves the cost information of a resource from the current record.
|
protected java.lang.String |
getCreatedDate()
Retrieves the date the catalog record was created.
|
protected java.lang.String |
getDescription()
Retreives the description of a resource from the current record.
|
protected java.util.List |
getGeographyStds()
Retrieves the list of geography standards defined for the current resource.
|
protected java.util.List |
getGeoReferences()
Retrieves the list of georeferences for a resource from the current record.
|
protected java.lang.String |
getID()
Retrieves the record ID from XML file.
|
protected java.lang.String |
getInformation()
Retrieves the additional information from the footnote comment of the
current record.
|
java.lang.String |
getInitErrorMsg()
Gets a message describing the initialization error or empty string
if no error occured.
|
java.util.List |
getKeys()
Retrieves a list the keys contained in the map.
|
protected java.util.List |
getKeywords()
Gets the keywords attribute of the DleseXMLReader object
|
protected java.util.List |
getLifecycleContributors()
Retrieves the list of lifecycle contributors to a resource from the current
record.
|
protected java.util.List |
getMetametadataContributors()
Retrieves the list of metadata contributors for a resource from the current
record.
|
protected java.lang.String |
getOtherTechnicalInfo()
Gets the otherTechnicalInfo attribute of the DleseXMLReader object
|
protected java.util.List |
getRelations()
Retrieves the list of lifecycle contributors to a resource from the current
record.
|
protected java.util.List |
getResourceTypes()
Retrieves the list of learning resource types for a resource from the
current record.
|
protected java.lang.String |
getResourceURL()
Retrieves the URL of the reource this record catalogs.
|
protected java.util.List |
getScienceStds()
Retrieves the list of intended audiences for a resource from the current
record.
|
protected java.lang.String |
getStringValue(java.lang.String key)
Retrieves text content from the XML node identified by the key.
|
protected java.util.List |
getSubjects()
Retrieves the list of subjects specified for a resource from the current
record.
|
protected java.util.List |
getTechnicalFormats()
Gets the technicalFormats attribute of the DleseXMLReader object
|
protected java.util.List |
getTechnicalReqs()
Retrieves the list of technical requirements for a resource from the
current record.
|
protected java.lang.String |
getTitle()
Retreives the resource title from the current record.
|
protected java.util.List |
getURLs()
Retrieves the list of subjects specified for a resource from the current
record.
|
java.lang.Object |
getValue(java.lang.String name)
Getter method to retrieve a specific metadata value.
|
java.util.List |
getValues()
Retrieves the list of metadata values held in the map.
|
boolean |
init()
Creates XMLRecord and intializes local map.
|
protected void |
insertToList(java.util.List list,
java.lang.Object o)
Simple insertion routine for constructing an ordered list of Objects
|
protected void |
insertToList(java.util.List list,
java.lang.String s)
Simple insertion sort for building a sorted list of Strings.
|
void |
setMap()
After successful initialization, this method creates the map of actual
name:value pairs defined within this specific XMLMap instance.
|
void |
setValue(java.lang.String name,
java.lang.Object xmlObject)
Setter method for setting a specific metadata value.
|
protected boolean isValid
protected java.io.File xmlFile
protected XMLRecord xmlRecord
protected java.util.HashMap map
protected DleseXMLReader()
public DleseXMLReader(java.io.File xmlfile)
xmlfile
- public DleseXMLReader(java.lang.String filepath)
filepath
- A qualified filepath to a well-formed XML file.public boolean init()
public java.lang.String getInitErrorMsg()
public void destroy()
public java.lang.Object getValue(java.lang.String name)
public void setValue(java.lang.String name, java.lang.Object xmlObject)
public void setMap()
public java.util.List getKeys()
public java.util.List getValues()
protected java.lang.String getComment(java.lang.String key, java.lang.String identifier)
key
- The path for the desired node.identifier
- A string used to identify the specific comment.protected java.lang.String getID()
protected java.lang.String getResourceURL()
protected java.lang.String getCreatedDate()
protected java.lang.String getAccessionedDate()
protected java.lang.String getInformation()
protected java.lang.String getTitle()
protected java.lang.String getDescription()
protected java.lang.String getCost()
protected java.lang.String getCopyright()
protected java.lang.String getOtherTechnicalInfo()
protected java.util.List getAudiences()
List
of strings of intended audiences.protected java.util.List getTechnicalFormats()
protected java.util.List getSubjects()
List
of strings of specified subjects.protected java.util.List getURLs()
List
of strings of specified subjects.protected java.util.List getTechnicalReqs()
List
of MeccaMain.TechnicalReq
objects.protected java.util.List getResourceTypes()
List
of DleseRecord.ResourceType
objects.protected java.util.List getMetametadataContributors()
List
of DleseRecord.Contributor
objects
identifying the metadata contributors.protected java.util.List getLifecycleContributors()
List
of DleseRecord.Contributor
objects
identifying the lifecycle contributors.protected java.util.List getAnnotations()
List
of DleseRecord.Contributor
objects
identifying the lifecycle contributors.protected java.util.List getRelations()
List
of DleseRecord.Contributor
objects
identifying the lifecycle contributors.protected java.util.List getGeoReferences()
List
of DleseRecord.Contributor
objects
identifying the lifecycle contributors.protected java.util.List getKeywords()
protected java.util.List getGeographyStds()
List
of strings of intended audiences.protected java.util.List getScienceStds()
List
of strings of intended audiences.protected java.lang.String getStringValue(java.lang.String key)
key
- The path for the desired node.protected void insertToList(java.util.List list, java.lang.String s)
list
- List
to add an item to.s
- String
to add to the list.protected void insertToList(java.util.List list, java.lang.Object o)
list
- List
to add an item to.o
- Object
to add to the list.