2.17.2: 2011-06-17

net.sf.basedb.util.export.spotdata
Class AdvancedFieldConverter

java.lang.Object
  extended by net.sf.basedb.util.export.spotdata.AbstractFieldConverter
      extended by net.sf.basedb.util.export.spotdata.StandardFieldConverter
          extended by net.sf.basedb.util.export.spotdata.AdvancedFieldConverter
All Implemented Interfaces:
ExportableFieldConverter

public class AdvancedFieldConverter
extends StandardFieldConverter

Field converter implementation that gives more detailed control how fields are converted and used in the export. The implementation builds on the StandardFieldConverter which is used as a fallback. The advanced options can be accessed by using formula-like field "names" as shown below. In most cases the "title" parameter is optional. If not given, the name is used as the title.

Field names that doesn't start with an equal character (=) are passed on to the StandardFieldConverter.

Since:
2.16
Author:
Nicklas
Last modified
$Date: 2010-08-05 13:16:18 +0200 (Thu, 05 Aug 2010) $

Field Summary
private  Map<String,Pattern> patterns
           
 
Constructor Summary
AdvancedFieldConverter(DbControl dc, BioAssaySet source)
          Create a new advanced field converter.
 
Method Summary
protected  AssayField getAdvancedAssayField(String expression, boolean required)
          Convert an expression to an assay field.
protected  DynamicField getAdvancedReporterField(String expression, boolean required)
          Convert an expression to a reporter field.
protected  DynamicField getAdvancedSpotField(String expression, boolean required)
          Convert an expression to a spot field.
 AssayField getAssayField(String name, boolean required)
          Find an assay field.
private  Pattern getPattern(String function, int requiredParameters, int optionalParameters)
           
 DynamicField getReporterField(String name, boolean required)
          Find a reporter dynamic field.
 DynamicField getSpotField(String name, boolean required)
          Find a spot dynamic field.
 
Methods inherited from class net.sf.basedb.util.export.spotdata.AbstractFieldConverter
getAssayAnnotationField, getAssayPropertyField, getDbControl, getExperimentalFactorField, getExtraValueField, getFormulaField, getIntensityField, getRawDataProperty, getReporterProperty, getSnapshotManager, getSource, setSnapshotManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patterns

private Map<String,Pattern> patterns
Constructor Detail

AdvancedFieldConverter

public AdvancedFieldConverter(DbControl dc,
                              BioAssaySet source)
Create a new advanced field converter.

Parameters:
dc - A DbControl to use for database access
source - The source bioassay set
Method Detail

getAssayField

public AssayField getAssayField(String name,
                                boolean required)
Description copied from class: StandardFieldConverter
Find an assay field. This method will try to locate a field in the following order:
  1. Check if there is an experimental factor with the given name (case-sensitivity depends on the database that is used).
  2. Check if there is an assay-level annotation type with the given name.
  3. If name is 'name', 'description' or another static property (case-insensitive) the corresponding assay value is used.

Specified by:
getAssayField in interface ExportableFieldConverter
Overrides:
getAssayField in class StandardFieldConverter
Parameters:
name - The name to find
required - If TRUE and no field is found this method will throw an ItemNotFoundException
Returns:
The field or null

getReporterField

public DynamicField getReporterField(String name,
                                     boolean required)
Description copied from class: StandardFieldConverter
Find a reporter dynamic field. This method will try to locate a field in the following order:
  1. Check if there is an position extra value with the given name (case-sensitivity depends on the database that is used).
  2. Check if there is a formula with the given name (case-sensitivity depends on the database that is used).
  3. If name is 'name', 'externalId', 'description' or another static property (case-insensitive) the corresponding reporter value is used.
  4. Special case for "External ID" and "Internal ID" to simplify pass-throguh to the BFS importer which expects at least one of those columns.

Specified by:
getReporterField in interface ExportableFieldConverter
Overrides:
getReporterField in class StandardFieldConverter
Parameters:
name - The name to find
required - If TRUE and no field is found this method will throw an ItemNotFoundException
Returns:
The field or null

getSpotField

public DynamicField getSpotField(String name,
                                 boolean required)
Description copied from class: StandardFieldConverter
Find a spot dynamic field. This method will try to locate a field in the following order:
  1. Check if there is a spot extra value with the given name (case-sensitivity depends on the database that is used).
  2. Check if there is a formula with the given name (case-sensitivity depends on the database that is used).
  3. Check if there is a raw data property that matches the name (case-insensitive)
  4. Special values: Ch 1, Ch2, etc. to get channel intensities (case-insensitive)

Specified by:
getSpotField in interface ExportableFieldConverter
Overrides:
getSpotField in class StandardFieldConverter
Parameters:
name - The name to find
required - If TRUE and no field is found this method will throw an ItemNotFoundException
Returns:
The field or null

getAdvancedAssayField

protected AssayField getAdvancedAssayField(String expression,
                                           boolean required)
Convert an expression to an assay field. Supported expressions are listed below. The "title" parameter is optional in all cases.


getAdvancedReporterField

protected DynamicField getAdvancedReporterField(String expression,
                                                boolean required)
Convert an expression to a reporter field. Supported expressions are listed below. The "title" parameter is optional in the "jep" expression.


getAdvancedSpotField

protected DynamicField getAdvancedSpotField(String expression,
                                            boolean required)
Convert an expression to a spot field. Supported expressions are listed below. The "title" parameter is optional in the "jep" expression.


getPattern

private Pattern getPattern(String function,
                           int requiredParameters,
                           int optionalParameters)

2.17.2: 2011-06-17