本文整理汇总了Java中com.google.protobuf.DescriptorProtos.EnumDescriptorProto.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java EnumDescriptorProto.Builder方法的具体用法?Java EnumDescriptorProto.Builder怎么用?Java EnumDescriptorProto.Builder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.protobuf.DescriptorProtos.EnumDescriptorProto
的用法示例。
在下文中一共展示了EnumDescriptorProto.Builder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildAllOptions
import com.google.protobuf.DescriptorProtos.EnumDescriptorProto; //导入方法依赖的package包/类
private void buildAllOptions(final FileDescriptorProto.Builder proto) {
if (!buildOptions(proto.getOptionsBuilder())) {
proto.clearOptions();
}
for (final FieldDescriptorProto.Builder extensionProto : proto.getExtensionBuilderList()) {
if (!buildOptions(extensionProto.getOptionsBuilder())) {
extensionProto.clearOptions();
}
}
for (final EnumDescriptorProto.Builder enumProto : proto.getEnumTypeBuilderList()) {
buildAllOptions(enumProto);
}
for (final ServiceDescriptorProto.Builder serviceProto : proto.getServiceBuilderList()) {
buildAllOptions(serviceProto);
}
for (final DescriptorProto.Builder messageProto : proto.getMessageTypeBuilderList()) {
buildAllOptions(messageProto);
}
}
示例2: generateEnum
import com.google.protobuf.DescriptorProtos.EnumDescriptorProto; //导入方法依赖的package包/类
private EnumDescriptorProto generateEnum(Enum e) {
EnumDescriptorProto.Builder builder = EnumDescriptorProto.newBuilder();
builder.setName(getSimpleName(e.getName()));
for (EnumValue value : e.getEnumvalueList()) {
EnumValueDescriptorProto.Builder valueBuilder = EnumValueDescriptorProto.newBuilder();
valueBuilder.setName(value.getName());
valueBuilder.setNumber(value.getNumber());
valueBuilder.setOptions(generateEnumValueOptions(value));
builder.addValue(valueBuilder.build());
}
builder.setOptions(generateEnumOptions(e));
return builder.build();
}
示例3: accept
import com.google.protobuf.DescriptorProtos.EnumDescriptorProto; //导入方法依赖的package包/类
@Accepts
protected void accept(EnumDescriptorProto.Builder enumType) {
pushParent(BuilderVisitorNodeInfo.create(enumType, currentFile));
visitRepeated(EnumDescriptorProto.VALUE_FIELD_NUMBER);
visit(enumType.getOptionsBuilder());
popExpectedParent(enumType);
}
示例4: addEnum
import com.google.protobuf.DescriptorProtos.EnumDescriptorProto; //导入方法依赖的package包/类
public EnumDescriptorProto.Builder addEnum(final String enumName) {
final EnumDescriptorProto.Builder builder = currentScope.addEnum().setName(enumName);
pushScope(new EnumScope(builder, currentScope));
symbolScopes.addLeaf(enumName);
return builder;
}
示例5: EnumScope
import com.google.protobuf.DescriptorProtos.EnumDescriptorProto; //导入方法依赖的package包/类
private EnumScope(final EnumDescriptorProto.Builder protoBuilder, final Scope<?> parent) {
super(protoBuilder, parent);
}