chromium/third_party/flatbuffers/src/grpc/src/compiler/java_generator.cc

/*
 * Copyright 2016 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "src/compiler/java_generator.h"

#include <algorithm>
#include <iostream>
#include <iterator>
#include <map>
#include <utility>
#include <vector>

#include "flatbuffers/util.h"
#define to_string

// Stringify helpers used solely to cast GRPC_VERSION
#ifndef STR
#define STR(s)
#endif

#ifndef XSTR
#define XSTR(s)
#endif

Printer;
VARS;
ServiceDescriptor;
DescriptorType;  // base class of all 'descriptors'
MethodDescriptor;

namespace grpc_java_generator {
string;
namespace {
// Generates imports for the service
static void GenerateImports(grpc_generator::File *file,
                     grpc_generator::Printer *printer, VARS &vars) {}

// Adjust a method name prefix identifier to follow the JavaBean spec:
//   - decapitalize the first letter
//   - remove embedded underscores & capitalize the following letter
static string MixedLower(const string &word) {}

// Converts to the identifier to the ALL_UPPER_CASE format.
//   - An underscore is inserted where a lower case letter is followed by an
//     upper case letter.
//   - All letters are converted to upper case
static string ToAllUpperCase(const string &word) {}

static inline string LowerMethodName(const MethodDescriptor *method) {}

static inline string MethodPropertiesFieldName(const MethodDescriptor *method) {}

static inline string MethodPropertiesGetterName(
    const MethodDescriptor *method) {}

static inline string MethodIdFieldName(const MethodDescriptor *method) {}

static inline string JavaClassName(VARS &vars, const string &name) {}

static inline string ServiceClassName(const string &service_name) {}

// TODO(nmittler): Remove once protobuf includes javadoc methods in
// distribution.
template<typename ITR>
static void GrpcSplitStringToIteratorUsing(const string &full,
                                           const char *delim, ITR &result) {}

static void GrpcSplitStringUsing(const string &full, const char *delim,
                                 std::vector<string> *result) {}

static std::vector<string> GrpcSplit(const string &full, const char *delim) {}

// TODO(nmittler): Remove once protobuf includes javadoc methods in
// distribution.
static string GrpcEscapeJavadoc(const string &input) {}

static std::vector<string> GrpcGetDocLines(const string &comments) {}

static std::vector<string> GrpcGetDocLinesForDescriptor(
    const DescriptorType *descriptor) {}

static void GrpcWriteDocCommentBody(Printer *printer, VARS &vars,
                                    const std::vector<string> &lines,
                                    bool surroundWithPreTag) {}

static void GrpcWriteDocComment(Printer *printer, VARS &vars,
                                const string &comments) {}

static void GrpcWriteServiceDocComment(Printer *printer, VARS &vars,
                                       const ServiceDescriptor *service) {}

static void GrpcWriteMethodDocComment(Printer *printer, VARS &vars,
                               const MethodDescriptor *method) {}

// outputs static singleton extractor for type stored in "extr_type" and
// "extr_type_name" vars
static void PrintTypeExtractor(Printer *p, VARS &vars) {}
static void PrintMethodFields(Printer *p, VARS &vars,
                              const ServiceDescriptor *service) {}
enum StubType {};

enum CallType {};

static void PrintBindServiceMethodBody(Printer *p, VARS &vars,
                                       const ServiceDescriptor *service);

// Prints a client interface or implementation class, or a server interface.
static void PrintStub(Printer *p, VARS &vars, const ServiceDescriptor *service,
                      StubType type) {}

static bool CompareMethodClientStreaming(
    const std::unique_ptr<const grpc_generator::Method> &method1,
    const std::unique_ptr<const grpc_generator::Method> &method2) {}

// Place all method invocations into a single class to reduce memory footprint
// on Android.
static void PrintMethodHandlerClass(Printer *p, VARS &vars,
                                    const ServiceDescriptor *service) {}

static void PrintGetServiceDescriptorMethod(Printer *p, VARS &vars,
                                            const ServiceDescriptor *service) {}

static void PrintBindServiceMethodBody(Printer *p, VARS &vars,
                                       const ServiceDescriptor *service) {}

static void PrintService(Printer *p, VARS &vars,
                         const ServiceDescriptor *service,
                         bool disable_version) {}

static void PrintStaticImports(Printer *p) {}

static void GenerateService(const grpc_generator::Service *service,
                     grpc_generator::Printer *printer, VARS &vars,
                     bool disable_version) {}
} // namespace

grpc::string GenerateServiceSource(
    grpc_generator::File *file, const grpc_generator::Service *service,
    grpc_java_generator::Parameters *parameters) {}

}  // namespace grpc_java_generator