public final JExpression cand(JExpression right) { return JOp.cand(this, right); }
public final JExpression cand(JExpression right) { return JOp.cand(this, right); }
public final JExpression cand(JExpression right) { return JOp.cand(this, right); }
public final JExpression cand(JExpression right) { return JOp.cand(this, right); }
public final JExpression cand(JExpression right) { return JOp.cand(this, right); }
public Object onSequence(final SequenceExp exp) { final JExpression left = (JExpression) exp.exp1.visit(this); final JExpression right = (JExpression) exp.exp2.visit(this); if (left == JExpr.TRUE) { if (right == JExpr.TRUE) { return JExpr.TRUE; } else { return right; } } else if (right == JExpr.TRUE) { return left; } else { return JOp.cand(left, right); } }
@Override public JExpression unwrapCondifiton(JExpression source) { final CReferencePropertyInfo core = (CReferencePropertyInfo) this.core; JExpression predicate = null; if (core.getElements().isEmpty()) { predicate = null; } else { for (CElement element : core.getElements()) { if (element instanceof CElementInfo) { CElementInfo elementinfo = (CElementInfo) element; final SingleWrappingReferenceElementInfoField field = new SingleWrappingReferenceElementInfoField( outline, prop, core, elementinfo); final JExpression condition = field .unwrapCondifiton(source); predicate = (predicate == null) ? condition : JOp.cor( predicate, condition); } else { // TODO Other cases currently not supported. } } } final JExpression isElement = codeModel.ref(JAXBContextUtils.class) .staticInvoke("isElement").arg(contextPath).arg(source); return predicate == null ? isElement : JOp.cand(JOp.not(predicate), isElement); }
@Override public JExpression unwrapCondifiton(JExpression source) { final CReferencePropertyInfo core = (CReferencePropertyInfo) this.core; JExpression predicate = null; if (core.getElements().isEmpty()) { predicate = null; } else { for (CElement element : core.getElements()) { if (element instanceof CElementInfo) { CElementInfo elementinfo = (CElementInfo) element; final SingleWrappingReferenceElementInfoField field = new SingleWrappingReferenceElementInfoField( outline, prop, core, elementinfo); final JExpression condition = field .unwrapCondifiton(source); predicate = (predicate == null) ? condition : JOp.cor( predicate, condition); } else { // TODO Other cases currently not supported. } } } final JExpression isElement = codeModel.ref(JAXBContextUtils.class) .staticInvoke("isElement").arg(contextPath).arg(source); return predicate == null ? isElement : JOp.cand(JOp.not(predicate), isElement); }
delegating.body()._if(JOp.cand( JOp.not($Caller.staticInvoke("isAsynchronous").tap(inv -> { inv.arg(delegatingParams.get(0));
private void createEqualsMethod(final JDefinedClass implClass, final List<JFieldVar> fields, final boolean isSuperClass) { final JMethod method = implClass.method(JMod.PUBLIC, implClass.owner().BOOLEAN, OPERATION_EQUALS); method.annotate(Override.class); final JVar vObj = method.param(Object.class, OBJ); final JConditional condMe = method.body()._if(JExpr._this().eq(vObj)); condMe._then()._return(JExpr.TRUE); final JConditional condNull = method.body()._if(vObj.eq(JExpr._null())); condNull._then()._return(JExpr.FALSE); if (isSuperClass) { final JConditional condSuper = method.body()._if(JExpr._super().invoke(OPERATION_EQUALS).arg(vObj).eq(JExpr.FALSE)); condSuper._then()._return(JExpr.FALSE); } final JVar vOther = method.body().decl(JMod.FINAL, implClass, OTHER, JExpr.cast(implClass, vObj)); final JClass objectsClass = implClass.owner().ref(Objects.class); final List<JFieldVar> clonedList = new ArrayList<JFieldVar>(fields.size()); clonedList.addAll(fields); final JFieldVar first = clonedList.remove(IDX_TO_REMOVE); final JBlock block = new JBlock(); JExpression invocation = block.staticInvoke(objectsClass, OPERATION_EQUALS).arg(JExpr.ref(first.name())).arg(vOther.ref(first.name())); for (final JFieldVar jFieldVar : clonedList) { invocation = JOp.cand(invocation, block.staticInvoke(objectsClass, OPERATION_EQUALS).arg(JExpr.ref(jFieldVar.name())).arg(vOther.ref(jFieldVar.name()))); } method.body()._return(invocation); }
} else if (value.type() == codeModel.ref(Calendar.class)) { final JConditional ifValuesNotEqual = block._if(JOp.not(JOp.cor(JOp .eq(value, targetValue), JOp.cand(JOp.ne(value, JExpr._null()), final JConditional ifValuesNotEqual = block._if(JOp.not(JOp.cor( JOp.eq(value, targetValue), JOp.cand(JOp.ne(value, JExpr._null()), final JConditional ifValuesNotEqual = block._if(JOp.not(JOp.cor( JOp.eq(value, targetValue), JOp.cand(JOp.ne(value, JExpr._null()), value.invoke("equals").arg(targetValue))))); ifValuesNotEqual._then()._return(JExpr.FALSE);
final JVar rightSet = block.decl(codeModel.BOOLEAN, "rightSet", target.invoke(isSetter)); final JConditional _if0 = block._if(JOp.cand(leftSet, rightSet)); eBlock = _if0._then();
rightParent.invoke(isSetter)); final JConditional _ifBothSet = block._if(JOp.cand(leftSet, rightSet));
JOp.cand(leftObject._instanceof(theClass), rightObject ._instanceof(theClass)))._then();
if (maxCount !=null) { String value = maxCount==1 ? " value" : " values"; block._if(JOp.cand(localVar.ne(JExpr._null()), JOp.gt(localVar.invoke("size"), JExpr.lit(maxCount)))) ._then()._throw( JExpr._new(dataWriter.getValidationExceptionClass()).arg(