private static String[] getFullyQualifiedClassName(Descriptors.Descriptor container, final FileOptions fileOpts, String name) { if (fileOpts.getJavaMultipleFiles()) { LinkedList<String> fqnSegments = new LinkedList<>(); fqnSegments.push(name); while (container != null) { fqnSegments.push(container.getName()); container = container.getContainingType(); } fqnSegments.push(fileOpts.getJavaPackage()); return fqnSegments.toArray(new String[] {}); } return new String[] {fileOpts.getJavaPackage(), fileOpts.getJavaOuterClassname(), name}; }
private String getNamespace(FileDescriptor fd, Descriptor containing) { FileOptions o = fd.getOptions(); String p = o.hasJavaPackage() ? o.getJavaPackage() : fd.getPackage(); String outer; if (o.hasJavaOuterClassname()) { outer = o.getJavaOuterClassname(); } else { outer = new File(fd.getName()).getName(); outer = outer.substring(0, outer.lastIndexOf('.')); outer = toCamelCase(outer); } String inner = ""; while (containing != null) { inner = containing.getName() + "$" + inner; containing = containing.getContainingType(); } return p + "." + outer + "$" + inner; }
if (hasJavaPackage()) { hash = (37 * hash) + JAVA_PACKAGE_FIELD_NUMBER; hash = (53 * hash) + getJavaPackage().hashCode();
/** * <code>optional string java_package = 1;</code> * * <pre> * Sets the Java package where classes generated from this .proto will be * placed. By default, the proto package is used, but this is often * inappropriate because proto packages do not normally start with backwards * domain names. * </pre> */ public Builder clearJavaPackage() { bitField0_ = (bitField0_ & ~0x00000001); javaPackage_ = getDefaultInstance().getJavaPackage(); onChanged(); return this; } /**
/** * Returns the base component of the Java message package, for example, given * org.waveprotocol.pst.examples.Example1.Person: * <ul> * <li>Message = "org.waveprotocol.pst.examples"</li> * <li>MessageServerImpl (package suffix "server") = "org.waveprotocol.pst.examples"</li> * </ul> * * @return the base component of the Java package */ public String getPackageBase() { String javaPackage = descriptor.getFile().getOptions().getJavaPackage(); if (Strings.isNullOrEmpty(javaPackage)) { javaPackage = descriptor.getFile().getPackage(); } return javaPackage; }
/** * <code>optional string java_package = 1;</code> * * <pre> * Sets the Java package where classes generated from this .proto will be * placed. By default, the proto package is used, but this is often * inappropriate because proto packages do not normally start with backwards * domain names. * </pre> */ public Builder clearJavaPackage() { bitField0_ = (bitField0_ & ~0x00000001); javaPackage_ = getDefaultInstance().getJavaPackage(); onChanged(); return this; } /**
/** * <code>optional string java_package = 1;</code> * * <pre> * Sets the Java package where classes generated from this .proto will be * placed. By default, the proto package is used, but this is often * inappropriate because proto packages do not normally start with backwards * domain names. * </pre> */ public Builder clearJavaPackage() { bitField0_ = (bitField0_ & ~0x00000001); javaPackage_ = getDefaultInstance().getJavaPackage(); onChanged(); return this; } /**
/** * <pre> * Sets the Java package where classes generated from this .proto will be * placed. By default, the proto package is used, but this is often * inappropriate because proto packages do not normally start with backwards * domain names. * </pre> * * <code>optional string java_package = 1;</code> */ private void clearJavaPackage() { bitField0_ = (bitField0_ & ~0x00000001); javaPackage_ = getDefaultInstance().getJavaPackage(); } /**
public static String javaPackage(DescriptorProtos.FileDescriptorProto fd) { return fd.getOptions().getJavaPackage(); }
/** * <pre> * Sets the Java package where classes generated from this .proto will be * placed. By default, the proto package is used, but this is often * inappropriate because proto packages do not normally start with backwards * domain names. * </pre> * * <code>optional string java_package = 1;</code> */ public java.lang.String getJavaPackage() { return instance.getJavaPackage(); } /**
private static String[] getFullyQualifiedClassName(Descriptors.Descriptor container, final FileOptions fileOpts, String name) { if (fileOpts.getJavaMultipleFiles()) { LinkedList<String> fqnSegments = new LinkedList<>(); fqnSegments.push(name); while (container != null) { fqnSegments.push(container.getName()); container = container.getContainingType(); } fqnSegments.push(fileOpts.getJavaPackage()); return fqnSegments.toArray(new String[] {}); } return new String[] {fileOpts.getJavaPackage(), fileOpts.getJavaOuterClassname(), name}; }
public static String getJavaPackage(ProtoFile file) { String packageName = file.getProto().getOptions().getJavaPackage(); if (Strings.isNullOrEmpty(packageName)) { return DEFAULT_JAVA_PACKAGE_PREFIX + "." + file.getFullName(); } return packageName; }
private String extractPackageName(DescriptorProtos.FileDescriptorProto proto) { DescriptorProtos.FileOptions options = proto.getOptions(); if (options != null) { String javaPackage = options.getJavaPackage(); if (!Strings.isNullOrEmpty(javaPackage)) { return javaPackage; } } return Strings.nullToEmpty(proto.getPackage()); }
private String extractPackageName(FileDescriptorProto proto) { FileOptions options = proto.getOptions(); if (options != null) { String javaPackage = options.getJavaPackage(); if (!Strings.isNullOrEmpty(javaPackage)) { return javaPackage; } } return Strings.nullToEmpty(proto.getPackage()); }
private String extractPackageName(DescriptorProtos.FileDescriptorProto proto) { DescriptorProtos.FileOptions options = proto.getOptions(); if (options != null) { String javaPackage = options.getJavaPackage(); if (!Strings.isNullOrEmpty(javaPackage)) { return javaPackage; } } return Strings.nullToEmpty(proto.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(); }
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(); }
result = result && (hasJavaPackage() == other.hasJavaPackage()); if (hasJavaPackage()) { result = result && getJavaPackage() .equals(other.getJavaPackage());
/** * <code>optional string java_package = 1;</code> * * <pre> * Sets the Java package where classes generated from this .proto will be * placed. By default, the proto package is used, but this is often * inappropriate because proto packages do not normally start with backwards * domain names. * </pre> */ public Builder clearJavaPackage() { bitField0_ = (bitField0_ & ~0x00000001); javaPackage_ = getDefaultInstance().getJavaPackage(); onChanged(); return this; } /**
/** * <pre> * Sets the Java package where classes generated from this .proto will be * placed. By default, the proto package is used, but this is often * inappropriate because proto packages do not normally start with backwards * domain names. * </pre> * * <code>optional string java_package = 1;</code> */ public Builder clearJavaPackage() { bitField0_ = (bitField0_ & ~0x00000001); javaPackage_ = getDefaultInstance().getJavaPackage(); onChanged(); return this; } /**