/** * Returns the service config file location of the given named field in the (sub)message. Returns * {@link SimpleLocation#TOPLEVEL} if the location is not known. */ @Override public Location getLocationInConfig(Message message, String fieldName) { return getServiceConfigSource().getLocationInConfig(message, fieldName); }
/** * Returns the service config file location of the given named field in the (sub)message. The key * identifies the key of the map. For repeated fields, the element key is a zero-based index. * Returns {@link SimpleLocation#TOPLEVEL} if the location is not known. */ @Override public Location getLocationOfRepeatedFieldInConfig( Message message, String fieldName, Object elementKey) { return getServiceConfigSource() .getLocationOfRepeatedFieldInConfig(message, fieldName, elementKey); }
/** * Returns the service config file location of the given named field in the (sub)message. The key * identifies the key of the map. For repeated fields, the element key is a zero-based index. * Returns {@link SimpleLocation#TOPLEVEL} if the location is not known. */ @Override public Location getLocationOfRepeatedFieldInConfig( Message message, String fieldName, Object elementKey) { return getServiceConfigSource() .getLocationOfRepeatedFieldInConfig(message, fieldName, elementKey); }
/** * Returns the service config file location of the given named field in the (sub)message. Returns * {@link SimpleLocation#TOPLEVEL} if the location is not known. */ @Override public Location getLocationInConfig(Message message, String fieldName) { return getServiceConfigSource().getLocationInConfig(message, fieldName); }
/** Returns a {@link Model} generated from the {@link Service} and the additionalConfigs. */ private static Model createModel(Service service, List<FileWrapper> additionalConfigs) { Model model = Model.create(service); if (additionalConfigs != null) { List<ConfigSource> allConfigs = Lists.newArrayList(); allConfigs.add(model.getServiceConfigSource()); for (FileWrapper additionalConfig : additionalConfigs) { allConfigs.add( YamlReader.readConfig( model.getDiagReporter().getDiagCollector(), additionalConfig.getFilename(), additionalConfig.getFileContents().toStringUtf8())); } model.setConfigSources(allConfigs); } StandardSetup.registerStandardProcessors(model); StandardSetup.registerStandardConfigAspects(model); return model; } }
/** Returns a {@link Model} generated from the {@link Service} and the additionalConfigs. */ private static Model createModel(Service service, List<FileWrapper> additionalConfigs) { Model model = Model.create(service); if (additionalConfigs != null) { List<ConfigSource> allConfigs = Lists.newArrayList(); allConfigs.add(model.getServiceConfigSource()); for (FileWrapper additionalConfig : additionalConfigs) { allConfigs.add( YamlReader.readConfig( model.getDiagReporter().getDiagCollector(), additionalConfig.getFilename(), additionalConfig.getFileContents().toStringUtf8())); } model.setConfigSources(allConfigs); } StandardSetup.registerStandardProcessors(model); StandardSetup.registerStandardConfigAspects(model); return model; } }