• 大小: 18.17MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-13
  • 语言: 其他
  • 标签: hibernate  validator  

资源简介

JSR303 hibernate-validator-5.1.0.zip 进行数据格式;数据校验

资源截图

代码片段和文件信息

/*
* JBoss Home of Professional Open Source
* Copyright 2009 Red Hat Middleware LLC and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.validator.ap;

import java.util.List;
import java.util.Set;

import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.util.ElementKindVisitor6;
import javax.tools.Diagnostic.Kind;

import org.hibernate.validator.ap.checks.ConstraintCheckError;
import org.hibernate.validator.ap.checks.ConstraintCheckFactory;
import org.hibernate.validator.ap.checks.ConstraintChecks;
import org.hibernate.validator.ap.util.AnnotationApiHelper;
import org.hibernate.validator.ap.util.Configuration;
import org.hibernate.validator.ap.util.ConstraintHelper;
import org.hibernate.validator.ap.util.MessagerAdapter;

/**
 * An {@link javax.lang.model.element.ElementVisitor} that visits annotated elements (type declarations
 * methods and fields) and applies different {@link org.hibernate.validator.ap.checks.ConstraintCheck}s to them.
 * Each {@link ConstraintCheckError} occurred will be reported using the
 * {@link javax.annotation.processing.Messager} API.
 *
 * @author Gunnar Morling
 */
final class ConstraintAnnotationVisitor extends ElementKindVisitor6> {

private final MessagerAdapter messager;

private final ConstraintCheckFactory constraintCheckFactory;

private final boolean verbose;

public ConstraintAnnotationVisitor(
ProcessingEnvironment processingEnvironment MessagerAdapter messager Configuration configuration) {

this.messager = messager;
this.verbose = configuration.isVerbose();

AnnotationApiHelper annotationApiHelper = new AnnotationApiHelper(
processingEnvironment.getElementUtils() processingEnvironment.getTypeUtils()
);

ConstraintHelper constraintHelper = new ConstraintHelper(
processingEnvironment.getTypeUtils() annotationApiHelper
);

constraintCheckFactory = new ConstraintCheckFactory(
processingEnvironment.getTypeUtils()
constraintHelper
annotationApiHelper
configuration.methodConstraintsSupported()
);
}

/**
 * 


 * Checks whethe


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-20 15:40  hibernate-validator-5.1.2\
     文件       51835  2014-03-02 19:45  hibernate-validator-5.1.2\changelog.txt
     文件         446  2014-03-02 19:45  hibernate-validator-5.1.2\copyright.txt
     目录           0  2018-04-20 15:40  hibernate-validator-5.1.2\dist\
     文件      622634  2014-03-02 19:46  hibernate-validator-5.1.2\dist\hibernate-validator-5.1.0.Final.jar
     文件       64359  2014-03-02 19:50  hibernate-validator-5.1.2\dist\hibernate-validator-annotation-processor-5.1.0.Final.jar
     文件       32784  2014-03-02 19:48  hibernate-validator-5.1.2\dist\hibernate-validator-cdi-5.1.0.Final.jar
     目录           0  2018-04-20 15:40  hibernate-validator-5.1.2\dist\lib\
     目录           0  2018-04-20 15:40  hibernate-validator-5.1.2\dist\lib\optional\
     文件      113371  2013-10-01 09:37  hibernate-validator-5.1.2\dist\lib\optional\hibernate-jpa-2.1-api-1.0.0.Final.jar
     文件      570478  2013-02-11 11:00  hibernate-validator-5.1.2\dist\lib\optional\joda-time-2.1.jar
     文件      278273  2013-02-19 10:28  hibernate-validator-5.1.2\dist\lib\optional\jsoup-1.7.1.jar
     文件      489884  2013-02-11 11:01  hibernate-validator-5.1.2\dist\lib\optional\log4j-1.2.17.jar
     文件       30716  2013-08-01 12:52  hibernate-validator-5.1.2\dist\lib\optional\paranamer-2.5.5.jar
     目录           0  2018-04-20 15:40  hibernate-validator-5.1.2\dist\lib\required\
     文件       60282  2013-11-28 20:58  hibernate-validator-5.1.2\dist\lib\required\classmate-1.0.0.jar
     文件      117583  2012-12-14 15:18  hibernate-validator-5.1.2\dist\lib\required\javax.el-2.2.4.jar
     文件       38863  2012-12-14 15:18  hibernate-validator-5.1.2\dist\lib\required\javax.el-api-2.2.4.jar
     文件       57183  2013-04-18 14:35  hibernate-validator-5.1.2\dist\lib\required\jboss-logging-3.1.3.GA.jar
     文件       63777  2013-04-10 20:29  hibernate-validator-5.1.2\dist\lib\required\validation-api-1.1.0.Final.jar
     目录           0  2018-04-20 15:40  hibernate-validator-5.1.2\docs\
     目录           0  2018-04-20 15:40  hibernate-validator-5.1.2\docs\api\
     文件       76300  2014-03-02 19:53  hibernate-validator-5.1.2\docs\api\allclasses-frame.html
     文件       68600  2014-03-02 19:53  hibernate-validator-5.1.2\docs\api\allclasses-noframe.html
     文件       35764  2014-03-02 19:53  hibernate-validator-5.1.2\docs\api\constant-values.html
     文件        5927  2014-03-02 19:53  hibernate-validator-5.1.2\docs\api\deprecated-list.html
     文件        8799  2014-03-02 19:53  hibernate-validator-5.1.2\docs\api\help-doc.html
     文件        2745  2014-03-02 19:53  hibernate-validator-5.1.2\docs\api\index.html
     文件     1323987  2014-03-02 19:53  hibernate-validator-5.1.2\docs\api\index-all.html
     目录           0  2018-04-20 15:40  hibernate-validator-5.1.2\docs\api\org\
     目录           0  2018-04-20 15:40  hibernate-validator-5.1.2\docs\api\org\hibernate\
............此处省略3168个文件信息

评论

共有 条评论