Package com.im.df.util
Class ChemicalTermsExpressionUtils
- java.lang.Object
- 
- com.im.df.util.ChemicalTermsExpressionUtils
 
- 
 public class ChemicalTermsExpressionUtils extends Object Validates chemical terms expressions.- Author:
- Tim Dudgeon
 
- 
- 
Constructor SummaryConstructors Constructor Description ChemicalTermsExpressionUtils(int jchemTableType)Creates a new instance of ChemicalTermsExpressionUtils.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancontainsExpressionValue(String expr, Map<String,String> map)static intgetJchemTableTypeForCT(com.im.df.api.ddl.DFEntity entity)static intgetJchemTableTypeForCT(com.im.df.api.ddl.DFField field)Determines the JChem table type which should be used for validation of CT expression.static booleanisLogSExpression(String formula)StringvalidateExpression(String expr, Class<?> returnType, boolean allowEmpty, com.im.df.api.capabilities.StructureEntityCapability entity)Validate the chemical terms expression.
 
- 
- 
- 
Method Detail- 
isLogSExpressionpublic static boolean isLogSExpression(String formula) - Parameters:
- formula- chemical terms field formula
- Returns:
- trueif given formula contains- logS()chemical terms expression
- Since:
- 18.21.0
 
 - 
validateExpressionpublic String validateExpression(String expr, Class<?> returnType, boolean allowEmpty, com.im.df.api.capabilities.StructureEntityCapability entity) Validate the chemical terms expression. Tries to evaluate the expression twice for methane. If the expression has a bad syntax or evaluating the expression generates an exception resulting from use of an unlicensed plugin then an error message is returned.- Parameters:
- expr- expression to validate
- returnType- expected type to which the expression will evaluate
- allowEmpty- whether the empty expression string is also valid
- entity- parent entity capability of the field where expression belongs to
- Returns:
- Null for a valid expression or an error message that explains why the expression is invalid.
 
 - 
containsExpressionValuepublic static boolean containsExpressionValue(String expr, Map<String,String> map) 
 - 
getJchemTableTypeForCTpublic static int getJchemTableTypeForCT(com.im.df.api.ddl.DFField field) Determines the JChem table type which should be used for validation of CT expression. If the field doesn't belong to a JChem entity, a warning is logged and the default table type is returned.- Parameters:
- field- field to examine
- Returns:
- the field's JChem table type or default
 
 - 
getJchemTableTypeForCTpublic static int getJchemTableTypeForCT(com.im.df.api.ddl.DFEntity entity) 
 
- 
 
-