3.2.4: 2013-12-06

net.sf.basedb.core
Class ClonableProperty

java.lang.Object
  extended by net.sf.basedb.core.ExtendedProperty
      extended by net.sf.basedb.core.ClonableProperty
All Implemented Interfaces:
Comparable<ClonableProperty>, ToTransferable<ExtendedPropertyInfo>

public class ClonableProperty
extends ExtendedProperty
implements Comparable<ClonableProperty>

Represents a reporter property that can be cloned to a per-experiment table in the dynamic database. A cloned property is more or less the same as an ExtendedProperty but with added support for regular (static) properties.

Since:
3.1
Author:
Nicklas
Last modified
$Date: 2012-09-12 14:46:39 +0200 (Wed, 12 Sep 2012) $

Field Summary
static String DESCRIPTION
          The property name of the "static" property ReporterData.getDescription()
static String ENTRY_DATE
          The property name of the "static" property ReporterData.getEntryDate()
static String EXTERNAL_ID
          The property name of the "static" property ReporterData.getExternalId().
static String ID
          The property name of the "static" property BasicData.getId().
private  boolean isExtendedProperty
           
private  boolean isMandatory
           
static String LAST_SOURCE
          The property name of the "static" property ReporterData.getLastSource()
static String LAST_UPDATE
          The property name of the "static" property ReporterData.getLastUpdate()
private static boolean MANDATORY
           
static String NAME
          The property name of the "static" property ReporterData.getName()
private static boolean NULLABLE
           
static String SYMBOL
          The property name of the "static" property ReporterData.getSymbol()
static String VERSION
          The property name of the "static" property BasicData.getVersion().
 
Constructor Summary
private ClonableProperty(ExtendedProperty p)
          Create a cloned property representation of an extended property
(package private) ClonableProperty(String propertyName, ReporterClonePropertyData d)
          Create a cloned property representation of a data-layer object.
private ClonableProperty(String propertyName, String title, String description, String column, Type valueType, int length, boolean nullable, Formula.AverageMethod averageMethod, boolean isMandatory)
          Create a cloned property representation of a static property.
 
Method Summary
 int compareTo(ClonableProperty o)
          Sort by title, but mandatory properties before non-madatory.
static ClonableProperty create(String name)
          Create a cloned property from either an extended or static property.
static ClonableProperty createFromExtended(String name)
          Create a cloned property representation of an extended property.
static ClonableProperty createFromRegular(String name)
          Create a cloned property that represents the "static" property with the given name.
 boolean equals(Object o)
           
 boolean exists()
          Check if this cloned property still exists.
static List<ClonableProperty> getAll()
          Get a list containing cloned property representation for all static and extended properties.
static List<ClonableProperty> getAllMandatory()
          Get a list with all mandatory properties that must be cloned.
 int hashCode()
           
 boolean isExtendedProperty()
          Is this cloned property an extended property or a "static" property?
 boolean isMandatory()
          Check if this property is mandatory in all clone templates.
(package private)  ReporterClonePropertyData toData()
          Create a data-layer reprsentation of the cloned property.
 String toString()
           
 
Methods inherited from class net.sf.basedb.core.ExtendedProperty
getAverageMethod, getColumn, getDescription, getLength, getName, getTitle, getType, getUrl, isAveragable, isInsertable, isNullable, isUpdateable, isValidName, parseString, parseString, toTransferable, validateValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MANDATORY

private static final boolean MANDATORY
See Also:
Constant Field Values

NULLABLE

private static final boolean NULLABLE
See Also:
Constant Field Values

ID

public static String ID
The property name of the "static" property BasicData.getId(). This property is mandatory in clone templates.


VERSION

public static String VERSION
The property name of the "static" property BasicData.getVersion(). This property is mandatory in clone templates.


EXTERNAL_ID

public static String EXTERNAL_ID
The property name of the "static" property ReporterData.getExternalId(). This property is mandatory in clone templates.


NAME

public static String NAME
The property name of the "static" property ReporterData.getName()


SYMBOL

public static String SYMBOL
The property name of the "static" property ReporterData.getSymbol()


ENTRY_DATE

public static String ENTRY_DATE
The property name of the "static" property ReporterData.getEntryDate()


LAST_SOURCE

public static String LAST_SOURCE
The property name of the "static" property ReporterData.getLastSource()


LAST_UPDATE

public static String LAST_UPDATE
The property name of the "static" property ReporterData.getLastUpdate()


DESCRIPTION

public static String DESCRIPTION
The property name of the "static" property ReporterData.getDescription()


isMandatory

private final boolean isMandatory

isExtendedProperty

private final boolean isExtendedProperty
Constructor Detail

ClonableProperty

private ClonableProperty(String propertyName,
                         String title,
                         String description,
                         String column,
                         Type valueType,
                         int length,
                         boolean nullable,
                         Formula.AverageMethod averageMethod,
                         boolean isMandatory)
Create a cloned property representation of a static property.


ClonableProperty

private ClonableProperty(ExtendedProperty p)
Create a cloned property representation of an extended property

Parameters:
p - The extended property to clone

ClonableProperty

ClonableProperty(String propertyName,
                 ReporterClonePropertyData d)
Create a cloned property representation of a data-layer object.

Parameters:
propertyName - The name of the property
d - Other metadata for the property
Method Detail

createFromRegular

public static ClonableProperty createFromRegular(String name)
Create a cloned property that represents the "static" property with the given name.

Parameters:
name - The name of the static property
Returns:
A cloned property
Throws:
ItemNotFoundException - If a property with the given name doesn't exist

createFromExtended

public static ClonableProperty createFromExtended(String name)
Create a cloned property representation of an extended property.

Parameters:
name - The name of the extended property
Returns:
A cloned property view of the extended property
Throws:
ItemNotFoundException - If a property with the given name doesn't exist

create

public static ClonableProperty create(String name)
Create a cloned property from either an extended or static property. This method will first check if an extended property with the given name exists.

Parameters:
name - The name of the property
Returns:
A cloned property view of the extended or static property
Throws:
ItemNotFoundException - If a property with the given name doesn't exist

getAll

public static List<ClonableProperty> getAll()
Get a list containing cloned property representation for all static and extended properties.


getAllMandatory

public static List<ClonableProperty> getAllMandatory()
Get a list with all mandatory properties that must be cloned.


toData

ReporterClonePropertyData toData()
Create a data-layer reprsentation of the cloned property.


isExtendedProperty

public boolean isExtendedProperty()
Is this cloned property an extended property or a "static" property?


isMandatory

public boolean isMandatory()
Check if this property is mandatory in all clone templates.


exists

public boolean exists()
Check if this cloned property still exists. A cloned property that has been added to a template is not automatically removed if the extended properties configuration is changed.


toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(ClonableProperty o)
Sort by title, but mandatory properties before non-madatory.

Specified by:
compareTo in interface Comparable<ClonableProperty>

3.2.4: 2013-12-06