Search in sources :

Example 1 with Enum

use of io.protostuff.compiler.model.Enum in project java-chassis by ServiceComb.

the class ProtoToStringGenerator method protoToString.

public String protoToString() {
    StringBuilder sb = new StringBuilder();
    appendLine(sb, "syntax = \"%s\";", proto.getSyntax());
    for (Import importValue : proto.getImports()) {
        appendLine(sb, "import \"%s\";", importValue.getValue());
    }
    appendLine(sb, "package %s;\n", proto.getPackage().getValue());
    for (Message message : proto.getMessages()) {
        messageToString(message, sb);
    }
    for (Enum enumValue : proto.getEnums()) {
        enumToString(enumValue, sb);
    }
    for (Service service : proto.getServices()) {
        serviceToString(service, sb);
    }
    return sb.toString();
}
Also used : Enum(io.protostuff.compiler.model.Enum) Import(io.protostuff.compiler.model.Import) Message(io.protostuff.compiler.model.Message) Service(io.protostuff.compiler.model.Service)

Example 2 with Enum

use of io.protostuff.compiler.model.Enum in project incubator-servicecomb-java-chassis by apache.

the class ProtoToStringGenerator method protoToString.

public String protoToString() {
    StringBuilder sb = new StringBuilder();
    appendLine(sb, "syntax = \"%s\";", proto.getSyntax());
    for (Import importValue : proto.getImports()) {
        appendLine(sb, "import \"%s\";", importValue.getValue());
    }
    appendLine(sb, "package %s;\n", proto.getPackage().getValue());
    for (Message message : proto.getMessages()) {
        messageToString(message, sb);
    }
    for (Enum enumValue : proto.getEnums()) {
        enumToString(enumValue, sb);
    }
    for (Service service : proto.getServices()) {
        serviceToString(service, sb);
    }
    return sb.toString();
}
Also used : Enum(io.protostuff.compiler.model.Enum) Import(io.protostuff.compiler.model.Import) Message(io.protostuff.compiler.model.Message) Service(io.protostuff.compiler.model.Service)

Aggregations

Enum (io.protostuff.compiler.model.Enum)2 Import (io.protostuff.compiler.model.Import)2 Message (io.protostuff.compiler.model.Message)2 Service (io.protostuff.compiler.model.Service)2