Package org.qdl_lang.util
Class QDLAggregateUtil
- java.lang.Object
-
- org.qdl_lang.util.QDLAggregateUtil
-
public class QDLAggregateUtil extends Object
The QDL utility for processing aggregates (stems and sets). This allows for processing each scalar in an aggregate and handles navigating them in turn. Implement or extends theProcessScalar
interface.Processing aggregates.
You can do them so they follow the standard QDL stem/set contracts when implementing a system function by executing the correctAbstractEvaluator
.processN in an evaluator or if you have something specific address each scalar using this utility. This utility in particular is useful when writing Java extensions that implementQDLFunction
where the machinery ofFunctionEvaluator
is not available.Usage
If you have an aggregate and need to process scalars, call this with the right overrides toProcessScalarImpl
. That class simply passes back its arguments unchanged as a default behavior.Handling exceptions
If you use this in an extension (so a Java class that extendsQDLFunction
) then you don't need to do anything special exception throw Java exceptions. If you are using this outside of that, then throws anUnknownTypeException
for an unknown type. Since this does not have the actual QDL statement that triggered the error, it is set to null. You should catch the exception when calling this and fill that in with the right value so the user gets the right information.
-
-
Constructor Summary
Constructors Constructor Description QDLAggregateUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
process(Object object, ProcessScalar processScalar)
Top-level call for this set of utilities.static QDLSet
processSet(QDLSet inSet, ProcessScalar processScalar)
static QDLStem
processStem(QDLStem inStem, ProcessScalar processScalar)
-
-
-
Method Detail
-
process
public static Object process(Object object, ProcessScalar processScalar)
Top-level call for this set of utilities. Create the right scalar processor, then call this on a generic object. A scalar is processed and returned as such, aggregates are processed as aggregates.- Parameters:
object
-processScalar
-- Returns:
-
processStem
public static QDLStem processStem(QDLStem inStem, ProcessScalar processScalar)
-
processSet
public static QDLSet processSet(QDLSet inSet, ProcessScalar processScalar)
-
-