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

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


      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");
        scope.startLine("}\n");
View Full Code Here


        scope.startLine("}\n");
      } 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 {
View Full Code Here

        scope.startLine("result = null;\n");
      } else {
        scope.startLine("throw new " + Util.BASE_PACKAGE + ".JsonProtocolParseException(" +
            "\"Field is not optional: " + fieldName + "\");\n");
      }
      scope.indentLeft();
      scope.startLine("}\n");

      if (wrap) {
        scope.indentLeft();
        scope.startLine("} catch (" + Util.BASE_PACKAGE + ".JsonProtocolParseException e) {\n");
View Full Code Here

      }
      scope.indentLeft();
      scope.startLine("}\n");

      if (wrap) {
        scope.indentLeft();
        scope.startLine("} catch (" + Util.BASE_PACKAGE + ".JsonProtocolParseException e) {\n");
        scope.startLine("  throw new " + Util.BASE_PACKAGE +
            ".implutil.CommonImpl.ParseRuntimeException(" +
            "\"On demand parsing failed for \" + underlying, e);\n");
        scope.startLine("}\n");
View Full Code Here

            ".implutil.CommonImpl.ParseRuntimeException(" +
            "\"On demand parsing failed for \" + underlying, e);\n");
        scope.startLine("}\n");
      }
      scope.startLine("return result;\n");
      scope.indentLeft();
      scope.startLine("}\n");
    }
  }

  /**
 
View Full Code Here

      scope.startLine("if (" + parseResultRef + " != null) {\n");
      scope.indentRight();
      getFieldBinding().writeSetAndGetJava(scope, parseResultRef, "cachedResult");
      scope.startLine(parseResultRef + " = cachedResult;\n");
      scope.indentLeft();
      scope.startLine("}\n");

      scope.startLine("return " + parseResultRef + ";\n");

      scope.indentLeft();
View Full Code Here

      scope.indentLeft();
      scope.startLine("}\n");

      scope.startLine("return " + parseResultRef + ";\n");

      scope.indentLeft();
      scope.startLine("}\n");
    }

    protected abstract void writeParseJava(MethodScope scope, String parseResultRef);
  }
View Full Code Here

      if (algCasesData != null) {
        algCasesData.writeConstructorCodeJava(methodScope);
      }

      methodScope.indentLeft();

    }

    classScope.startLine("}\n");
View Full Code Here

        methodScope.startLine("    return false;\n");
        methodScope.startLine("  }\n");
        methodScope.startLine("}\n");
      }
      methodScope.startLine("return true;\n");
      methodScope.indentLeft();
      methodScope.startLine("}\n");
    }

    @Override
    void writeParseMethodJava(ClassScope scope, String valueTypeName, String inputRef) {
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.