br.com.objectos.code.AnnotationInfoFake Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2014 Objectos, Fábrica de Software LTDA.
*
* 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 br.com.objectos.code;
/**
* @author [email protected] (Marcio Endo)
*/
public class AnnotationInfoFake {
public static final AnnotationInfo RETENTION_RUNTIME = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Retention")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_RETENTION_POLICY_RUNTIME)
.build();
public static final AnnotationInfo RETENTION_SOURCE = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Retention")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_RETENTION_POLICY_SOURCE)
.build();
public static final AnnotationInfo TARGET_ANNOTATION_TYPE = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Target")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_ELEMENT_TYPE_ANNOTATION_TYPE)
.build();
public static final AnnotationInfo TARGET_METHOD = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Target")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_ELEMENT_TYPE_METHOD)
.build();
public static final AnnotationInfo TARGET_PACKAGE = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Target")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_ELEMENT_TYPE_PACKAGE)
.build();
public static final AnnotationInfo TARGET_METHOD_FIELD_ANNOTATION_TYPE_CONSTRUCTOR_PARAMETER = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Target")
.annotationValueInfo(
AnnotationValueInfoFake.VALUE_ELEMENT_TYPE_METHOD_FIELD_ANNOTATION_TYPE_CONSTRUCTOR_PARAMETER)
.build();
public static final AnnotationInfo TARGET_PARAMETER = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Target")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_ELEMENT_TYPE_PARAMETER)
.build();
public static final AnnotationInfo TARGET_TYPE = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Target")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_ELEMENT_TYPE_TYPE)
.build();
public static final AnnotationInfo TARGET_TYPE_METHOD = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Target")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_ELEMENT_TYPE_TYPE_METHOD)
.build();
public static final AnnotationInfo PACKAGE_ANNOTATION = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE_APT)
.name("PackageAnnotation")
.annotationInfo(RETENTION_SOURCE)
.annotationInfo(TARGET_PACKAGE)
.build();
public static final AnnotationInfo DOCUMENTED = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG_ANNOTATION)
.name("Documented")
.build();
//
public static final AnnotationInfo ANNOTATION_ANNOTATION = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE_APT)
.name("AnnotationAnnotation")
.annotationInfo(RETENTION_RUNTIME)
.annotationInfo(TARGET_ANNOTATION_TYPE)
.build();
public static final AnnotationInfo AUTO_FUNCTIONAL = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CORE_AUTO)
.annotationInfo(RETENTION_SOURCE)
.annotationInfo(TARGET_METHOD)
.name("AutoFunctional")
.build();
public static final AnnotationInfo CONSTRAINT = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVAX_VALIDATION)
.name("Constraint")
.annotationValueInfo(AnnotationValueInfoFake.VALIDATED_BY)
.annotationInfo(DOCUMENTED)
.annotationInfo(TARGET_ANNOTATION_TYPE)
.annotationInfo(RETENTION_RUNTIME)
.build();
public static final AnnotationInfo DEPRECATED = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG)
.name("Deprecated")
.build();
public static final AnnotationInfo TESTING = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE)
.name("Testing")
.annotationInfo(RETENTION_SOURCE)
.annotationInfo(TARGET_TYPE_METHOD)
.build();
public static final AnnotationInfo METHOD_ANNOTATION = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE_APT)
.name("MethodAnnotation")
.annotationInfo(RETENTION_SOURCE)
.annotationInfo(TARGET_METHOD)
.annotationInfo(ANNOTATION_ANNOTATION)
.build();
public static final AnnotationInfo NOT_NULL = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVAX_VALIDATION_CONSTRAINTS)
.name("NotNull")
.annotationValueInfo(AnnotationValueInfoFake.MESSAGE_JAVAX_NOT_NULL)
.annotationValueInfo(AnnotationValueInfoFake.GROUPS)
.annotationValueInfo(AnnotationValueInfoFake.PAYLOAD)
.annotationInfo(TARGET_METHOD_FIELD_ANNOTATION_TYPE_CONSTRUCTOR_PARAMETER)
.annotationInfo(RETENTION_RUNTIME)
.annotationInfo(DOCUMENTED)
.annotationInfo(CONSTRAINT)
.build();
public static final AnnotationInfo OVERRIDE = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.JAVA_LANG)
.name("Override")
.build();
public static final AnnotationInfo PARAMETER_ANNOTATION_LEVEL_1 = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE_APT)
.name("ParameterAnnotation")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_LEVEL_1)
.annotationInfo(RETENTION_SOURCE)
.annotationInfo(TARGET_PARAMETER)
.build();
public static final AnnotationInfo PARAMETER_ANNOTATION_LEVEL_2 = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE_APT)
.name("ParameterAnnotation")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_LEVEL_2)
.annotationInfo(RETENTION_SOURCE)
.annotationInfo(TARGET_PARAMETER)
.build();
public static final AnnotationInfo PARAMETER_ANNOTATION_LEVEL_3 = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE_APT)
.name("ParameterAnnotation")
.annotationValueInfo(AnnotationValueInfoFake.VALUE_LEVEL_3)
.annotationInfo(RETENTION_SOURCE)
.annotationInfo(TARGET_PARAMETER)
.build();
public static final AnnotationInfo TYPE_ANNOTATION_ANNOTATED = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE_APT)
.name("TypeAnnotation")
.annotationInfo(RETENTION_SOURCE)
.annotationInfo(TARGET_TYPE)
.annotationValueInfo(AnnotationValueInfoFake.TYPE_INFO_LONG)
.annotationValueInfo(AnnotationValueInfoFake.VALUE_456)
.annotationValueInfo(AnnotationValueInfoFake.STRING_ABC)
.build();
public static final AnnotationInfo TYPE_ANNOTATION = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE_APT)
.name("TypeAnnotation")
.annotationInfo(RETENTION_SOURCE)
.annotationInfo(TARGET_TYPE)
.annotationValueInfo(AnnotationValueInfoFake.STRING_ABC)
.annotationValueInfo(AnnotationValueInfoFake.TYPE_INFO_INTEGER)
.annotationValueInfo(AnnotationValueInfoFake.VALUE_123)
.build();
public static final AnnotationInfo ANNOTATION_ARRAY_LEVEL_1_3 = builder()
.accessInfo(AccessInfo.PUBLIC)
.packageInfo(PackageInfoFake.BR_COM_OBJECTOS_CODE_APT)
.name("AnnotationArray")
.annotationInfo(RETENTION_RUNTIME)
.annotationInfo(TARGET_TYPE)
.annotationValueInfo(arrayAnnotation("value", PARAMETER_ANNOTATION_LEVEL_1, PARAMETER_ANNOTATION_LEVEL_3))
.build();
private AnnotationInfoFake() {
}
private static AnnotationInfoFakeBuilder builder() {
return new AnnotationInfoFakeBuilder();
}
private static AnnotationValueInfo arrayAnnotation(String name, AnnotationInfo... values) {
return new AnnotationValueInfoFakeBuilder()
.name(name)
.arrayAnnotation(values)
.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy