edu.berkeley.guir.papier_mache.assoc
Class DefaultAssociationFactory

java.lang.Object
  extended by edu.berkeley.guir.papier_mache.assoc.DefaultAssociationFactory
All Implemented Interfaces:
AssociationFactory, edu.berkeley.guir.lib.util.ToShortStringable
Direct Known Subclasses:
ClassInstanceFactory, MarbleAnswering, ShapeAnalogueFactory, StringFactory, UserAssociationFactory, VisualAnalogueFactory

public abstract class DefaultAssociationFactory
extends java.lang.Object
implements AssociationFactory

This interface is used to select what type of media element is to be associated with a new phob.

Author:
Scott Klemmer ( srk(AT)cs.berkeley.edu )

Constructor Summary
DefaultAssociationFactory()
           
 
Method Summary
abstract  AssociationElt createAssociationEltForPhob(Phob phob)
          Create an AssociationElt based on the given phob
 void setParameter(java.lang.String paramName, java.lang.String paramValue)
          Used when unmarshalling an XML file.
 java.lang.String toShortString()
          Provides a short explanation of what this factory will create.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultAssociationFactory

public DefaultAssociationFactory()
Method Detail

createAssociationEltForPhob

public abstract AssociationElt createAssociationEltForPhob(Phob phob)
Description copied from interface: AssociationFactory
Create an AssociationElt based on the given phob

Specified by:
createAssociationEltForPhob in interface AssociationFactory
Parameters:
phob - used to decide what type of AssociationElt to create
Returns:
the created AssociatoinElt

toShortString

public java.lang.String toShortString()
Provides a short explanation of what this factory will create. Should be overriden by subclasses.

Specified by:
toShortString in interface edu.berkeley.guir.lib.util.ToShortStringable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setParameter

public void setParameter(java.lang.String paramName,
                         java.lang.String paramValue)
Used when unmarshalling an XML file. Subclasses implement this so that the unmarshaller can set all of the parameter fields. The default behavior is to throw an error that the parameter is not a field of the class. If a classifier does not accept a parameter, it should call super.setParameter(), which will invoke this error handler.

Specified by:
setParameter in interface AssociationFactory
Parameters:
paramName - the name of the parameter to set
paramValue - the value of the parameter