org.intermine.api.bag
Class BagQueryConfig

java.lang.Object
  extended by org.intermine.api.bag.BagQueryConfig

public class BagQueryConfig
extends java.lang.Object

Configuration for BagQuery objects.


Constructor Summary
BagQueryConfig(java.util.Map<java.lang.String,java.util.List<BagQuery>> bagQueries, java.util.Map<java.lang.String,java.util.List<BagQuery>> preDefaultBagQueries, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String[]>> additionalConverters)
          Create a new BagQueryConfig object.
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String[]> getAdditionalConverters(java.lang.String type)
          Return a Map from a converter Class name (such as org.intermine.bio.web.logic.OrthologueConverter) to an array containing three Strings.
 java.util.List<BagQuery> getBagQueries(java.lang.String type)
          Return a list of BagQuerys to run for a given type
 java.lang.String getConnectField()
          Return the connecting field.
 java.lang.String getConstrainField()
          Return the constrain field.
 java.lang.String getExtraConstraintClassName()
          Return the class name that was passed to the constructor.
 java.util.List<BagQuery> getPreDefaultBagQueries(java.lang.String type)
          Return a List of BagQuerys for the given type that should be run before the default query
 void setConnectField(java.lang.String connectField)
          Set the connecting field for adding an extra constraint to bag queries.
 void setConstrainField(java.lang.String constrainField)
          Set the field to constrain when making an extra constraint.
 void setExtraConstraintClassName(java.lang.String extraConstraintClassName)
          Set the class name of extra constraint to use in BagQuery objects using this config object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BagQueryConfig

public BagQueryConfig(java.util.Map<java.lang.String,java.util.List<BagQuery>> bagQueries,
                      java.util.Map<java.lang.String,java.util.List<BagQuery>> preDefaultBagQueries,
                      java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String[]>> additionalConverters)
Create a new BagQueryConfig object.

Parameters:
bagQueries - a Map from class name to bag query
preDefaultBagQueries - a separate map of queries to run before the default
additionalConverters - extra converters configured - see getAdditionalConverters
Method Detail

getExtraConstraintClassName

public java.lang.String getExtraConstraintClassName()
Return the class name that was passed to the constructor. This (and connectField and constrainField) is used to configure the addition of an extra constraint to the bag queries. (eg. constraining the Organism).

Returns:
the extra class name

setExtraConstraintClassName

public void setExtraConstraintClassName(java.lang.String extraConstraintClassName)
Set the class name of extra constraint to use in BagQuery objects using this config object.

Parameters:
extraConstraintClassName - the class name

getConnectField

public java.lang.String getConnectField()
Return the connecting field.

Returns:
the connecting field

setConnectField

public void setConnectField(java.lang.String connectField)
Set the connecting field for adding an extra constraint to bag queries.

Parameters:
connectField - the field name

getConstrainField

public java.lang.String getConstrainField()
Return the constrain field.

Returns:
the constrain field

setConstrainField

public void setConstrainField(java.lang.String constrainField)
Set the field to constrain when making an extra constraint.

Parameters:
constrainField - the constraint field

getBagQueries

public java.util.List<BagQuery> getBagQueries(java.lang.String type)
Return a list of BagQuerys to run for a given type

Parameters:
type - the type to fetch queries for
Returns:
the BagQuerys Map

getPreDefaultBagQueries

public java.util.List<BagQuery> getPreDefaultBagQueries(java.lang.String type)
Return a List of BagQuerys for the given type that should be run before the default query

Parameters:
type - the type to fetch queries for
Returns:
the BagQuerys Map

getAdditionalConverters

public java.util.Map<java.lang.String,java.lang.String[]> getAdditionalConverters(java.lang.String type)
Return a Map from a converter Class name (such as org.intermine.bio.web.logic.OrthologueConverter) to an array containing three Strings. The first is a comma-separated list of names for the converter that may be referred to in a URL (like orthologue). The second is the class constraint, and the third is the target type.

Parameters:
type - get converters for this type or a subtype of it
Returns:
the additionalConverters