Search in sources :

Example 1 with FileOptions

use of com.google.protobuf.DescriptorProtos.FileOptions in project closure-templates by google.

the class JavaQualifiedNames method getPackage.

static String getPackage(FileDescriptorProto file, ProtoFlavor flavor) {
    FileOptions fileOptions = file.getOptions();
    StringBuilder sb = new StringBuilder();
    if (fileOptions.hasJavaPackage()) {
        sb.append(fileOptions.getJavaPackage());
    } else {
        if (!file.getPackage().isEmpty()) {
            sb.append(file.getPackage());
        }
    }
    return sb.toString();
}
Also used : FileOptions(com.google.protobuf.DescriptorProtos.FileOptions)

Aggregations

FileOptions (com.google.protobuf.DescriptorProtos.FileOptions)1