protected TypesFactory getTypesFactory() { return getOwner().getServices().getTypesFactory(); }
/** Create an annotation with classes as values. * * @param type the type of the annotation. * @param values the values. * @return the reference to the JVM annotation. */ private JvmAnnotationReference annotationClassRef(Class<? extends Annotation> type, List<? extends JvmTypeReference> values) { try { final JvmAnnotationReference annot = this._annotationTypesBuilder.annotationRef(type); final JvmTypeAnnotationValue annotationValue = this.services.getTypesFactory().createJvmTypeAnnotationValue(); for (final JvmTypeReference value : values) { annotationValue.getValues().add(this.typeBuilder.cloneWithProxies(value)); } annot.getExplicitValues().add(annotationValue); return annot; } catch (IllegalArgumentException exception) { // ignore } return null; }
final JvmStringAnnotationValue annotationValue = this.services.getTypesFactory() .createJvmStringAnnotationValue(); annotationValue.getValues().add(inlineExpression); final JvmTypeAnnotationValue annotationImportedType = this.services.getTypesFactory() .createJvmTypeAnnotationValue(); annotationImportedType.getValues().add(this.typeBuilder.cloneWithProxies(type)); final JvmBooleanAnnotationValue annotationConstant = this.services.getTypesFactory() .createJvmBooleanAnnotationValue(); annotationConstant.getValues().add(Boolean.valueOf(isConstantExpression)); final JvmBooleanAnnotationValue annotationStatement = this.services.getTypesFactory() .createJvmBooleanAnnotationValue(); annotationStatement.getValues().add(Boolean.valueOf(isStatementExpression));