Package com.linkedin.restli.restspec

Examples of com.linkedin.restli.restspec.RestMethodSchema


        JMethod factoryMethod = facadeClass.method(JMod.PUBLIC, derivedBuilder, RestLiToolsUtils.nameCamelCase(
            methodName));
        factoryMethod.body()._return(JExpr._new(derivedBuilder).arg(baseUriExpr).arg(resourceSpecField).arg(requestOptionsExpr));

        final RestMethodSchema schema = schemaMap.get(method);
        if (schema != null)
        {
          if (schema.hasParameters())
          {
            generateQueryParamBindingMethods(facadeClass, schema.getParameters(), derivedBuilder);
          }
          generateClassJavadoc(derivedBuilder, schema);
          generateFactoryMethodJavadoc(factoryMethod, schema);
        }
      }
View Full Code Here


    for (RecordTemplate methodSchema : visitor.getAllMethods())
    {
      final ExampleRequestResponse capture;
      if (methodSchema instanceof RestMethodSchema)
      {
        RestMethodSchema restMethodSchema = (RestMethodSchema)methodSchema;
        capture = generator.method(ResourceMethod.valueOf(restMethodSchema.getMethod().toUpperCase()));
      }
      else if (methodSchema instanceof FinderSchema)
      {
        FinderSchema finderMethodSchema = (FinderSchema)methodSchema;
        capture = generator.finder(finderMethodSchema.getName());
View Full Code Here

  private String getDoc(Object method, boolean isSimpleResourceMethod)
  {
    String doc = null;
    if (method instanceof RestMethodSchema)
    {
      final RestMethodSchema restMethodSchema = (RestMethodSchema) method;
      doc = restMethodSchema.getDoc();
      if (doc == null || doc.trim().length() == 0) // if no javadoc is supplied, fallback to generic doc string
      {
        if (isSimpleResourceMethod)
        {
          doc = _restMethodDocsMapForSimpleResource.get(restMethodSchema.getMethod());
        }
        else
        {
          doc = _restMethodDocsMapForCollection.get(restMethodSchema.getMethod());
        }

        if (doc == null)
        {
          log.warn(String.format("No doc string for REST method %s", doc));
View Full Code Here

      if (descriptor == null)
      {
        continue;
      }

      RestMethodSchema restMethod = new RestMethodSchema();

      restMethod.setMethod(method.toString());

      String doc = _docsProvider.getMethodDoc(descriptor.getMethod());
      if (doc != null)
      {
        restMethod.setDoc(doc);
      }

      ParameterSchemaArray parameters = createParameters(descriptor);
      if (parameters.size() > 0)
      {
        restMethod.setParameters(parameters);
      }

      final DataMap customAnnotation = descriptor.getCustomAnnotationData();


      String deprecatedDoc = _docsProvider.getMethodDeprecatedTag(descriptor.getMethod());
      if(deprecatedDoc != null)
      {
        customAnnotation.put(DEPRECATED_ANNOTATION_NAME, deprecateDocToAnnotationMap(deprecatedDoc));
      }

      if (!customAnnotation.isEmpty())
      {
        restMethod.setAnnotations(new CustomAnnotationContentSchemaMap(customAnnotation));
      }

      restMethods.add(restMethod);
    }
View Full Code Here

  }

  private static RestMethodSchema findRestMethod(ResourceSchema resourceSchema, ResourceMethod method)
  {
    RestMethodSchemaArray methods = null;
    RestMethodSchema methodResult = null;

    final CollectionSchema collectionSchema = resourceSchema.getCollection();
    if (collectionSchema != null)
    {
      methods = collectionSchema.getMethods();
View Full Code Here

                                                    null);
  }

  private void addParams(RestfulRequestBuilder<?, ?, ?> builder, ResourceMethod method)
  {
    RestMethodSchema methodSchema = _resourceSchema.getMethod(method.toString().toLowerCase());
    ParameterSchemaArray parameters = methodSchema.getParameters();
    addParams(builder, parameters);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.restli.restspec.RestMethodSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.