com.indexdata.mkjsf.pazpar2.data
Class ResponseDataObject

java.lang.Object
  extended by com.indexdata.mkjsf.pazpar2.data.ResponseDataObject
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ByTargetResponse, CommandError, Hit, InitResponse, Location, RecordResponse, SearchResponse, ServiceError, ShowResponse, SpResponseDataObject, StatResponse, Target, TargetCategory, TermListResponse, TermListsResponse, TermResponse

public class ResponseDataObject
extends Object
implements Serializable

Parent class of all response data objects, with generic methods for retrieving data elements

Author:
Niels Erik
See Also:
Serialized Form

Constructor Summary
ResponseDataObject()
           
 
Method Summary
 void addElement(String name, ResponseDataObject value)
          Used by the response XML parser to add child element objects to a parent element object
 void appendContent(String content)
           
 CommandError getApplicationError()
           
 String getAttribute(String name)
           
 byte[] getBinary()
           
 List<ResponseDataObject> getElements(String name)
           
 boolean getHasResults()
           
 int getIntValue(String name)
           
 boolean getIsBinary()
           
 ResponseDataObject getOneElement(String name)
           
 String getOneValue(String name)
          Returns the text content of the first element found with the given name
 String getProperty(String name)
           
 ServiceError getServiceError()
           
 String getType()
           
 String getValue()
           
 String[] getValueArray(String name)
          Returns string array with the values of the named element(s)
 String getXml()
           
 boolean hasApplicationError()
           
 boolean hasServiceError()
           
 void setAttribute(String name, String value)
           
 void setBinary(byte[] bytes)
           
 void setType(String type)
           
 void setXml(String xml)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseDataObject

public ResponseDataObject()
Method Detail

setType

public void setType(String type)

getType

public String getType()

setAttribute

public void setAttribute(String name,
                         String value)

getAttribute

public String getAttribute(String name)

addElement

public void addElement(String name,
                       ResponseDataObject value)
Used by the response XML parser to add child element objects to a parent element object

Parameters:
name - of the child element
value - the child object itself

getElements

public List<ResponseDataObject> getElements(String name)

getOneElement

public ResponseDataObject getOneElement(String name)

getOneValue

public String getOneValue(String name)
Returns the text content of the first element found with the given name

Parameters:
name - of the element
Returns:
text value, empty string if none found

getValueArray

public String[] getValueArray(String name)
Returns string array with the values of the named element(s)

Parameters:
name - of the child object(s) to retrieve value(s) from
Returns:

appendContent

public void appendContent(String content)

getValue

public String getValue()

getProperty

public String getProperty(String name)

getIntValue

public int getIntValue(String name)

hasApplicationError

public boolean hasApplicationError()

getApplicationError

public CommandError getApplicationError()

hasServiceError

public boolean hasServiceError()

getServiceError

public ServiceError getServiceError()

setXml

public void setXml(String xml)

getXml

public String getXml()

getHasResults

public boolean getHasResults()

getIsBinary

public boolean getIsBinary()

setBinary

public void setBinary(byte[] bytes)

getBinary

public byte[] getBinary()


Copyright © 2013. All Rights Reserved.