Examples of ReturnType


Examples of freenet.clients.fcp.ClientGet.ReturnType

   * @throws NotAllowedException
   * @throws IOException
   */
  public void makePersistentGlobalRequest(FreenetURI fetchURI, boolean filterData, String expectedMimeType, String persistenceTypeString, String returnTypeString, boolean realTimeFlag, File downloadsDir) throws NotAllowedException, IOException {
    boolean persistence = persistenceTypeString.equalsIgnoreCase("reboot");
    ReturnType returnType = ReturnType.valueOf(returnTypeString.toUpperCase());
    File returnFilename = null;
    if(returnType == ReturnType.DISK) {
      returnFilename = makeReturnFilename(fetchURI, expectedMimeType, downloadsDir);
    }
//    public ClientGet(PersistentRequestClient globalClient, FreenetURI uri, boolean dsOnly, boolean ignoreDS,
View Full Code Here

Examples of org.amdatu.web.rest.doc.ReturnType

        }
        return new SwaggerModelType(typeName, mp, requiredFields);
    }

    protected static Class<?> getReturnType(Method method) {
      ReturnType annotation = method.getAnnotation(ReturnType.class);
      if (annotation != null) {
        return annotation.value();
      }
     
      return method.getReturnType();
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImport.ReturnType

      }
    }

    private void buildEdmReturnType(final FunctionImport functionImport, final Method method,
        final EdmFunctionImport edmAnnotationFunctionImport) throws ODataJPAModelException {
      ReturnType returnType = edmAnnotationFunctionImport.returnType();

      if (returnType != null) {
        org.apache.olingo.odata2.api.edm.provider.ReturnType functionReturnType =
            new org.apache.olingo.odata2.api.edm.provider.ReturnType();

        if (returnType.isCollection()) {
          functionReturnType.setMultiplicity(EdmMultiplicity.MANY);
        } else {
          functionReturnType.setMultiplicity(EdmMultiplicity.ONE);
        }

        if (returnType.type() == ReturnType.Type.ENTITY) {
          String entitySet = edmAnnotationFunctionImport.entitySet();
          if (entitySet.equals("")) {
            throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_ENTITYSET_EXP, null);
          }
          functionImport.setEntitySet(entitySet);
        }

        Class<?> methodReturnType = method.getReturnType();
        if (methodReturnType == null || methodReturnType.getName().equals("void")) {
          throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_RETURN_TYPE_EXP.addContent(method
              .getDeclaringClass(), method.getName()), null);
        }
        switch (returnType.type()) {
        case ENTITY:
          EntityType edmEntityType = null;
          if (returnType.isCollection() == false) {
            edmEntityType = jpaEdmEntityTypeView.searchEdmEntityType(methodReturnType.getSimpleName());
          } else {
            edmEntityType = jpaEdmEntityTypeView.searchEdmEntityType(getReturnTypeSimpleName(method));
          }

          if (edmEntityType == null) {
            throw ODataJPAModelException.throwException(ODataJPAModelException.FUNC_RETURN_TYPE_ENTITY_NOT_FOUND
                .addContent(method.getDeclaringClass(), method.getName(), methodReturnType.getSimpleName()), null);
          }
          functionReturnType.setTypeName(JPAEdmNameBuilder.build(schemaView, edmEntityType.getName()));
          break;
        case SIMPLE:
          EdmSimpleTypeKind edmSimpleTypeKind = JPATypeConvertor.convertToEdmSimpleType(methodReturnType, null);
          functionReturnType.setTypeName(edmSimpleTypeKind.getFullQualifiedName());

          break;
        case COMPLEX:
          String embeddableTypeName = null;
          ComplexType complexType = null;
          boolean exists = false;

          if (returnType.isCollection() == false) {
            embeddableTypeName = methodReturnType.getName();
          } else {
            embeddableTypeName = getReturnTypeName(method);
          }
View Full Code Here

Examples of org.apache.olingo.odata2.api.annotation.edm.FunctionImport.ReturnType

      }
    }

    private void buildReturnType(final FunctionImport functionImport, final Method method,
        final org.apache.olingo.odata2.api.annotation.edm.FunctionImport annotation) throws ODataJPAModelException {
      ReturnType returnType = annotation.returnType();
      Multiplicity multiplicity = null;

      if (returnType != ReturnType.NONE) {
        org.apache.olingo.odata2.api.edm.provider.ReturnType functionReturnType =
            new org.apache.olingo.odata2.api.edm.provider.ReturnType();
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ReturnType

  }

  @Override
  public EdmTyped getReturnType() throws EdmException {
    if (edmReturnType == null) {
      final ReturnType returnType = functionImport.getReturnType();
      if (returnType != null) {
        edmReturnType =
            new EdmTypedImplProv(edm, functionImport.getName(), returnType.getTypeName(), returnType.getMultiplicity());
      }
    }
    return edmReturnType;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ReturnType

      if (FUNCTION_IMPORT_1.equals(name)) {
        final List<FunctionImportParameter> parameters = new ArrayList<FunctionImportParameter>();
        parameters.add(new FunctionImportParameter().setName("q").setType(EdmSimpleTypeKind.String)
            .setFacets(new Facets().setNullable(true)));
        return new FunctionImport().setName(name)
            .setReturnType(new ReturnType().setTypeName(ENTITY_TYPE_1_1).setMultiplicity(EdmMultiplicity.MANY))
            .setEntitySet(ENTITY_SET_1_1)
            .setHttpMethod("GET")
            .setParameters(parameters);

      } else if (FUNCTION_IMPORT_2.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(new ReturnType().setTypeName(COMPLEX_TYPE_1).setMultiplicity(EdmMultiplicity.MANY))
            .setHttpMethod("GET");

      } else if (FUNCTION_IMPORT_3.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(
                new ReturnType().setTypeName(EdmSimpleTypeKind.String.getFullQualifiedName()).setMultiplicity(
                    EdmMultiplicity.MANY))
            .setHttpMethod("GET");

      } else if (FUNCTION_IMPORT_4.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(
                new ReturnType().setTypeName(EdmSimpleTypeKind.Int16.getFullQualifiedName()).setMultiplicity(
                    EdmMultiplicity.ONE))
            .setHttpMethod("GET");

      } else if (FUNCTION_IMPORT_5.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(new ReturnType().setTypeName(COMPLEX_TYPE_1).setMultiplicity(EdmMultiplicity.ONE))
            .setHttpMethod("GET");

      } else if (FUNCTION_IMPORT_6.equals(name)) {
        final List<FunctionImportParameter> parameters = new ArrayList<FunctionImportParameter>();
        parameters.add(new FunctionImportParameter().setName("Id").setType(EdmSimpleTypeKind.String)
            .setFacets(new Facets().setNullable(false)));
        return new FunctionImport().setName(name)
            .setReturnType(
                new ReturnType().setTypeName(EdmSimpleTypeKind.Binary.getFullQualifiedName()).setMultiplicity(
                    EdmMultiplicity.ONE))
            .setHttpMethod("GET")
            .setParameters(parameters);

      } else if (FUNCTION_IMPORT_7.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(
                new ReturnType().setTypeName(new FullQualifiedName(NAMESPACE_1, "Employee")).setMultiplicity(
                    EdmMultiplicity.ZERO_TO_ONE))
            .setEntitySet(ENTITY_SET_1_1)
            .setHttpMethod("GET");

      }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ReturnType

    edmEntityContainer = new EdmEntityContainerImplProv(edmImplProv, containerInfo);

    EntitySet fooEntitySet = new EntitySet().setName("fooEntitySet");
    when(edmProvider.getEntitySet("Container", "fooEntitySet")).thenReturn(fooEntitySet);

    ReturnType fooReturnType =
        new ReturnType().setTypeName(EdmSimpleTypeKind.String.getFullQualifiedName()).setMultiplicity(
            EdmMultiplicity.ONE);

    List<FunctionImportParameter> parameters = new ArrayList<FunctionImportParameter>();
    FunctionImportParameter parameter =
        new FunctionImportParameter().setName("fooParameter1").setType(EdmSimpleTypeKind.String);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ReturnType

        XmlMetadataConstants.EDM_FUNCTION_IMPORT_HTTP_METHOD));
    function.setEntitySet(reader.getAttributeValue(null, XmlMetadataConstants.EDM_ENTITY_SET));

    String returnTypeString = reader.getAttributeValue(null, XmlMetadataConstants.EDM_FUNCTION_IMPORT_RETURN);
    if (returnTypeString != null) {
      ReturnType returnType = new ReturnType();
      if (returnTypeString.startsWith("Collection") || returnTypeString.startsWith("collection")) {
        returnType.setMultiplicity(EdmMultiplicity.MANY);
        returnTypeString = returnTypeString.substring(returnTypeString.indexOf("(") + 1, returnTypeString.length() - 1);
      }
      FullQualifiedName fqName = extractFQName(returnTypeString);
      returnType.setTypeName(fqName);
      function.setReturnType(returnType);
    }
    function.setAnnotationAttributes(readAnnotationAttribute(reader));
    while (reader.hasNext()
        && !(reader.isEndElement() && edmNamespace.equals(reader.getNamespaceURI())
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ReturnType

  @Override
  public FunctionImport getFunctionImport(final String entityContainer, final String name) throws ODataException {
    if (ENTITY_CONTAINER_1.equals(entityContainer)) {
      if (FUNCTION_IMPORT_1.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(new ReturnType().setTypeName(ENTITY_TYPE_1_1).setMultiplicity(EdmMultiplicity.MANY))
            .setEntitySet(ENTITY_SET_1_1)
            .setHttpMethod("GET")
            .setParameters(Arrays.asList(
                new FunctionImportParameter().setName("q").setType(EdmSimpleTypeKind.String)
                    .setFacets(new Facets().setNullable(true))));

      } else if (FUNCTION_IMPORT_2.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(new ReturnType().setTypeName(COMPLEX_TYPE_1).setMultiplicity(EdmMultiplicity.MANY))
            .setHttpMethod("GET");

      } else if (FUNCTION_IMPORT_3.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(
                new ReturnType().setTypeName(EdmSimpleTypeKind.String.getFullQualifiedName()).setMultiplicity(
                    EdmMultiplicity.MANY))
            .setHttpMethod("GET");

      } else if (FUNCTION_IMPORT_4.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(
                new ReturnType().setTypeName(EdmSimpleTypeKind.Int16.getFullQualifiedName()).setMultiplicity(
                    EdmMultiplicity.ONE))
            .setHttpMethod("GET");

      } else if (FUNCTION_IMPORT_5.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(new ReturnType().setTypeName(COMPLEX_TYPE_1).setMultiplicity(EdmMultiplicity.ONE))
            .setHttpMethod("GET");

      } else if (FUNCTION_IMPORT_6.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(
                new ReturnType().setTypeName(EdmSimpleTypeKind.Binary.getFullQualifiedName()).setMultiplicity(
                    EdmMultiplicity.ONE))
            .setHttpMethod("GET")
            .setParameters(Arrays.asList(
                new FunctionImportParameter().setName("Id").setType(EdmSimpleTypeKind.String)
                    .setFacets(new Facets().setNullable(false))));

      } else if (FUNCTION_IMPORT_7.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(new ReturnType().setTypeName(ENTITY_TYPE_1_1).setMultiplicity(EdmMultiplicity.ZERO_TO_ONE))
            .setEntitySet(ENTITY_SET_1_1)
            .setHttpMethod("GET");
      }
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.ReturnType

  @Override
  public FunctionImport getFunctionImport(final String entityContainer, final String name) throws ODataException {
    if (ENTITY_CONTAINER.equals(entityContainer)) {
      if (FUNCTION_IMPORT.equals(name)) {
        return new FunctionImport().setName(name)
            .setReturnType(new ReturnType().setTypeName(ENTITY_TYPE_1_1).setMultiplicity(EdmMultiplicity.MANY))
            .setHttpMethod("GET");
      }
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.