本文整理了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
暂无
代码示例来源: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()));
内容来源于网络,如有侵权,请联系作者删除!