Validates a List of MappedClasses

@param classes the MappedClasses to validate
@param mapper the Mapper to use for validation
181740
public void validate(final Mapper mapper, final List<MappedClass> classes) {
        final Set<ConstraintViolation> ve = new TreeSet<ConstraintViolation>(new Comparator<ConstraintViolation>() {

            @Override
            public int compare(final ConstraintViolation o1, final ConstraintViolation o2) {
                return o1.getLevel().ordinal() > o2.getLevel().ordinal() ? -1 : 1;
            }
        });

        final List<ClassConstraint> rules = getConstraints();
        for (final MappedClass c : classes) {
            for (final ClassConstraint v : rules) {
                v.check(mapper, c, ve);
            }
        }

        if (!ve.isEmpty()) {
            final ConstraintViolation worst = ve.iterator().next();
            final Level maxLevel = worst.getLevel();
            if (maxLevel.ordinal() >= Level.FATAL.ordinal()) {
                throw new ConstraintViolationException(ve);
            }

            // sort by class to make it more readable
            final List<LogLine> l = new ArrayList<LogLine>();
            for (final ConstraintViolation v : ve) {
                l.add(new LogLine(v));
            }
            sort(l);

            for (final LogLine line : l) {
                line.log(LOG);
            }
        }
    }
1196039
public static void classNotMapped(Object sourceClass, Class<?> configuredClass){
		String sourceName = sourceClass instanceof Class?((Class<?>)sourceClass).getSimpleName():sourceClass.getClass().getSimpleName();
		throw new ClassNotMappedException(MSG.INSTANCE.message(classNotMappedException2,sourceName, configuredClass.getSimpleName()));
	}
763460
protected void discover(final Mapper mapper) {
        for (final Class<? extends Annotation> c : INTERESTING_ANNOTATIONS) {
            addAnnotation(c);
        }

        Class<?> superclass = clazz.getSuperclass();
        if (superclass != null && !superclass.equals(Object.class)) {
            superClass = mapper.getMappedClass(superclass);
        }
        for (Class<?> aClass : clazz.getInterfaces()) {
            interfaces.add(mapper.getMappedClass(aClass));
        }

        final List<Class<?>> lifecycleClasses = new ArrayList<Class<?>>();
        lifecycleClasses.add(clazz);

        final EntityListeners entityLisAnn = (EntityListeners) getAnnotation(EntityListeners.class);
        if (entityLisAnn != null && entityLisAnn.value().length != 0) {
            Collections.addAll(lifecycleClasses, entityLisAnn.value());
        }

        for (final Class<?> cls : lifecycleClasses) {
            for (final Method m : ReflectionUtils.getDeclaredAndInheritedMethods(cls)) {
                for (final Class<? extends Annotation> c : LIFECYCLE_ANNOTATIONS) {
                    if (m.isAnnotationPresent(c)) {
                        addLifecycleEventMethod(c, m, cls.equals(clazz) ? null : cls);
                    }
                }
            }
        }

        update();

        for (final java.lang.reflect.Field field : ReflectionUtils.getDeclaredAndInheritedFields(clazz, true)) {
            field.setAccessible(true);
            final int fieldMods = field.getModifiers();
            if (!isIgnorable(field, fieldMods, mapper)) {
                if (field.isAnnotationPresent(Id.class)) {
                    persistenceFields.add(new MappedField(field, clazz, mapper));
                    update();
                } else if (field.isAnnotationPresent(Property.class)
                           || field.isAnnotationPresent(Reference.class)
                           || field.isAnnotationPresent(Embedded.class)
                           || field.isAnnotationPresent(Serialized.class)
                           || isSupportedType(field.getType())
                           || ReflectionUtils.implementsInterface(field.getType(), Serializable.class)) {
                    persistenceFields.add(new MappedField(field, clazz, mapper));
                } else {
                    if (mapper.getOptions().getDefaultMapper() != null) {
                        persistenceFields.add(new MappedField(field, clazz, mapper));
                    } else if (LOG.isWarnEnabled()) {
                        LOG.warn(format("Ignoring (will not persist) field: %s.%s [type:%s]", clazz.getName(), field.getName(),
                                           field.getType().getName()));
                    }
                }
            }
        }
    }
431429
public void validate(final Object record, final CsvBindingErrors bindingErrors, 
            final ValidationContext<Object> validationContext, final Class<?>... groups) {
        Objects.requireNonNull(record);
        Objects.requireNonNull(bindingErrors);
        Objects.requireNonNull(validationContext);
        
        processConstraintViolation(getTargetValidator().validate(record, groups), bindingErrors, validationContext);
    }
1284931
@SafeVarargs
    public final void setValidators(@NonNull final Validator<Type>... validators) {
        Condition.INSTANCE.ensureNotNull(validators, "The validators may not be null");
        Condition.INSTANCE.ensureAtLeast(validators.length, 1, "The validators may not be empty");
        this.validators = validators;
    }
399740
public <T> void addMapper(Class<T> clazz, StringMapper<T> mapper) {
		addParser(clazz, mapper);
		mappers.put(clazz, mapper);
	}
899991
private void initializeMapper() {
    if (itemClass == null) {
      itemMapper = CatchAllMapper.getInstance();
    } else {
      try {
        itemMapper = MapperFactory.getInstance().getMapper(itemClass);
      } catch (NoSuitableMapperException exp) {
        itemMapper = CatchAllMapper.getInstance();
      }
    }
  }
548752
public static <S, D> List<D> mapList(Iterable<S> sourceList, Class<D> destinationClass) {
		List<D> destinationList = new ArrayList<D>();
		for (S source : sourceList) {
			if (source != null) {
				destinationList.add(mapper.map(source, destinationClass));
			}
		}
		return destinationList;
	}
734024
@SuppressWarnings({ "rawtypes" })
    private <T> List<ValidationCaller> findMethods(Class<T> annotated) {
        ResolvedTypeWithMembers annotatedType = memberResolver.resolve(typeResolver.resolve(annotated), annotationConfiguration, null);
        final List<ValidationCaller> callers = Arrays.stream(annotatedType.getMemberMethods())
            .filter(this::isValidationMethod)
            .filter(this::isMethodCorrect)
            .map(m -> new ProxyValidationCaller<>(annotated, m))
            .collect(Collectors.toList());
        if (callers.isEmpty()) {
            log.warn("The class {} is annotated with @SelfValidating but contains no valid methods that are annotated " +
                "with @SelfValidation", annotated);
        }
        return callers;
    }
775584
def validate(cls, mapper_spec):
    
    if mapper_spec.output_writer_class() != cls:
      raise errors.BadWriterParamsError("Output writer class mismatch")
    params = output_writers._get_params(mapper_spec)
    # Bucket Name is required
    if cls.BUCKET_NAME_PARAM not in params:
      raise errors.BadWriterParamsError(
          "%s is required for the _HashingGCSOutputWriter" %
          cls.BUCKET_NAME_PARAM)
859802
public static List<Map<String, Object>> listify(ObjectMapper mapper, Object source) {
        return (List<Map<String, Object>>) collectify(mapper, source, List.class);
    }
627955
private <X> void validate(Class<X> clazz, boolean isEmbeddable)
    {
        final String mappedSuperClazzErrMsg = "Class:" + clazz
                + "is annotated with @MappedSuperClass and @Entity not allowed";
        final String embeddableClazzErrMsg = "Class:" + clazz + "is annotated with @Embeddable and @Entity not allowed";
        if (clazz.isAnnotationPresent(Entity.class))
        {
            throw new MetamodelLoaderException(isEmbeddable ? embeddableClazzErrMsg : mappedSuperClazzErrMsg);
        }
    }
1283177
protected function validateIdentifier(ClassMetadata $class) : void
    {
        if (! $class->identifier && ! $class->isMappedSuperclass && ! $class->isEmbeddedDocument && ! $class->isQueryResultDocument) {
            throw MappingException::identifierRequired($class->name);
        }
    }
1368410
public void setMapperClass(Class<? extends Mapper> cls
                             ) throws IllegalStateException {
    ensureState(JobState.DEFINE);
    conf.setClass(MAP_CLASS_ATTR, cls, Mapper.class);
  }
1142785
public void setObjectClasses(List<String> objectClasses) {
        int size = objectClasses.size();
        iObjectClasses = new ArrayList<String>(objectClasses.size());
        for (int i = 0; i < size; i++) {
            String objectClass = objectClasses.get(i).toLowerCase();
            if (!iObjectClasses.contains(objectClass)) {
                iObjectClasses.add(objectClass);
            }
        }
    }
879203
public <T> void beanClass(Class<T> beanClass)
  {
    validateBeanClass(beanClass);
    
    if (Modifier.isAbstract(beanClass.getModifiers())
        && ! abstractMethods(beanClass)) {
      throw error(L.l("abstract bean class '{0}' is invalid because the abstract methods can't be generated.",
                      beanClass.getSimpleName()));
    }
  }
1332234
public void assignMappedSuperClass(Map<Class<?>, ManagedType<?>> mappedSuperClass)
    {
        if (this.mappedSuperClassTypes == null)
        {
            this.mappedSuperClassTypes = mappedSuperClass;
        }
        else
        {
            this.mappedSuperClassTypes.putAll(mappedSuperClassTypes);
        }
    }