private void extractMetadata(GraphRewrite event, JavaTypeReferenceModel typeReference) { typeReference.getFile().setGenerateSourceReport(true); JavaAnnotationTypeReferenceModel jaxRSAnnotationTypeReference = (JavaAnnotationTypeReferenceModel) typeReference; String path = getAnnotationLiteralValue(jaxRSAnnotationTypeReference, "value"); JavaClassModel implementationClass = getJavaClass(typeReference); JaxRSWebServiceModelService service = new JaxRSWebServiceModelService(event.getGraphContext()); service.getOrCreate(typeReference.getFile().getApplication(), path, implementationClass); }
if (implementationClass == null) pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(); pipeline.has(WindupVertexFrame.TYPE_PROP, JaxRSWebServiceModel.TYPE); pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(implementationClass.getElement()); pipeline.out(JaxRSWebServiceModel.JAXRS_IMPLEMENTATION_CLASS); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(JaxRSWebServiceModel.TYPE)); JaxRSWebServiceModel result = frame(pipeline.next()); if (!result.isAssociatedWithApplication(application)) result.addApplication(application); JaxRSWebServiceModel jaxWebService = create(); jaxWebService.addApplication(application); jaxWebService.setPath(path);
if (implementationClass == null) pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(); pipeline.has(WindupVertexFrame.TYPE_PROP, JaxRSWebServiceModel.TYPE); pipeline = new GraphTraversalSource(getGraphContext().getGraph()).V(implementationClass.getElement()); pipeline.out(JaxRSWebServiceModel.JAXRS_IMPLEMENTATION_CLASS); pipeline.has(WindupVertexFrame.TYPE_PROP, Text.textContains(JaxRSWebServiceModel.TYPE)); JaxRSWebServiceModel result = frame(pipeline.next()); if (!result.isAssociatedWithApplication(application)) result.addApplication(application); JaxRSWebServiceModel jaxWebService = create(); jaxWebService.addApplication(application); jaxWebService.setPath(path);
private void extractMetadata(GraphRewrite event, JavaTypeReferenceModel typeReference) { typeReference.getFile().setGenerateSourceReport(true); JavaAnnotationTypeReferenceModel jaxRSAnnotationTypeReference = (JavaAnnotationTypeReferenceModel) typeReference; String path = getAnnotationLiteralValue(jaxRSAnnotationTypeReference, "value"); JavaClassModel implementationClass = getJavaClass(typeReference); JaxRSWebServiceModelService service = new JaxRSWebServiceModelService(event.getGraphContext()); service.getOrCreate(typeReference.getFile().getApplication(), path, implementationClass); }