org.dspace.content.packager
Class PackageParameters

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by org.dspace.content.packager.PackageParameters
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class PackageParameters
extends Properties

Parameter list for SIP and DIP packagers. It's really just a Java Properties object extended so each parameter can have multiple values. This was necessary so it can represent Servlet parameters, which have multiple values. It is also helpful to indicate e.g. metadata choices for package formats like METS that allow many different metadata segments.

Version:
$Revision: 3761 $
Author:
Larry Stone
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
PackageParameters()
           
PackageParameters(Properties defaults)
           
 
Method Summary
 Object addProperty(String key, String value)
          Adds a value to a property; if property already has value(s), this is tacked onto the end, otherwise it acts like setProperty().
static PackageParameters create(javax.servlet.ServletRequest request)
          Creates new parameters object with the parameter values from a servlet request object.
 boolean getBooleanProperty(String key, boolean defaultAnswer)
          Returns boolean form of property with selectable default
 String[] getProperties(String key)
          Returns multiple property values in an array.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PackageParameters

public PackageParameters()

PackageParameters

public PackageParameters(Properties defaults)
Method Detail

create

public static PackageParameters create(javax.servlet.ServletRequest request)
Creates new parameters object with the parameter values from a servlet request object.

Parameters:
request - - the request from which to take the values
Returns:
new parameters object.

addProperty

public Object addProperty(String key,
                          String value)
Adds a value to a property; if property already has value(s), this is tacked onto the end, otherwise it acts like setProperty().

Parameters:
key - - the key to be placed into this property list.
value - - the new value to add, corresponding to this key.
Returns:
the previous value of the specified key in this property list, or null if it did not have one.

getProperties

public String[] getProperties(String key)
Returns multiple property values in an array.

Parameters:
key - - the key to look for in this property list.
Returns:
all values in an array, or null if this property is unset.

getBooleanProperty

public boolean getBooleanProperty(String key,
                                  boolean defaultAnswer)
Returns boolean form of property with selectable default

Parameters:
key - the key to look for in this property list.
default - default to return if there is no such property
Returns:
the boolean derived from the value of property, or default if it was not specified.


Copyright © 2010 DuraSpace. All Rights Reserved.