gpt4 book ai didi

com.google.api.tools.framework.yaml.YamlReaderHelper.getLocation()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 18:53:31 26 4
gpt4 key购买 nike

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

YamlReaderHelper.getLocation介绍

暂无

代码示例

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

/** This is mainly to add location for container fields like repeated or message fields. */
private void addExplicitLocationField(
  ConfigSource.Builder builder, FieldDescriptor field, Node value) {
 // This allows us to do get location of repeated/message field inside service config. Example:
 //   name: "test.googleapis.com"
 //   discovery:
 //     public_discovery: true
 // Without this code, we will only be able to get location of primitive types inside a message
 // type and we won't be able to do something like: getLocation(serviceObject, "discovery")
 builder.addLocation(field, null, helper.getLocation(value));
}

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

/** This is mainly to add location for container fields like repeated or message fields. */
private void addExplicitLocationField(
  ConfigSource.Builder builder, FieldDescriptor field, Node value) {
 // This allows us to do get location of repeated/message field inside service config. Example:
 //   name: "test.googleapis.com"
 //   discovery:
 //     public_discovery: true
 // Without this code, we will only be able to get location of primitive types inside a message
 // type and we won't be able to do something like: getLocation(serviceObject, "discovery")
 builder.addLocation(field, null, helper.getLocation(value));
}

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

public void error(Mark mark, String message, Object... params) {
 error(getLocation(mark), message, params);
}

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

public Location getLocation(Node node) {
 return getLocation(node.getStartMark());
}

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

public void error(Mark mark, String message, Object... params) {
 error(getLocation(mark), message, params);
}

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

public Location getLocation(Node node) {
 return getLocation(node.getStartMark());
}

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

public void error(Node node, String message, Object... params) {
 error(getLocation(node.getStartMark()), message, params);
}

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

public void warning(Node node, String message, Object... params) {
 diag.addDiag(Diag.warning(getLocation(node), message, params));
}

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

public void error(Node node, String message, Object... params) {
 error(getLocation(node.getStartMark()), message, params);
}

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

public void warning(Node node, String message, Object... params) {
 diag.addDiag(Diag.warning(getLocation(node), message, params));
}

代码示例来源: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: 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

Object valueObj = NodeConverterUtils.convert(helper, valueField, entry.getValueNode());
if (valueObj != null) {
 builder.setValue(field, keyObj, valueObj, helper.getLocation(entry.getValueNode()));

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

Object valueObj = NodeConverterUtils.convert(helper, valueField, entry.getValueNode());
if (valueObj != null) {
 builder.setValue(field, keyObj, valueObj, helper.getLocation(entry.getValueNode()));

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com