Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.visual.mappings
Class MappingFactory

java.lang.Object
  extended by cytoscape.visual.mappings.MappingFactory

public class MappingFactory
extends Object

This class provides a static factory method for constructing an instance of ObjectMapping as specified by a Properties object and other arguments. Since there are currently only a few types of mappings known, it's easiest to simply check each case and construct the right mapping without going through a dynamic class-discovery instantiation process. If the number of mappings ever gets out of hand, we can always switch to a dynamic algorithm.


Constructor Summary
MappingFactory()
           
 
Method Summary
static Properties getProperties(ObjectMapping m, String baseKey)
          Gets a description of the supplied ObjectMapping as properties.
static ObjectMapping newMapping(Properties props, String baseKey, ValueParser parser, Object defObj, byte mapType)
          Attempt to construct an instance of ObjectMapping as defined by the supplied arguments.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingFactory

public MappingFactory()
Method Detail

newMapping

public static ObjectMapping newMapping(Properties props,
                                       String baseKey,
                                       ValueParser parser,
                                       Object defObj,
                                       byte mapType)
Attempt to construct an instance of ObjectMapping as defined by the supplied arguments. Checks the value of a recognized key in the Properties argument against a list of known Mappings. If found, constructs the Mapping object and then customizes it by calling its applyProperties method.


getProperties

public static Properties getProperties(ObjectMapping m,
                                       String baseKey)
Gets a description of the supplied ObjectMapping as properties. This method calls the getProperties() method of the ObjectMapping argument and then adds a property to identify the mapping class, in a form recognized by the newMapping method.


www.cytoscape.org