public CodegenExpression evaluateEventGetROCollectionScalarCodegen(CodegenMethodScope codegenMethodScope, ExprEnumerationGivenEventSymbol symbols, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(Collection.class, PropertyDotScalarCollection.class, codegenClassScope); methodNode.getBlock().methodReturn(CodegenLegoCast.castSafeFromObjectType(Collection.class, getter.eventBeanGetCodegen(symbols.getAddEvent(methodNode), codegenMethodScope, codegenClassScope))); return localMethod(methodNode); }
public CodegenExpression evaluateEventGetROCollectionScalarCodegen(CodegenMethodScope codegenMethodScope, ExprEnumerationGivenEventSymbol symbols, CodegenClassScope codegenClassScope) { if (JavaClassHelper.isImplementsInterface(getterReturnType, Collection.class)) { return getter.eventBeanGetCodegen(symbols.getAddEvent(codegenMethodScope), codegenMethodScope, codegenClassScope); } CodegenMethod method = codegenMethodScope.makeChild(Collection.class, PropertyDotScalarIterable.class, codegenClassScope); method.getBlock().declareVar(getterReturnType, "result", CodegenLegoCast.castSafeFromObjectType(Iterable.class, getter.eventBeanGetCodegen(symbols.getAddEvent(method), codegenMethodScope, codegenClassScope))) .ifRefNullReturnNull("result") .methodReturn(staticMethod(CollectionUtil.class, "iterableToCollection", ref("result"))); return localMethod(method); }
private CodegenExpression codegenEvaluateInternal(CodegenExpression event, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { if (JavaClassHelper.isImplementsInterface(getterReturnType, Collection.class)) { return getter.eventBeanGetCodegen(event, codegenMethodScope, codegenClassScope); } CodegenMethod method = codegenMethodScope.makeChild(Collection.class, PropertyDotScalarIterable.class, codegenClassScope).addParam(EventBean.class, "event").getBlock() .declareVar(getterReturnType, "result", CodegenLegoCast.castSafeFromObjectType(Iterable.class, getter.eventBeanGetCodegen(ref("event"), codegenMethodScope, codegenClassScope))) .ifRefNullReturnNull("result") .methodReturn(staticMethod(CollectionUtil.class, "iterableToCollection", ref("result"))); return localMethodBuild(method).pass(event).call(); }
public CodegenExpression makeCodegen(CodegenClassScope classScope, CodegenMethodScope parent) { CodegenMethod method = parent.makeChild(Object.class, this.getClass(), classScope).addParam(GET_FILTER_VALUE_FP); method.getBlock() .declareVar(EventBean.class, "props", exprDotMethod(REF_EXPREVALCONTEXT, "getContextProperties")) .ifRefNullReturnNull(ref("props")) .methodReturn(getter.eventBeanGetCodegen(ref("props"), method, classScope)); return localMethod(method, GET_FILTER_VALUE_REFS); }
public CodegenExpression codegen(CodegenExpression target, Class targetType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(returnType, DTLocalBeanReformatForge.class, codegenClassScope).addParam(EventBean.class, "target"); CodegenBlock block = methodNode.getBlock() .declareVar(getterResultType, "timestamp", getter.eventBeanGetCodegen(ref("target"), methodNode, codegenClassScope)); if (!getterResultType.isPrimitive()) { block.ifRefNullReturnNull("timestamp"); } block.methodReturn(inner.codegen(ref("timestamp"), getterResultType, methodNode, exprSymbol, codegenClassScope)); return localMethod(methodNode, target); } }
private CodegenMethod getCodegen(CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { return codegenMethodScope.makeChild(Object.class, this.getClass(), codegenClassScope).addParam(EventBean.class, "theEvent").getBlock() .declareVarWCast(DecoratingEventBean.class, "wrapperEvent", "theEvent") .declareVar(EventBean.class, "wrappedEvent", exprDotMethod(ref("wrapperEvent"), "getUnderlyingEvent")) .ifRefNullReturnNull("wrappedEvent") .methodReturn(underlyingGetter.eventBeanGetCodegen(ref("wrappedEvent"), codegenMethodScope, codegenClassScope)); }
public CodegenExpression codegen(Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(resultType, this.getClass(), codegenClassScope); CodegenExpressionRef refExprEvalCtx = exprSymbol.getAddExprEvalCtx(methodNode); methodNode.getBlock() .ifCondition(notEqualsNull(refExprEvalCtx)) .blockReturn(CodegenLegoCast.castSafeFromObjectType(resultType, getter.eventBeanGetCodegen(exprDotMethod(refExprEvalCtx, "getContextProperties"), methodNode, codegenClassScope))) .methodReturn(constantNull()); return localMethod(methodNode); }
private CodegenMethod getObjectArrayCodegen(CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) { return codegenMethodScope.makeChild(Object.class, this.getClass(), codegenClassScope).addParam(Object[].class, "array").getBlock() .declareVar(Object.class, "value", arrayAtIndex(ref("array"), constant(propertyIndex))) .ifRefNullReturnNull("value") .declareVarWCast(EventBean.class, "theEvent", "value") .methodReturn(eventBeanEntryGetter.eventBeanGetCodegen(ref("theEvent"), codegenMethodScope, codegenClassScope)); }
public CodegenExpression evaluateCodegen(Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(returnType, this.getClass(), codegenClassScope); CodegenExpressionRef refEPS = exprSymbol.getAddEPS(methodNode); methodNode.getBlock() .declareVar(EventBean.class, "streamEvent", arrayAtIndex(refEPS, constant(streamNum))) .ifRefNullReturnNull("streamEvent") .methodReturn(CodegenLegoCast.castSafeFromObjectType(returnType, getter.eventBeanGetCodegen(ref("streamEvent"), methodNode, codegenClassScope))); return localMethod(methodNode); }
public static CodegenExpression codegen(DTLocalBeanCalOpsForge forge, CodegenExpression inner, Class innerType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(forge.innerReturnType, DTLocalBeanCalOpsEval.class, codegenClassScope).addParam(EventBean.class, "target"); methodNode.getBlock().declareVar(forge.getterReturnType, "timestamp", CodegenLegoCast.castSafeFromObjectType(forge.getterReturnType, forge.getter.eventBeanGetCodegen(ref("target"), methodNode, codegenClassScope))); if (!forge.getterReturnType.isPrimitive()) { methodNode.getBlock().ifRefNullReturnNull("timestamp"); } methodNode.getBlock().methodReturn(forge.inner.codegen(ref("timestamp"), forge.getterReturnType, methodNode, exprSymbol, codegenClassScope)); return localMethod(methodNode, inner); } }
private CodegenExpression codegenEvaluateInternal(CodegenExpression event, CodegenClassScope codegenClassScope, CodegenMethodScope codegenMethodScope) { CodegenMethod method = codegenMethodScope.makeChild(Collection.class, PropertyDotScalarCollection.class, codegenClassScope).addParam(EventBean.class, "event").getBlock() .methodReturn(CodegenLegoCast.castSafeFromObjectType(Collection.class, getter.eventBeanGetCodegen(ref("event"), codegenMethodScope, codegenClassScope))); return localMethodBuild(method).pass(event).call(); } }
public CodegenExpression makeCodegen(CodegenClassScope classScope, CodegenMethodScope parent) { CodegenMethod method = parent.makeChild(Object.class, this.getClass(), classScope).addParam(GET_FILTER_VALUE_FP); method.getBlock() .declareVar(EventBean.class, "props", exprDotMethod(REF_EXPREVALCONTEXT, "getContextProperties")) .ifRefNullReturnNull(ref("props")) .declareVar(Object.class, "result", getter.eventBeanGetCodegen(ref("props"), method, classScope)) .ifRefNullReturnNull("result") .methodReturn(exprDotMethod(cast(Number.class, ref("result")), "doubleValue")); return localMethod(method, GET_FILTER_VALUE_REFS); }
public static CodegenExpression codegen(DTLocalBeanIntervalNoEndTSForge forge, CodegenExpression inner, Class innerType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(forge.returnType, DTLocalBeanIntervalNoEndTSEval.class, codegenClassScope).addParam(EventBean.class, "target"); methodNode.getBlock() .declareVar(forge.getterResultType, "timestamp", CodegenLegoCast.castSafeFromObjectType(forge.getterResultType, forge.getter.eventBeanGetCodegen(ref("target"), methodNode, codegenClassScope))) .ifRefNullReturnNull("timestamp") .methodReturn(forge.inner.codegen(ref("timestamp"), forge.getterResultType, methodNode, exprSymbol, codegenClassScope)); return localMethod(methodNode, inner); } }
public CodegenExpression evaluateCodegen(Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(getterReturnTypeBoxed, ExprEvaluatorStreamDTProp.class, codegenClassScope); CodegenExpressionRef refEPS = exprSymbol.getAddEPS(methodNode); methodNode.getBlock() .declareVar(EventBean.class, "event", arrayAtIndex(refEPS, constant(streamId))) .ifRefNullReturnNull("event") .methodReturn(CodegenLegoCast.castSafeFromObjectType(getterReturnTypeBoxed, getter.eventBeanGetCodegen(ref("event"), methodNode, codegenClassScope))); return localMethod(methodNode); }
public CodegenExpression evaluateCodegenUninstrumented(Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(getEvaluationType(), ExprContextPropertyNodeImpl.class, codegenClassScope); CodegenExpressionRef refExprEvalCtx = exprSymbol.getAddExprEvalCtx(methodNode); CodegenBlock block = methodNode.getBlock() .declareVar(EventBean.class, "props", exprDotMethod(refExprEvalCtx, "getContextProperties")) .ifRefNullReturnNull("props"); block.methodReturn(CodegenLegoCast.castSafeFromObjectType(returnType, getter.eventBeanGetCodegen(ref("props"), methodNode, codegenClassScope))); return localMethod(methodNode); }
public CodegenExpression evaluateCodegen(Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(returnType, ExprEvalByGetter.class, codegenClassScope); CodegenExpressionRef refEPS = exprSymbol.getAddEPS(methodNode); methodNode.getBlock() .declareVar(EventBean.class, "event", arrayAtIndex(refEPS, constant(streamNum))) .ifRefNullReturnNull("event") .methodReturn(CodegenLegoCast.castSafeFromObjectType(returnType, getter.eventBeanGetCodegen(ref("event"), methodNode, codegenClassScope))); return localMethod(methodNode); }
public CodegenExpression evaluateCodegen(Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(Object.class, ExprForgeStreamWithGetter.class, codegenClassScope); CodegenExpressionRef refEPS = exprSymbol.getAddEPS(methodNode); methodNode.getBlock() .declareVar(EventBean.class, "theEvent", arrayAtIndex(refEPS, constant(0))) .ifRefNotNull("theEvent") .blockReturn(getter.eventBeanGetCodegen(ref("theEvent"), methodNode, codegenClassScope)) .methodReturn(constantNull()); return localMethod(methodNode); }
public static CodegenMethod getArrayPropertyValueCodegen(CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope, int index, EventPropertyGetterSPI nestedGetter) { return codegenMethodScope.makeChild(Object.class, BaseNestableEventUtil.class, codegenClassScope).addParam(EventBean[].class, "wrapper").getBlock() .ifRefNullReturnNull("wrapper") .ifConditionReturnConst(relational(arrayLength(ref("wrapper")), LE, constant(index)), null) .declareVar(EventBean.class, "inner", arrayAtIndex(ref("wrapper"), constant(index))) .methodReturn(nestedGetter.eventBeanGetCodegen(ref("inner"), codegenMethodScope, codegenClassScope)); }
public CodegenExpression makeCodegen(CodegenClassScope classScope, CodegenMethodScope parent) { CodegenMethod method = parent.makeChild(Object.class, this.getClass(), classScope).addParam(GET_FILTER_VALUE_FP); CodegenExpression get = exprIdentNodeEvaluator.getGetter().eventBeanGetCodegen(ref("event"), method, classScope); method.getBlock() .declareVar(EventBean.class, "event", exprDotMethod(ref("matchedEvents"), "getMatchingEventByTag", constant(resultEventAsName))) .ifRefNull(ref("event")).blockThrow(newInstance(IllegalStateException.class, constant("Matching event named '" + resultEventAsName + "' not found in event result set"))) .declareVar(Number.class, "value", cast(Number.class, get)) .ifRefNull("value").blockReturn(constantNull()) .methodReturn(exprDotMethod(ref("value"), "doubleValue")); return localMethod(method, GET_FILTER_VALUE_REFS); }
public CodegenExpression evaluateCodegen(Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) { CodegenMethod methodNode = codegenMethodScope.makeChild(Long.class, ExprEvaluatorStreamDTPropFragment.class, codegenClassScope); CodegenExpressionRef refEPS = exprSymbol.getAddEPS(methodNode); methodNode.getBlock() .declareVar(EventBean.class, "theEvent", arrayAtIndex(refEPS, constant(streamId))) .ifRefNullReturnNull("theEvent") .declareVar(Object.class, "event", getterFragment.eventBeanFragmentCodegen(ref("theEvent"), methodNode, codegenClassScope)) .ifCondition(not(instanceOf(ref("event"), EventBean.class))) .blockReturn(constantNull()) .methodReturn(CodegenLegoCast.castSafeFromObjectType(Long.class, getterTimestamp.eventBeanGetCodegen(cast(EventBean.class, ref("event")), methodNode, codegenClassScope))); return localMethod(methodNode); }