当前位置: 首页>>代码示例>>Java>>正文


Java FieldDescriptorProto.getOptions方法代码示例

本文整理汇总了Java中com.google.protobuf.DescriptorProtos.FieldDescriptorProto.getOptions方法的典型用法代码示例。如果您正苦于以下问题:Java FieldDescriptorProto.getOptions方法的具体用法?Java FieldDescriptorProto.getOptions怎么用?Java FieldDescriptorProto.getOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.protobuf.DescriptorProtos.FieldDescriptorProto的用法示例。


在下文中一共展示了FieldDescriptorProto.getOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addColumn

import com.google.protobuf.DescriptorProtos.FieldDescriptorProto; //导入方法依赖的package包/类
protected void addColumn(Column column) {
    String fieldName = uniqueIdent(ident(column.getName(), false), fieldNames);
    fieldBuilder = messageBuilder.addFieldBuilder();
    fieldBuilder.setName(fieldName);
    fieldBuilder.setLabel(Label.LABEL_OPTIONAL);
    FieldOptions.Builder fieldBuilderOptions = FieldOptions.newBuilder();
    ColumnOptions.Builder columnOptions = ColumnOptions.newBuilder();
    if (!fieldName.equals(column.getName())) {
        columnOptions.setName(column.getName());
    }
    columnOptions.setSqlType(column.getTypeDescription().toUpperCase());
    columnOptions.setUuid(column.getUuid().toString());
    priorField = null;
    if (priorMessage != null) {
        for (FieldDescriptorProto field : priorMessage.getFieldList()) {
            FieldOptions options = field.getOptions();
            if ((options != null) &&
                (options.hasExtension(ColumnOptions.fdbsql))) {
                ColumnOptions coptions = options.getExtension(ColumnOptions.fdbsql);
                if (coptions.getUuid().equals(columnOptions.getUuid())) {
                    priorField = field;
                    break;
                }
            }
        }
    }
    setColumnType(column, columnOptions);
    setFieldNumber();
    fieldBuilderOptions.setExtension(ColumnOptions.fdbsql, columnOptions.build());
    fieldBuilder.setOptions(fieldBuilderOptions);
    if (column.getNullable() && 
        ((column.getDefaultValue() != null) ||
         (column.getDefaultFunction() != null))) {
        addNullForField(column.getName(), fieldBuilder.getNumber());
    }
}
 
开发者ID:jaytaylor,项目名称:sql-layer,代码行数:37,代码来源:AISToProtobuf.java

示例2: addNullForField

import com.google.protobuf.DescriptorProtos.FieldDescriptorProto; //导入方法依赖的package包/类
protected void addNullForField(String columnName, int forField) {
    String fieldName = uniqueIdent("_" + ident(columnName, false) + "_is_null", fieldNames);
    fieldBuilder = messageBuilder.addFieldBuilder();
    fieldBuilder.setName(fieldName);
    fieldBuilder.setType(Type.TYPE_BOOL);
    fieldBuilder.setLabel(Label.LABEL_OPTIONAL);
    FieldOptions.Builder fieldBuilderOptions = FieldOptions.newBuilder();
    ColumnOptions.Builder columnOptions = ColumnOptions.newBuilder();
    columnOptions.setNullForField(forField);
    priorField = null;
    if (priorMessage != null) {
        for (FieldDescriptorProto field : priorMessage.getFieldList()) {
            FieldOptions options = field.getOptions();
            if ((options != null) &&
                (options.hasExtension(ColumnOptions.fdbsql))) {
                ColumnOptions coptions = options.getExtension(ColumnOptions.fdbsql);
                if (coptions.hasNullForField() &&
                    (coptions.getNullForField() == forField)) {
                    priorField = field;
                    break;
                }
            }
        }
    }
    setFieldNumber();
    fieldBuilderOptions.setExtension(ColumnOptions.fdbsql, columnOptions.build());
    fieldBuilder.setOptions(fieldBuilderOptions);
}
 
开发者ID:jaytaylor,项目名称:sql-layer,代码行数:29,代码来源:AISToProtobuf.java

示例3: addChildTable

import com.google.protobuf.DescriptorProtos.FieldDescriptorProto; //导入方法依赖的package包/类
protected void addChildTable(Table table) {
    String fieldName = uniqueIdent(ident(table.getName().getTableName(), false), fieldNames);
    fieldBuilder = messageBuilder.addFieldBuilder();
    fieldBuilder.setName(fieldName);
    fieldBuilder.setLabel(Label.LABEL_REPEATED);
    fieldBuilder.setType(Type.TYPE_MESSAGE);
    fieldBuilder.setTypeName(tableMessageNames.get(table));
    FieldOptions.Builder fieldBuilderOptions = FieldOptions.newBuilder();
    ColumnOptions.Builder columnOptions = ColumnOptions.newBuilder();
    columnOptions.setUuid(table.getUuid().toString());
    priorField = null;
    if (priorMessage != null) {
        for (FieldDescriptorProto field : priorMessage.getFieldList()) {
            FieldOptions options = field.getOptions();
            if ((options != null) &&
                (options.hasExtension(ColumnOptions.fdbsql))) {
                ColumnOptions coptions = options.getExtension(ColumnOptions.fdbsql);
                if (coptions.getUuid().equals(columnOptions.getUuid())) {
                    priorField = field;
                    break;
                }
            }
        }
    }
    setFieldNumber();
    fieldBuilderOptions.setExtension(ColumnOptions.fdbsql, columnOptions.build());
    fieldBuilder.setOptions(fieldBuilderOptions);
}
 
开发者ID:jaytaylor,项目名称:sql-layer,代码行数:29,代码来源:AISToProtobuf.java


注:本文中的com.google.protobuf.DescriptorProtos.FieldDescriptorProto.getOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。