Package com.im.df.api.dml
Class Operators.StructureOperator
- java.lang.Object
-
- com.im.df.api.dml.DFOperator
-
- com.im.df.api.dml.Operators.StructureOperator
-
- Enclosing class:
- Operators
public static class Operators.StructureOperator extends DFOperator
Class for all Structure based operators.
-
-
Constructor Summary
Constructors Constructor Description StructureOperator(java.lang.String persistName, java.lang.String displayName)StructureOperator(java.lang.String persistName, java.lang.String displayName, java.lang.String displayNameInExpression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisFieldAcceptableAsOperand(DFField field)This is just an utility method which must be implemented by subclasses.java.lang.Object[]parseOperands(DFField field, java.lang.String operands)java.lang.StringtoString(java.util.List<DFTerm> operands)voidvalidate(DFDataTree dataTree, java.util.List<DFTerm> operands, java.util.Map<java.lang.String,java.lang.Object> options, TermErrors errors)Validate the operands in context of this operator.-
Methods inherited from class com.im.df.api.dml.DFOperator
correctNumberOfOperands, getDisplayName, getDisplayNameInExpression, getMaxOperands, getMinOperands, getPersistName, getStartingWith, getStartingWithOperator, getToStringPart, toString
-
-
-
-
Method Detail
-
validate
public void validate(DFDataTree dataTree, java.util.List<DFTerm> operands, java.util.Map<java.lang.String,java.lang.Object> options, TermErrors errors)
Description copied from class:DFOperatorValidate the operands in context of this operator. It's up to operator to decide if it accepts the given operands or not. This method is called fromDFTerm.validate(com.im.df.api.ddl.DFDataTree).- Overrides:
validatein classDFOperator- Parameters:
dataTree- The datatree where this operator will be usedoperands- The list of operandsoptions- Options of this query term (DFTermExpression.getOptions()errors- The errors object which contains the result of the validation
-
isFieldAcceptableAsOperand
public boolean isFieldAcceptableAsOperand(DFField field)
Description copied from class:DFOperatorThis is just an utility method which must be implemented by subclasses. It tests if the given field is acceptable as operand for thisDFOperator. It can return true even for fields which are recognized as invalid later. This is just rough test in the beginning of validation to filter inappropriate fields.For example some operator takes two operands of different types (text, integer,...), but both must be of the same type. In this case this method returns true for all text, integer etc. fields, but if you use combination of [text, integer] as operands, it will be invalid.
- Specified by:
isFieldAcceptableAsOperandin classDFOperator- Parameters:
field- The field to be tested- Returns:
- True if field seems to be acceptable, false otherwise.
-
toString
public java.lang.String toString(java.util.List<DFTerm> operands)
- Overrides:
toStringin classDFOperator
-
parseOperands
public java.lang.Object[] parseOperands(DFField field, java.lang.String operands) throws java.lang.IllegalArgumentException
- Specified by:
parseOperandsin classDFOperator- Throws:
java.lang.IllegalArgumentException
-
-