/** Returns the proto file at {@code path}, or null if this schema has no such file. */ public ProtoFile protoFile(String path) { for (ProtoFile protoFile : protoFiles) { if (protoFile.location().path().equals(path)) { return protoFile; } } return null; }
@Override public String toString() { return location().path(); }
/** * Returns the name of this proto file, like {@code simple_message} for {@code * squareup/protos/person/simple_message.proto}. */ public String name() { String result = location().path(); int slashIndex = result.lastIndexOf('/'); if (slashIndex != -1) { result = result.substring(slashIndex + 1); } if (result.endsWith(".proto")) { result = result.substring(0, result.length() - ".proto".length()); } return result; }
public Profile load() throws IOException { Set<Location> protoLocations = new LinkedHashSet<>(); for (ProtoFile protoFile : schema.protoFiles()) { protoLocations.add(protoFile.location()); } Multimap<Path, String> pathsToAttempt = pathsToAttempt(protoLocations); ImmutableList<ProfileFileElement> profileFiles = loadProfileFiles(pathsToAttempt); Profile profile = new Profile(profileFiles); validate(schema, profileFiles); return profile; }
if (!protoFilesList.isEmpty() && !protoFilesList.contains(protoFile.location().path())) { continue; // Don't emit anything for files not explicitly compiled.
/** Returns the proto file at {@code path}, or null if this schema has no such file. */ public ProtoFile protoFile(String path) { for (ProtoFile protoFile : protoFiles) { if (protoFile.location().path().equals(path)) { return protoFile; } } return null; }
/** Returns the proto file at {@code path}, or null if this schema has no such file. */ public ProtoFile protoFile(String path) { for (ProtoFile protoFile : protoFiles) { if (protoFile.location().path().equals(path)) { return protoFile; } } return null; }
@Override public String toString() { return location().path(); }
@Override public String toString() { return location().path(); }
/** * Returns the name of this proto file, like {@code simple_message} for {@code * squareup/protos/person/simple_message.proto}. */ public String name() { String result = location().path(); int slashIndex = result.lastIndexOf('/'); if (slashIndex != -1) { result = result.substring(slashIndex + 1); } if (result.endsWith(".proto")) { result = result.substring(0, result.length() - ".proto".length()); } return result; }
/** * Returns the name of this proto file, like {@code simple_message} for {@code * squareup/protos/person/simple_message.proto}. */ public String name() { String result = location().path(); int slashIndex = result.lastIndexOf('/'); if (slashIndex != -1) { result = result.substring(slashIndex + 1); } if (result.endsWith(".proto")) { result = result.substring(0, result.length() - ".proto".length()); } return result; }
public Profile load() throws IOException { Set<Location> protoLocations = new LinkedHashSet<>(); for (ProtoFile protoFile : schema.protoFiles()) { protoLocations.add(protoFile.location()); } Multimap<Path, String> pathsToAttempt = pathsToAttempt(protoLocations); ImmutableList<AbstractProfileFileElement> profileFiles = loadProfileFiles(pathsToAttempt); Profile profile = new Profile(profileFiles); validate(schema, profileFiles); return profile; }