private void extractMetadata(GraphRewrite event, JavaTypeReferenceModel typeReference) { JavaClassService javaClassService = new JavaClassService(event.getGraphContext()); JavaClassModel implementationClass = getJavaClass(typeReference); // first, find out if it implements an interface. // TODO: handle the interface only case, where clients exist but no implementation if (!implementationClass.getInterfaces().iterator().hasNext()) { return; } LOG.info("Processing: " + typeReference); typeReference.getFile().setGenerateSourceReport(true); JavaAnnotationTypeReferenceModel jaxWsAnnotationTypeReference = (JavaAnnotationTypeReferenceModel) typeReference; String endpointInterfaceQualifiedName = getAnnotationLiteralValue(jaxWsAnnotationTypeReference, "endpointInterface"); JavaClassModel endpointInterface = null; if (StringUtils.isNotBlank(endpointInterfaceQualifiedName)) { endpointInterface = javaClassService.getOrCreatePhantom(endpointInterfaceQualifiedName); for (AbstractJavaSourceModel source : javaClassService.getJavaSource(endpointInterface.getQualifiedName())) source.setGenerateSourceReport(true); } JaxWSWebServiceModelService service = new JaxWSWebServiceModelService(event.getGraphContext()); service.getOrCreate(typeReference.getFile().getApplication(), endpointInterface, implementationClass); }
private void extractMetadata(GraphRewrite event, JavaTypeReferenceModel typeReference) { JavaClassService javaClassService = new JavaClassService(event.getGraphContext()); JavaClassModel implementationClass = getJavaClass(typeReference); // first, find out if it implements an interface. // TODO: handle the interface only case, where clients exist but no implementation if (!implementationClass.getInterfaces().iterator().hasNext()) { return; } LOG.info("Processing: " + typeReference); typeReference.getFile().setGenerateSourceReport(true); JavaAnnotationTypeReferenceModel jaxWsAnnotationTypeReference = (JavaAnnotationTypeReferenceModel) typeReference; String endpointInterfaceQualifiedName = getAnnotationLiteralValue(jaxWsAnnotationTypeReference, "endpointInterface"); JavaClassModel endpointInterface = null; if (StringUtils.isNotBlank(endpointInterfaceQualifiedName)) { endpointInterface = javaClassService.getOrCreatePhantom(endpointInterfaceQualifiedName); for (AbstractJavaSourceModel source : javaClassService.getJavaSource(endpointInterface.getQualifiedName())) source.setGenerateSourceReport(true); } JaxWSWebServiceModelService service = new JaxWSWebServiceModelService(event.getGraphContext()); service.getOrCreate(typeReference.getFile().getApplication(), endpointInterface, implementationClass); }