@Override public void completeItemController(JavaType itemController, JpaEntityMetadata entityMetadata, ClassOrInterfaceTypeDetails serviceDetails, ClassOrInterfaceTypeDetailsBuilder cidBuilder) { JavaType concurrencyManagerType = new JavaType(SpringletsJavaType.SPRINGLETS_CONCURRENCY_MANAGER.getFullyQualifiedTypeName(), 0, DataType.TYPE, null, Arrays.asList(entityMetadata.getDestination())); cidBuilder.addImplementsType(concurrencyManagerType); }; }
/** * This method adds new WebMVCThymeleafUIConfiguration.java class inside .config * package of generated project * * @param module */ private void addWebMVCThymeleafUIConfiguration(Pom module) { // Obtain the class annotated with @RooWebMvcConfiguration Set<ClassOrInterfaceTypeDetails> webMvcConfigurationSet = getTypeLocationService().findClassesOrInterfaceDetailsWithAnnotation( RooJavaType.ROO_WEB_MVC_CONFIGURATION); if (webMvcConfigurationSet == null || webMvcConfigurationSet.isEmpty()) { throw new IllegalStateException(String.format( "ERROR: Can't found configuration class annotated with @%s.", RooJavaType.ROO_WEB_MVC_CONFIGURATION)); } ClassOrInterfaceTypeDetails webMvcConfiguration = webMvcConfigurationSet.iterator().next(); // Prevent to include the @RooWebMvcThymeleafUIConfiguration more than once if (webMvcConfiguration.getAnnotation(RooJavaType.ROO_WEB_MVC_THYMELEAF_UI_CONFIGURATION) == null) { AnnotationMetadataBuilder thymeleaftConfigurationAnnotation = new AnnotationMetadataBuilder(RooJavaType.ROO_WEB_MVC_THYMELEAF_UI_CONFIGURATION); ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(webMvcConfiguration);; cidBuilder.addAnnotation(thymeleaftConfigurationAnnotation); cidBuilder.addImplementsType(SpringJavaType.APPLICATION_CONTEXT_AWARE); getTypeManagementService().createOrUpdateTypeOnDisk(cidBuilder.build()); } }
detailsBuilder.addImplementsType(relatedRepositoryCustom); pushedElements.add(relatedRepositoryCustom);
for (JavaType implementsType : allImplementsTypes) { if (!detailsBuilder.getImplementsTypes().contains(implementsType)) { detailsBuilder.addImplementsType(implementsType);
cidBuilderEndpoint.addImplementsType(sei);
implTypeBuilder.addImplementsType(interfaceType);
@Override public void completeItemController(JavaType itemController, JpaEntityMetadata entityMetadata, ClassOrInterfaceTypeDetails serviceDetails, ClassOrInterfaceTypeDetailsBuilder cidBuilder) { JavaType concurrencyManagerType = new JavaType(SpringletsJavaType.SPRINGLETS_CONCURRENCY_MANAGER.getFullyQualifiedTypeName(), 0, DataType.TYPE, null, Arrays.asList(entityMetadata.getDestination())); cidBuilder.addImplementsType(concurrencyManagerType); }; }
JavaParserUtils .getJavaTypeNow(compilationUnitServices, candidate, typeParameterNames); cidBuilder.addImplementsType(javaType);
/** * This method adds new WebMVCThymeleafUIConfiguration.java class inside .config * package of generated project * * @param module */ private void addWebMVCThymeleafUIConfiguration(Pom module) { // Obtain the class annotated with @RooWebMvcConfiguration Set<ClassOrInterfaceTypeDetails> webMvcConfigurationSet = getTypeLocationService().findClassesOrInterfaceDetailsWithAnnotation( RooJavaType.ROO_WEB_MVC_CONFIGURATION); if (webMvcConfigurationSet == null || webMvcConfigurationSet.isEmpty()) { throw new IllegalStateException(String.format( "ERROR: Can't found configuration class annotated with @%s.", RooJavaType.ROO_WEB_MVC_CONFIGURATION)); } ClassOrInterfaceTypeDetails webMvcConfiguration = webMvcConfigurationSet.iterator().next(); // Prevent to include the @RooWebMvcThymeleafUIConfiguration more than once if (webMvcConfiguration.getAnnotation(RooJavaType.ROO_WEB_MVC_THYMELEAF_UI_CONFIGURATION) == null) { AnnotationMetadataBuilder thymeleaftConfigurationAnnotation = new AnnotationMetadataBuilder(RooJavaType.ROO_WEB_MVC_THYMELEAF_UI_CONFIGURATION); ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(webMvcConfiguration);; cidBuilder.addAnnotation(thymeleaftConfigurationAnnotation); cidBuilder.addImplementsType(SpringJavaType.APPLICATION_CONTEXT_AWARE); getTypeManagementService().createOrUpdateTypeOnDisk(cidBuilder.build()); } }
private ClassOrInterfaceTypeDetails getRevisionListener() { // Check class exists ClassOrInterfaceTypeDetails innerClass = governorTypeDetails .getDeclaredInnerType(revisionListenerType); if (innerClass != null) { // If class exists (already push-in) we can do nothing return innerClass; } // Create inner class ClassOrInterfaceTypeDetailsBuilder classBuilder = new ClassOrInterfaceTypeDetailsBuilder( context.getMetadataId(), Modifier.PUBLIC + Modifier.STATIC, revisionListenerType, PhysicalTypeCategory.CLASS); classBuilder.addImplementsType(REVISION_LISTENER); classBuilder.addMethod(getNewRevisionMethod()); return classBuilder.build(); }
classOrInterfaceTypeDetails.addImplementsType(declaredClass);