org.oclc.da.gdfr.registryprototype.srw.test
Class StubStructuredObject

java.lang.Object
  extended by org.oclc.da.gdfr.registryprototype.srw.test.StubStructuredObject
All Implemented Interfaces:
java.lang.Cloneable, AdminData, CollectionItem, Content, DataObject, StructuredDataObject

public class StubStructuredObject
extends java.lang.Object
implements CollectionItem, AdminData, Content, StructuredDataObject

Created on Oct 24, 2006

Author:
stanesca TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
StubStructuredObject(java.lang.String bytes)
           
 
Method Summary
 AdminData getAdminData()
          Returns the admin data for the CollectionItem in an Xml String
 java.lang.Object[] getAttr(java.lang.String name)
          Gets the attribute with the given name
 java.lang.String getBytestream()
          Returns the bytestream of the dataobject
 Content getPayload()
          Gets the data associated with the collection item.
 Ref getRef()
          Creates and returns a Ref based on this CollectionItem
 boolean setAdminData(AdminData data)
          Sets the admin data for the given CollectionItem
 boolean setAttr(java.lang.String attr, java.lang.String val)
          Sets the attribute specified with the given text value
 boolean setAttr(java.lang.String attr, java.lang.String[] vals)
          Sets a reoccuring attribute with the given values
 boolean setAttr(java.lang.String attr, StructuredDataObject obj)
          Sets an attribute with a complex value
 boolean setAttr(java.lang.String attr, StructuredDataObject[] objs)
          Sets a reoccuring attribute with complex values
 boolean setBytestream(java.lang.String bytes)
          Sets the bytestream of the dataobject
 boolean setPayload(Content data)
          Adds data to a CollectionItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StubStructuredObject

public StubStructuredObject(java.lang.String bytes)
Method Detail

getAdminData

public AdminData getAdminData()
Description copied from interface: CollectionItem
Returns the admin data for the CollectionItem in an Xml String

Specified by:
getAdminData in interface CollectionItem
Returns:
An Xml String or null if any exceptions were caught

getPayload

public Content getPayload()
Description copied from interface: CollectionItem
Gets the data associated with the collection item. This includes both the content and the admin data.

Specified by:
getPayload in interface CollectionItem
Returns:
An Xml String or null if any exceptions were caught

getRef

public Ref getRef()
Description copied from interface: CollectionItem
Creates and returns a Ref based on this CollectionItem

Specified by:
getRef in interface CollectionItem
Returns:
A Ref for this CollectionItem.

setAdminData

public boolean setAdminData(AdminData data)
Description copied from interface: CollectionItem
Sets the admin data for the given CollectionItem

Specified by:
setAdminData in interface CollectionItem
Parameters:
data - Xml String representing the admin data
Returns:
True, if the update was successful, false otherwise.

setPayload

public boolean setPayload(Content data)
Description copied from interface: CollectionItem
Adds data to a CollectionItem

Specified by:
setPayload in interface CollectionItem
Parameters:
data - The data to be added
Returns:
True, if the update was successful, false otherwise.

getAttr

public java.lang.Object[] getAttr(java.lang.String name)
Description copied from interface: StructuredDataObject
Gets the attribute with the given name

Specified by:
getAttr in interface StructuredDataObject
Parameters:
name - The name of the attribute to get
Returns:
The value of the given attribute

setBytestream

public boolean setBytestream(java.lang.String bytes)
Description copied from interface: DataObject
Sets the bytestream of the dataobject

Specified by:
setBytestream in interface DataObject

getBytestream

public java.lang.String getBytestream()
Description copied from interface: DataObject
Returns the bytestream of the dataobject

Specified by:
getBytestream in interface DataObject
Returns:
String representing the bytestream

setAttr

public boolean setAttr(java.lang.String attr,
                       StructuredDataObject[] objs)
Description copied from interface: StructuredDataObject
Sets a reoccuring attribute with complex values

Specified by:
setAttr in interface StructuredDataObject
Parameters:
attr - The attribute to set
objs - The complex elements to use
Returns:
true if successful, false otherwise

setAttr

public boolean setAttr(java.lang.String attr,
                       StructuredDataObject obj)
Description copied from interface: StructuredDataObject
Sets an attribute with a complex value

Specified by:
setAttr in interface StructuredDataObject
Parameters:
attr - The attribute to set
obj - The complex element to use
Returns:
true if successful, false otherwise

setAttr

public boolean setAttr(java.lang.String attr,
                       java.lang.String val)
Description copied from interface: StructuredDataObject
Sets the attribute specified with the given text value

Specified by:
setAttr in interface StructuredDataObject
Parameters:
attr - The name of the attribute to set
val - The value to give the attribute
Returns:
true if successful, false otherwise

setAttr

public boolean setAttr(java.lang.String attr,
                       java.lang.String[] vals)
Description copied from interface: StructuredDataObject
Sets a reoccuring attribute with the given values

Specified by:
setAttr in interface StructuredDataObject
Parameters:
attr - The attribute to set
vals - The values to assign
Returns:
true if successful, false otherwise


Copyright © 2008 OCLC Online Computer Library Center, Inc.. All Rights Reserved.