3.2.4: 2013-12-06

net.sf.basedb.util.overview.node
Class BioWellNameGenerator

java.lang.Object
  extended by net.sf.basedb.util.overview.node.BioWellNameGenerator
All Implemented Interfaces:
NodeNameGenerator<MeasuredBioMaterial>

public class BioWellNameGenerator
extends Object
implements NodeNameGenerator<MeasuredBioMaterial>

Name generator implementation for biomaterial items that are located on a biowell. This name generator is used when loading biomaterial on a bioplate.

Since:
3.2
Author:
Nicklas
Last modified
$Date$

Field Summary
private  BioWell currentWell
           
 
Constructor Summary
BioWellNameGenerator()
          Create a new biowell name generator.
 
Method Summary
private  String getCurrentNodeName()
           
private  String getCurrentTitlePrefix()
           
 String getDeniedNodeName(Node parentNode)
          Generate a name for a node when the item exists, but the current user doesn't have permission to access read the item.
 String getDeniedNodeTitle(Node parentNode)
          Generate a title for a node when the item exists, but the current user doesn't have permission to access read the item.
 String getMissingNodeName(Node parentNode)
          Generate a name for a node when the item is missing.
 String getMissingNodeTitle(Node parentNode)
          Generate a title for a node when the item is missing.
 String getNodeName(MeasuredBioMaterial item, Node parentNode)
          Generate a name for the new node that is about to be created.
 String getNodeTitle(MeasuredBioMaterial item, Node parentNode)
          Generate a title for the new node that is about to be created.
 void setCurrentWell(BioWell well)
          Set the well we are currently working with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentWell

private BioWell currentWell
Constructor Detail

BioWellNameGenerator

public BioWellNameGenerator()
Create a new biowell name generator.

Method Detail

getNodeTitle

public String getNodeTitle(MeasuredBioMaterial item,
                           Node parentNode)
Description copied from interface: NodeNameGenerator
Generate a title for the new node that is about to be created.

Specified by:
getNodeTitle in interface NodeNameGenerator<MeasuredBioMaterial>
Parameters:
item - The item that is attached to the node (never null)
parentNode - The parent node of the new node
Returns:
A title for the node

getNodeName

public String getNodeName(MeasuredBioMaterial item,
                          Node parentNode)
Description copied from interface: NodeNameGenerator
Generate a name for the new node that is about to be created.

Specified by:
getNodeName in interface NodeNameGenerator<MeasuredBioMaterial>
Parameters:
item - The item that is attached to the node (never null)
parentNode - The parent node of the new node
Returns:
A name for the node

getMissingNodeTitle

public String getMissingNodeTitle(Node parentNode)
Description copied from interface: NodeNameGenerator
Generate a title for a node when the item is missing.

Specified by:
getMissingNodeTitle in interface NodeNameGenerator<MeasuredBioMaterial>
Parameters:
parentNode - The parent node
Returns:
A title for the node

getMissingNodeName

public String getMissingNodeName(Node parentNode)
Description copied from interface: NodeNameGenerator
Generate a name for a node when the item is missing.

Specified by:
getMissingNodeName in interface NodeNameGenerator<MeasuredBioMaterial>
Parameters:
parentNode - The parent node
Returns:
A name for the node

getDeniedNodeTitle

public String getDeniedNodeTitle(Node parentNode)
Description copied from interface: NodeNameGenerator
Generate a title for a node when the item exists, but the current user doesn't have permission to access read the item.

Specified by:
getDeniedNodeTitle in interface NodeNameGenerator<MeasuredBioMaterial>
Parameters:
parentNode - The parent node
Returns:
A name for the node

getDeniedNodeName

public String getDeniedNodeName(Node parentNode)
Description copied from interface: NodeNameGenerator
Generate a name for a node when the item exists, but the current user doesn't have permission to access read the item.

Specified by:
getDeniedNodeName in interface NodeNameGenerator<MeasuredBioMaterial>
Parameters:
parentNode - The parent node
Returns:
A name for the node

setCurrentWell

public void setCurrentWell(BioWell well)
Set the well we are currently working with. The name generator need to know this before trying to generate node names and titles since it is possible that access to the biomaterial in the well is denied.

Parameters:
well - The current biowell

getCurrentNodeName

private String getCurrentNodeName()

getCurrentTitlePrefix

private String getCurrentTitlePrefix()

3.2.4: 2013-12-06