Class CodeConverter
- java.lang.Object
-
- ch.systemsx.cisd.openbis.generic.shared.basic.CodeConverter
-
public final class CodeConverter extends java.lang.Object
Methods for converter codes from business layer to database and from database to business layer.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getPropertyTypeCode(java.lang.String propertyColumnName)
Convert property column name as used in GUI to property type code as used in business layer.static boolean
isInternalNamespace(java.lang.String codeFromBusinessLayerOrNull)
Returnstrue
, if the codeFromBusinessLayerOrNull represents a internal property code.static java.lang.String
tryToBusinessLayer(java.lang.String codeFromDatabaseOrNull, boolean internalNamespace)
Converts a code from database form to business layer form.static java.lang.String
tryToDatabase(java.lang.String codeFromBusinessLayerOrNull)
Converts a property type code from business layer form to database form.
-
-
-
Method Detail
-
tryToBusinessLayer
public static java.lang.String tryToBusinessLayer(java.lang.String codeFromDatabaseOrNull, boolean internalNamespace)
Converts a code from database form to business layer form.If internalNamespace is
true
, the prefix '$' will be used, because internal properties will be represented as 'NAME' in the database and as $NAME in the business layer.- Returns:
- The code appropriate for the business layer.
-
tryToDatabase
public static java.lang.String tryToDatabase(java.lang.String codeFromBusinessLayerOrNull)
Converts a property type code from business layer form to database form.The code will be translated to upper case. Internal properties will be represented as 'NAME' in the database and as $NAME in the business layer.
- Returns:
- The code appropriate for the database.
-
isInternalNamespace
public static boolean isInternalNamespace(java.lang.String codeFromBusinessLayerOrNull)
Returnstrue
, if the codeFromBusinessLayerOrNull represents a internal property code.
-
getPropertyTypeCode
public static java.lang.String getPropertyTypeCode(java.lang.String propertyColumnName)
Convert property column name as used in GUI to property type code as used in business layer.
-
-