Package org.chromium.sdk.internal.protocolparser.dynamicimpl.JavaCodeGenerator

Examples of org.chromium.sdk.internal.protocolparser.dynamicimpl.JavaCodeGenerator.MethodScope.startLine()


      MethodScope scope = classScope.newMethodScope();

      scope.indentRight();

      scope.startLine("");
      quickParser.appendFinishedValueTypeNameJava(scope);
      scope.append(" result;\n");

      boolean wrap = quickParser.javaCodeThrowsException() || !isOptional;
      if (wrap) {
View Full Code Here


      quickParser.appendFinishedValueTypeNameJava(scope);
      scope.append(" result;\n");

      boolean wrap = quickParser.javaCodeThrowsException() || !isOptional;
      if (wrap) {
        scope.startLine("try {\n");
        scope.indentRight();
      }

      String valueRef = scope.newMethodScopedName("value");
      String hasValueRef = scope.newMethodScopedName("hasValue");
View Full Code Here

      }

      String valueRef = scope.newMethodScopedName("value");
      String hasValueRef = scope.newMethodScopedName("hasValue");
      Util.writeReadValueAndHasValue(scope, fieldName, "underlying", valueRef, hasValueRef);
      scope.startLine("if (" + hasValueRef + ") {\n");
      scope.indentRight();
      if (quickParser.javaCodeThrowsException()) {
        scope.startLine("try {\n");
        scope.indentRight();
        quickParser.writeParseQuickCode(scope, valueRef, "r1");
View Full Code Here

      String hasValueRef = scope.newMethodScopedName("hasValue");
      Util.writeReadValueAndHasValue(scope, fieldName, "underlying", valueRef, hasValueRef);
      scope.startLine("if (" + hasValueRef + ") {\n");
      scope.indentRight();
      if (quickParser.javaCodeThrowsException()) {
        scope.startLine("try {\n");
        scope.indentRight();
        quickParser.writeParseQuickCode(scope, valueRef, "r1");
        scope.startLine("result = r1;\n");
        scope.indentLeft();
        scope.startLine("} catch (" + Util.BASE_PACKAGE + ".JsonProtocolParseException e) {\n");
View Full Code Here

      scope.indentRight();
      if (quickParser.javaCodeThrowsException()) {
        scope.startLine("try {\n");
        scope.indentRight();
        quickParser.writeParseQuickCode(scope, valueRef, "r1");
        scope.startLine("result = r1;\n");
        scope.indentLeft();
        scope.startLine("} catch (" + Util.BASE_PACKAGE + ".JsonProtocolParseException e) {\n");
        scope.startLine("  throw new " + Util.BASE_PACKAGE + ".JsonProtocolParseException(" +
            "\"Failed to parse field " + fieldName + " in type ");
        scope.append(typeClass.getName() + "\", e);\n");
View Full Code Here

        scope.startLine("try {\n");
        scope.indentRight();
        quickParser.writeParseQuickCode(scope, valueRef, "r1");
        scope.startLine("result = r1;\n");
        scope.indentLeft();
        scope.startLine("} catch (" + Util.BASE_PACKAGE + ".JsonProtocolParseException e) {\n");
        scope.startLine("  throw new " + Util.BASE_PACKAGE + ".JsonProtocolParseException(" +
            "\"Failed to parse field " + fieldName + " in type ");
        scope.append(typeClass.getName() + "\", e);\n");
        scope.startLine("}\n");
      } else {
View Full Code Here

        scope.indentRight();
        quickParser.writeParseQuickCode(scope, valueRef, "r1");
        scope.startLine("result = r1;\n");
        scope.indentLeft();
        scope.startLine("} catch (" + Util.BASE_PACKAGE + ".JsonProtocolParseException e) {\n");
        scope.startLine("  throw new " + Util.BASE_PACKAGE + ".JsonProtocolParseException(" +
            "\"Failed to parse field " + fieldName + " in type ");
        scope.append(typeClass.getName() + "\", e);\n");
        scope.startLine("}\n");
      } else {
        quickParser.writeParseQuickCode(scope, valueRef, "r1");
View Full Code Here

        scope.indentLeft();
        scope.startLine("} catch (" + Util.BASE_PACKAGE + ".JsonProtocolParseException e) {\n");
        scope.startLine("  throw new " + Util.BASE_PACKAGE + ".JsonProtocolParseException(" +
            "\"Failed to parse field " + fieldName + " in type ");
        scope.append(typeClass.getName() + "\", e);\n");
        scope.startLine("}\n");
      } else {
        quickParser.writeParseQuickCode(scope, valueRef, "r1");
        scope.startLine("result = r1;\n");
      }
      scope.indentLeft();
View Full Code Here

            "\"Failed to parse field " + fieldName + " in type ");
        scope.append(typeClass.getName() + "\", e);\n");
        scope.startLine("}\n");
      } else {
        quickParser.writeParseQuickCode(scope, valueRef, "r1");
        scope.startLine("result = r1;\n");
      }
      scope.indentLeft();
      scope.startLine("} else {\n");
      scope.indentRight();
      if (isOptional) {
View Full Code Here

      } else {
        quickParser.writeParseQuickCode(scope, valueRef, "r1");
        scope.startLine("result = r1;\n");
      }
      scope.indentLeft();
      scope.startLine("} else {\n");
      scope.indentRight();
      if (isOptional) {
        scope.startLine("result = null;\n");
      } else {
        scope.startLine("throw new " + Util.BASE_PACKAGE + ".JsonProtocolParseException(" +
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.