test_class.declarator: serviceClassParser
test_class.modifier: private
test_class.original_string: private ServiceClassParser serviceClassParser;
test_class.type: ServiceClassParser
test_class.var_name: serviceClassParser
test_class.declarator: settings
test_class.modifier: private
test_class.original_string: private TypescriptServiceGeneratorConfiguration settings;
test_class.type: TypescriptServiceGeneratorConfiguration
test_class.var_name: settings
test_class.file: typescript-service-generator-core/src/test/java/com/palantir/code/ts/generator/ServiceClassParserTest.java
test_class.identifier: ServiceClassParserTest
test_case.body: @Test
      public void parseSimpleClassTest() {
          ServiceModel model = serviceClassParser.parseServiceClass(TestServiceClass.class, settings);
          assertEquals(1, model.innerServiceModels().size());
          assertEquals(ImmutableSet.of(String.class), model.referencedTypes());
          assertEquals("TestServiceClass", model.name());
          assertEquals("testService", model.innerServiceModels().get(0).servicePath());
          ServiceEndpointParameterModel aParam = ImmutableServiceEndpointParameterModel.builder().pathParam("a").javaType(String.class).tsType(TsType.String).build();
          ServiceEndpointParameterModel bParam = ImmutableServiceEndpointParameterModel.builder().pathParam("b").javaType(String.class).tsType(TsType.String).build();
          ImmutableServiceEndpointModel stringGetterEndpointModel = ImmutableServiceEndpointModel.builder()
                                                                                                 .javaReturnType(String.class)
                                                                                                 .tsReturnType(TsType.String)
                                                                                                 .parameters(Lists.newArrayList(aParam, bParam))
                                                                                                 .endpointName("stringGetter")
                                                                                                 .endpointPath("stringGetter/{a}/{b}")
                                                                                                 .endpointMethodType("GET")
                                                                                                 .build();
          assertEquals(model.innerServiceModels().get(0).endpointModels(), Lists.newArrayList(stringGetterEndpointModel));
      }
test_case.class_method_signature: ServiceClassParserTest.parseSimpleClassTest()
test_case.full_signature: @Test public void parseSimpleClassTest()
test_case.identifier: parseSimpleClassTest
test_case.invocations: parseServiceClass assertEquals size innerServiceModels assertEquals of referencedTypes assertEquals name assertEquals servicePath get innerServiceModels build tsType javaType pathParam builder build tsType javaType pathParam builder build endpointMethodType endpointPath endpointName parameters tsReturnType javaReturnType builder newArrayList assertEquals endpointModels get innerServiceModels newArrayList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void parseSimpleClassTest()
focal_class.declarator: ANNOTATION_CLASSES = Lists.newArrayList(POST.class, GET.class, DELETE.class, PUT.class, OPTIONS.class)
focal_class.modifier: @SuppressWarnings("unchecked")
      private final static
focal_class.original_string: @SuppressWarnings("unchecked")
      private final static List<Class<? extends Annotation>> ANNOTATION_CLASSES = Lists.newArrayList(POST.class, GET.class, DELETE.class, PUT.class, OPTIONS.class);
focal_class.type: List<Class<? extends Annotation>>
focal_class.var_name: ANNOTATION_CLASSES
focal_class.file: typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/ServiceClassParser.java
focal_class.identifier: ServiceClassParser
focal_class.class_method_signature: ServiceClassParser.getAllServiceMethods(Class<?> serviceClass, MethodFilter methodFilter)
focal_class.full_signature: public Set<Method> getAllServiceMethods(Class<?> serviceClass, MethodFilter methodFilter)
focal_class.identifier: getAllServiceMethods
focal_class.modifiers: public
focal_class.parameters: (Class<?> serviceClass, MethodFilter methodFilter)
focal_class.return: Set<Method>
focal_class.signature: Set<Method> getAllServiceMethods(Class<?> serviceClass, MethodFilter methodFilter)
focal_class.class_method_signature: ServiceClassParser.parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_class.full_signature: public ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_class.identifier: parseServiceClass
focal_class.modifiers: public
focal_class.parameters: (Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_class.return: ServiceModel
focal_class.signature: ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_class.class_method_signature: ServiceClassParser.computeEndpointModels(Set<Method> endpoints, ModelCompiler compiler, TypescriptServiceGeneratorConfiguration settings)
focal_class.full_signature: private static List<ServiceEndpointModel> computeEndpointModels(Set<Method> endpoints, ModelCompiler compiler, TypescriptServiceGeneratorConfiguration settings)
focal_class.identifier: computeEndpointModels
focal_class.modifiers: private static
focal_class.parameters: (Set<Method> endpoints, ModelCompiler compiler, TypescriptServiceGeneratorConfiguration settings)
focal_class.return: List<ServiceEndpointModel>
focal_class.signature: List<ServiceEndpointModel> computeEndpointModels(Set<Method> endpoints, ModelCompiler compiler, TypescriptServiceGeneratorConfiguration settings)
focal_class.class_method_signature: ServiceClassParser.getMethodType(Method endpoint)
focal_class.full_signature: private static String getMethodType(Method endpoint)
focal_class.identifier: getMethodType
focal_class.modifiers: private static
focal_class.parameters: (Method endpoint)
focal_class.return: String
focal_class.signature: String getMethodType(Method endpoint)
focal_class.class_method_signature: ServiceClassParser.getParamterAnnotationMaps(Method endpoint)
focal_class.full_signature: private static List<Map<Class<?>, Annotation>> getParamterAnnotationMaps(Method endpoint)
focal_class.identifier: getParamterAnnotationMaps
focal_class.modifiers: private static
focal_class.parameters: (Method endpoint)
focal_class.return: List<Map<Class<?>, Annotation>>
focal_class.signature: List<Map<Class<?>, Annotation>> getParamterAnnotationMaps(Method endpoint)
focal_class.class_method_signature: ServiceClassParser.getTypesFromEndpoint(Method endpoint, TypescriptServiceGeneratorConfiguration settings)
focal_class.full_signature: private static Set<Type> getTypesFromEndpoint(Method endpoint, TypescriptServiceGeneratorConfiguration settings)
focal_class.identifier: getTypesFromEndpoint
focal_class.modifiers: private static
focal_class.parameters: (Method endpoint, TypescriptServiceGeneratorConfiguration settings)
focal_class.return: Set<Type>
focal_class.signature: Set<Type> getTypesFromEndpoint(Method endpoint, TypescriptServiceGeneratorConfiguration settings)
focal_method.body: public ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge) {
          List<Class<?>> serviceClazzes = Lists.newArrayList(mainServiceClass);
          serviceClazzes.addAll(Lists.newArrayList(serviceClassesToMerge));
          ImmutableServiceModel.Builder serviceModel = ImmutableServiceModel.builder();
          serviceModel.name(mainServiceClass.getSimpleName());
          for (Class<?> serviceClass : serviceClazzes) {
              ImmutableInnerServiceModel.Builder innerServiceModel = ImmutableInnerServiceModel.builder();
              Path servicePathAnnotation = serviceClass.getAnnotation(Path.class);
              innerServiceModel.servicePath(servicePathAnnotation == null ? "" : PathUtils.trimSlashes(servicePathAnnotation.value()));
              innerServiceModel.name(serviceClass.getSimpleName());
  
              Set<Method> serviceMethods = getAllServiceMethods(serviceClass, settings.methodFilter());
              // find and stores all types that are referenced by this service
              Set<Type> referencedTypes = Sets.newHashSet();
              for (Method method : serviceMethods) {
                  referencedTypes.addAll(getTypesFromEndpoint(method, settings));
              }
              serviceModel.addAllReferencedTypes(referencedTypes);
  
              ModelCompiler compiler = new TypeScriptGenerator(settings.getSettings()).getModelCompiler();
  
              List<ServiceEndpointModel> endpointModels = Lists.newArrayList();
              endpointModels = computeEndpointModels(serviceMethods, compiler, settings);
  
              Collections.sort(endpointModels);
              innerServiceModel.endpointModels(endpointModels);
              serviceModel.addInnerServiceModels(innerServiceModel.build());
          }
          return serviceModel.build();
      }
focal_method.class_method_signature: ServiceClassParser.parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_method.full_signature: public ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_method.identifier: parseServiceClass
focal_method.invocations: newArrayList addAll newArrayList builder name getSimpleName builder getAnnotation servicePath trimSlashes value name getSimpleName getAllServiceMethods methodFilter newHashSet addAll getTypesFromEndpoint addAllReferencedTypes getModelCompiler getSettings newArrayList computeEndpointModels sort endpointModels addInnerServiceModels build build
focal_method.modifiers: public
focal_method.parameters: (Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_method.return: ServiceModel
focal_method.signature: ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)