se.kb.oai.pmh
Class Record

java.lang.Object
  extended by se.kb.oai.pmh.ResponseBase
      extended by se.kb.oai.pmh.Record

public class Record
extends ResponseBase

The Record class represents the data returned for a GetRecord or ListRecords request. It holds the actual metadata content.

Author:
Oskar Grenholm, National Library of Sweden

Field Summary
 
Fields inherited from class se.kb.oai.pmh.ResponseBase
OAI_NS_PREFIX, OAI_NS_URI, response, responseDate, resumptionToken, xpath
 
Constructor Summary
Record(Document document)
          Creates a Record from the response from a GetRecord request.
Record(Document document, Node record)
          Creates a Record from from a ListRecords response and a specific <record> element in that response.
 
Method Summary
 Element getAbout()
          Get the information about this Record.
 Header getHeader()
          Get the Header with the information about this Record.
 Element getMetadata()
          Get the metadata contained in the metadata element of this Record.
 String getMetadataAsString()
          Get the xml representation of the metadata as a String.
 
Methods inherited from class se.kb.oai.pmh.ResponseBase
getResponse, getResponseDate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Record

public Record(Document document)
       throws ErrorResponseException
Creates a Record from the response from a GetRecord request.

Parameters:
document - the response
Throws:
ErrorResponseException

Record

public Record(Document document,
              Node record)
       throws ErrorResponseException
Creates a Record from from a ListRecords response and a specific <record> element in that response.

Parameters:
document - the response
record - a <record> element
Throws:
ErrorResponseException
Method Detail

getHeader

public Header getHeader()
Get the Header with the information about this Record.

Returns:
a Header

getMetadata

public Element getMetadata()
Get the metadata contained in the metadata element of this Record.

Returns:
the metadata as xml

getMetadataAsString

public String getMetadataAsString()
                           throws IOException
Get the xml representation of the metadata as a String.

Returns:
the metadata as a String
Throws:
IOException

getAbout

public Element getAbout()
Get the information about this Record.

Returns:
the about information


Copyright © 2008. All Rights Reserved.