com.google.api.tools.framework.yaml.YamlNodeReader类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(191)

本文整理了Java中com.google.api.tools.framework.yaml.YamlNodeReader类的一些代码示例,展示了YamlNodeReader类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlNodeReader类的具体详情如下:
包路径:com.google.api.tools.framework.yaml.YamlNodeReader
类名称:YamlNodeReader

YamlNodeReader介绍

[英]Recursively reads A YamlNode and all of its children
[中]递归读取YamlNode及其所有子节点

代码示例

代码示例来源:origin: com.google.api/api-compiler

@Override
 public void accept(Builder builder) {
  new YamlNodeReader(helper, builder, path).readNode(node);
 }
}

代码示例来源:origin: com.google.api/api-compiler

private void readField(ConfigSource.Builder builder, FieldDescriptor field, Node value,
  String path) {
 if (!helper.checkAndAddPath(path, value, field)){
  return;
 }
 if (field.getType() == FieldDescriptor.Type.MESSAGE) {
  handleMessageField(builder, field, value, path);
 } else {
  handleNonMessageField(builder, field, value);
 }
}

代码示例来源:origin: googleapis/api-compiler

readField(builder, wrapperField, node, appendToPath(pathToNode, wrapperField.getName()));
return;
  helper.warning(node, "The field '%s' is deprecated.", field.getName());
 readField(builder, field, entry.getValueNode(), appendToPath(pathToNode, field.getName()));

代码示例来源:origin: googleapis/api-compiler

String nestedPath = appendToPath(path, keyObj);
   helper.checkAndAddPath(nestedPath, value, field);
   builder.withBuilder(field, keyObj, new ReadNodeBuildAction(helper, entry.getValueNode(),
     appendToPath(nestedPath, keyObj)));
  } else {
   Object valueObj = NodeConverterUtils.convert(helper, valueField, entry.getValueNode());
 builder.withBuilder(field, new ReadNodeBuildAction(helper, value, path));
addExplicitLocationField(builder, field, value);

代码示例来源:origin: com.google.api/api-compiler

private void handleNonMessageField(ConfigSource.Builder builder, FieldDescriptor field,
  Node value){
 if (field.isRepeated()) {
  SequenceNode list = NodeConverterUtils.expectList(helper, field, value);
  for (Node elem : list.getValue()) {
   Object protoValue = NodeConverterUtils.convert(helper, field, elem);
   if (protoValue != null) {
    builder.addValue(field, protoValue, helper.getLocation(elem));
   }
  }
  addExplicitLocationField(builder, field, value);
 } else {
  Object protoValue = NodeConverterUtils.convert(helper, field, value);
  if (protoValue != null) {
   builder.setValue(field, null, protoValue, helper.getLocation(value));
  }
 }
}

代码示例来源:origin: com.google.api/api-compiler

readField(builder, wrapperField, node, appendToPath(pathToNode, wrapperField.getName()));
return;
  helper.warning(node, "The field '%s' is deprecated.", field.getName());
 readField(builder, field, entry.getValueNode(), appendToPath(pathToNode, field.getName()));

代码示例来源:origin: com.google.api/api-compiler

String nestedPath = appendToPath(path, keyObj);
   helper.checkAndAddPath(nestedPath, value, field);
   builder.withBuilder(field, keyObj, new ReadNodeBuildAction(helper, entry.getValueNode(),
     appendToPath(nestedPath, keyObj)));
  } else {
   Object valueObj = NodeConverterUtils.convert(helper, valueField, entry.getValueNode());
 builder.withBuilder(field, new ReadNodeBuildAction(helper, value, path));
addExplicitLocationField(builder, field, value);

代码示例来源:origin: googleapis/api-compiler

private void handleNonMessageField(ConfigSource.Builder builder, FieldDescriptor field,
  Node value){
 if (field.isRepeated()) {
  SequenceNode list = NodeConverterUtils.expectList(helper, field, value);
  for (Node elem : list.getValue()) {
   Object protoValue = NodeConverterUtils.convert(helper, field, elem);
   if (protoValue != null) {
    builder.addValue(field, protoValue, helper.getLocation(elem));
   }
  }
  addExplicitLocationField(builder, field, value);
 } else {
  Object protoValue = NodeConverterUtils.convert(helper, field, value);
  if (protoValue != null) {
   builder.setValue(field, null, protoValue, helper.getLocation(value));
  }
 }
}

代码示例来源:origin: googleapis/api-compiler

@Override
 public void accept(Builder builder) {
  new YamlNodeReader(helper, builder, path).readNode(node);
 }
}

代码示例来源:origin: googleapis/api-compiler

private void readField(ConfigSource.Builder builder, FieldDescriptor field, Node value,
  String path) {
 if (!helper.checkAndAddPath(path, value, field)){
  return;
 }
 if (field.getType() == FieldDescriptor.Type.MESSAGE) {
  handleMessageField(builder, field, value, path);
 } else {
  handleNonMessageField(builder, field, value);
 }
}

代码示例来源:origin: com.google.api/api-compiler

new YamlNodeReader(helper, builder, "").readNode(map);
return helper.getDiag().getErrorCount() == initialErrorCount ? builder.build() : null;

代码示例来源:origin: googleapis/api-compiler

new YamlNodeReader(helper, builder, "").readNode(map);
return helper.getDiag().getErrorCount() == initialErrorCount ? builder.build() : null;

相关文章