Package com.linkedin.restli.restspec

Examples of com.linkedin.restli.restspec.FinderSchema


        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());
      }
      else if (methodSchema instanceof ActionSchema)
      {
        ActionSchema actionMethodSchema = (ActionSchema)methodSchema;
        final ResourceLevel resourceLevel = (visitor.getCollectionActions().contains(methodSchema) ?
View Full Code Here


    for (ResourceMethodDescriptor resourceMethodDescriptor : resourceMethodDescriptors)
    {
      if (ResourceMethod.FINDER.equals(resourceMethodDescriptor.getType()))
      {
        FinderSchema finder = new FinderSchema();

        finder.setName(resourceMethodDescriptor.getFinderName());

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

        ParameterSchemaArray parameters = createParameters(resourceMethodDescriptor);
        if (parameters.size() > 0)
        {
          finder.setParameters(parameters);
        }
        StringArray assocKeys = createAssocKeyParameters(resourceMethodDescriptor);
        if (assocKeys.size() > 0)
        {
          finder.setAssocKeys(assocKeys);
        }
        if (resourceMethodDescriptor.getFinderMetadataType() != null)
        {
          Class<?> metadataType = resourceMethodDescriptor.getFinderMetadataType();
          MetadataSchema metadataSchema = new MetadataSchema();
          metadataSchema.setType(buildDataSchemaType(metadataType));
          finder.setMetadata(metadataSchema);
        }

        final DataMap customAnnotation = resourceMethodDescriptor.getCustomAnnotationData();

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

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

        findersArray.add(finder);
      }
    }
View Full Code Here

    }
  }

  public ExampleRequestResponse finder(String name)
  {
    FinderSchema finderSchema = _resourceSchema.getFinder(name);
    if (finderSchema == null)
    {
      throw new IllegalArgumentException("No such finder for resource: " + name);
    }
    RecordDataSchema metadataSchema = null;
    if (finderSchema.hasMetadata())
    {
      metadataSchema = (RecordDataSchema) RestSpecCodec.textToSchema(finderSchema.getMetadata().getType(),
                                                                     _schemaResolver);
    }

    return buildRequestResponse(buildFinderRequest(finderSchema),
        buildFinderResult(metadataSchema),
View Full Code Here

TOP

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

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.