When a pojo has a valid constructor

@param expression
@param entity
490888
public static void assertTrueOfInvalidConstructorProperty(boolean expression, ModelClass<?> entity,
			String fieldName) {
		if (!expression) {
			String msg = String.format(
					"In class '%s' the constructor '%s' parameters has different type than associated property type.",
					entity.getElement().getQualifiedName(), fieldName);
			throw (new InvalidDefinition(msg));
		}

	}
526869
public void visitClassExpression(ClassExpression expression) {
        ClassNode type = expression.getType();
        MethodVisitor mv = controller.getMethodVisitor();
        if (BytecodeHelper.isClassLiteralPossible(type) || BytecodeHelper.isSameCompilationUnit(controller.getClassNode(), type)) {
            if (controller.getClassNode().isInterface()) {
                InterfaceHelperClassNode interfaceClassLoadingClass = controller.getInterfaceClassLoadingClass();
                if (BytecodeHelper.isClassLiteralPossible(interfaceClassLoadingClass)) {
                    BytecodeHelper.visitClassLiteral(mv, interfaceClassLoadingClass);
                    controller.getOperandStack().push(ClassHelper.CLASS_Type);
                    return;
                }
            } else {
                BytecodeHelper.visitClassLiteral(mv, type);
                controller.getOperandStack().push(ClassHelper.CLASS_Type);
                return;
            }
        }
        String staticFieldName = getStaticFieldName(type);
        referencedClasses.put(staticFieldName, type);

        String internalClassName = controller.getInternalClassName();
        if (controller.getClassNode().isInterface()) {
            internalClassName = BytecodeHelper.getClassInternalName(controller.getInterfaceClassLoadingClass());
            mv.visitFieldInsn(GETSTATIC, internalClassName, staticFieldName, "Ljava/lang/Class;");
        } else {
            mv.visitMethodInsn(INVOKESTATIC, internalClassName, "$get$" + staticFieldName, "()Ljava/lang/Class;", false);
        }
        controller.getOperandStack().push(ClassHelper.CLASS_Type);
    }
172748
public ClassBuilder<T> withMethod(Method method, Expression expression) {
		methods.put(method, expression);
		return this;
	}
149315
private void validate(Entity entity) {
    MailSettingsImpl mailSettings = new MailSettingsImpl(entity);
    if (mailSettings.isTestConnection()
        && mailSettings.getUsername() != null
        && mailSettings.getPassword() != null) {
      mailSenderFactory.validateConnection(mailSettings);
    }
  }
267746
private void evaluateExpressions() throws JspException {
        /* 
         * Note: we don't check for type mismatches here; we assume
         * the expression evaluator will return the expected type
         * (by virtue of knowledge we give it about what that type is).
         * A ClassCastException here is truly unexpected, so we let it
         * propagate up.
         */

        url = (String) ExpressionUtil.evalNotNull(
                "redirect", "url", url_, String.class, this, pageContext);
        context = (String) ExpressionUtil.evalNotNull(
                "redirect", "context", context_, String.class, this, pageContext);
    }
696477
public static boolean isSafe(Expression expression) {
        if (expression instanceof MethodCallExpression) {
            return ((MethodCallExpression) expression).isSafe();
        }
        if (expression instanceof PropertyExpression) {
            return ((PropertyExpression) expression).isSafe();
        }
        return false;
    }
40751
public static void assertTrueOfInvalidDefinition(boolean expression, ModelProperty property, String message) {
		if (!expression) {
			String msg = String.format("In class '%s', property '%s' has invalid definition: %s",
					property.getParent().getElement().asType().toString(), property.getName(), message);
			throw (new InvalidDefinition(msg));
		}
	}
893674
public static void fill(Object entity) {
        final Class<?> entityClass = entity.getClass();

        if (N.isEntity(entityClass) == false) {
            throw new IllegalArgumentException(entityClass.getCanonicalName() + " is not a valid entity class with property getter/setter method");
        }

        Type<Object> type = null;
        Class<?> parameterClass = null;
        Object propValue = null;

        for (Method method : ClassUtil.getPropSetMethodList(entityClass).values()) {
            parameterClass = method.getParameterTypes()[0];
            type = N.typeOf(parameterClass);

            if (String.class.equals(parameterClass)) {
                propValue = N.uuid().substring(0, 16);
            } else if (boolean.class.equals(parameterClass) || Boolean.class.equals(parameterClass)) {
                propValue = RAND.nextInt() % 2 == 0 ? false : true;
            } else if (char.class.equals(parameterClass) || Character.class.equals(parameterClass)) {
                propValue = (char) ('a' + RAND.nextInt() % 26);
            } else if (int.class.equals(parameterClass) || Integer.class.equals(parameterClass)) {
                propValue = RAND.nextInt();
            } else if (long.class.equals(parameterClass) || Long.class.equals(parameterClass)) {
                propValue = RAND.nextLong();
            } else if (float.class.equals(parameterClass) || Float.class.equals(parameterClass)) {
                propValue = RAND.nextFloat();
            } else if (double.class.equals(parameterClass) || Double.class.equals(parameterClass)) {
                propValue = RAND.nextDouble();
            } else if (byte.class.equals(parameterClass) || Byte.class.equals(parameterClass)) {
                propValue = Integer.valueOf(RAND.nextInt()).byteValue();
            } else if (short.class.equals(parameterClass) || Short.class.equals(parameterClass)) {
                propValue = Integer.valueOf(RAND.nextInt()).shortValue();
            } else if (Number.class.isAssignableFrom(parameterClass)) {
                propValue = type.valueOf(String.valueOf(RAND.nextInt()));
            } else if (java.util.Date.class.isAssignableFrom(parameterClass) || Calendar.class.isAssignableFrom(parameterClass)) {
                propValue = type.valueOf(String.valueOf(System.currentTimeMillis()));
            } else if (N.isEntity(parameterClass)) {
                propValue = fill(parameterClass);
            } else {
                propValue = type.defaultValue();
            }

            ClassUtil.setPropValue(entity, method, propValue);
        }
    }
440505
public boolean validate(E entity)
    {
        if (entity != null)
        {
            // entity metadata could be null.
            if (entityMetadata == null)
            {
                throw new IllegalArgumentException(
                        "Entity object is invalid, operation failed. Please check previous log message for details");
            }

            return false;

        }

        // will return false if entity is null.
        return true;
    }
215352
private void evaluateExpressions() throws JspException {
        if (valueEL != null) {
            value = (Date) ExpressionEvaluatorManager.evaluate(
                    "value", valueEL, Date.class, this, pageContext);
        }

        if (typeEL != null) {
            type = (String) ExpressionEvaluatorManager.evaluate(
                    "type", typeEL, String.class, this, pageContext);
        }
    }
1174666
@NonNull
    public static SelectResult.As expression(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new SelectResult.As(expression);
    }
548013
public static boolean isConstructorCall(Expression expression, List<String> classNames) {
        return expression instanceof ConstructorCallExpression && classNames.contains(expression.getType().getName());
    }
1152879
public static void validArgument(boolean expression, String message, Object... messageArgs) {
    if (!expression) {
      throw new IllegalArgumentException(format(message, messageArgs));
    }
  }
94623
private static final ExpressionTree parseToTree(String expression) throws InvalidExpressionException {

        ExpressionParser parser = new ExpressionParser();
        parser.parse(expression);

        return new ExpressionTree(parser.getVar(), parser.getTokens());
    }
809374
public static void asserTrueOrForeignKeyNotFound(boolean expression, SQLiteEntity currentEntity, ClassName entity) {
		if (!expression) {

			throw (new ForeignKeyNotFoundException(currentEntity, entity));
		}

	}
467888
public static ExpressionHandler getHandler(Expression expression) {
        ExpressionHandler ret = null;
        Class<? extends ExpressionHandler> cls = handlers.get(expression.getClass());
        if (cls != null) {
            try {
                Constructor<? extends ExpressionHandler> con = cls.getConstructor(Expression.class);
                ret = con.newInstance(expression);
            } catch (Exception e) {
                log.log(Level.SEVERE, "Failed to instantiate handler for expression '" + expression + "'", e);
            }
        }
        return ret;
    }
125457
public FluentValidator when(boolean expression) {
        if (!expression) {
            for (int i = 0; i < lastAddCount; i++) {
                validatorElementList.getList().removeLast();
            }
        }
        return this;
    }