Examples of SourceWriter


Examples of com.google.gwt.user.rebind.SourceWriter

  @Override
  void toJS(FragmentGeneratorContext context) throws UnableToCompleteException {
    context.parentLogger.branch(TreeLogger.DEBUG,
        "Building string value setter statement", null);
    SourceWriter sw = context.sw;

    sw.print(context.parameterName);
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.SourceWriter

    sw.print(context.parameterName);
  }

  @Override
  void writeExtractorJSNIReference(FragmentGeneratorContext context) {
    SourceWriter sw = context.sw;
    sw.print("@com.google.gwt.jsio.client.impl.JSONWrapperUtil::STRING_EXTRACTOR");
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.SourceWriter

* Encapsulates accessors for JSWrapper properties.
*/
class JSWrapperFragmentGenerator extends FragmentGenerator {
  protected void writeJSNIObjectCreator(FragmentGeneratorContext context)
      throws UnableToCompleteException {
    SourceWriter sw = context.sw;
    JClassType returnType = context.returnType.isClassOrInterface().getErasedType();

    sw.print("@");
    sw.print(context.qualifiedTypeName);
    sw.print("::");
    sw.print("__create__");
    sw.print(returnType.getQualifiedSourceName().replaceAll("\\.", "_"));
    sw.print("()()");
    sw.print(".@com.google.gwt.jsio.client.JSWrapper::setJavaScriptObject(Lcom/google/gwt/core/client/JavaScriptObject;)(");
    sw.print(context.parameterName);
    sw.print(")");

    context.creatorFixups.add(returnType);
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.SourceWriter

    context.creatorFixups.add(returnType);
  }

  protected void writeJSNIValue(FragmentGeneratorContext context)
      throws UnableToCompleteException {
    SourceWriter sw = context.sw;
    sw.print(".@com.google.gwt.jsio.client.JSWrapper::getJavaScriptObject()()");
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.SourceWriter

  @Override
  final void fromJS(FragmentGeneratorContext context)
      throws UnableToCompleteException {
    context.parentLogger.branch(TreeLogger.DEBUG,
        "Building string value getter statement", null);
    SourceWriter sw = context.sw;

    // arg == null ? null : (arg.__gwtPeer || <new object>.setJSO(arg));

    sw.print(context.parameterName);
    sw.print(" == null ? null : ");
    sw.print("(");
    sw.print(context.parameterName);
    sw.print(".");
    sw.print(JSWrapperGenerator.BACKREF);
    sw.print(" || ");
    writeJSNIObjectCreator(context);
    sw.print(")");
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.SourceWriter

  @Override
  final void toJS(FragmentGeneratorContext context)
      throws UnableToCompleteException {
    context.parentLogger.branch(TreeLogger.DEBUG,
        "Building string value setter statement", null);
    SourceWriter sw = context.sw;
    sw.print(context.parameterName);
    sw.print(" == null ? null : ");
    sw.print(context.parameterName);
    writeJSNIValue(context);
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.SourceWriter

  }

  @Override
  void writeExtractorJSNIReference(FragmentGeneratorContext context)
      throws UnableToCompleteException {
    SourceWriter sw = context.sw;
    JClassType elementType = context.returnType.isClassOrInterface().getErasedType();

    sw.print("@");
    sw.print(context.qualifiedTypeName);
    sw.print("::");
    sw.print("__create__");
    sw.print(elementType.getQualifiedSourceName().replaceAll("\\.", "_"));
    sw.print("()().@com.google.gwt.jsio.client.JSWrapper::getExtractor()()");

    context.creatorFixups.add(elementType);
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.SourceWriter

  @Override
  void toJS(FragmentGeneratorContext context) throws UnableToCompleteException {
    context.parentLogger.branch(TreeLogger.DEBUG,
        "Building string value setter statement", null);
    SourceWriter sw = context.sw;
    sw.print("eval(");
    sw.print(context.parameterName);
    sw.print(".@com.google.gwt.jsio.client.JSOpaque::reference)");
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.SourceWriter

  }

  @Override
  void writeExtractorJSNIReference(FragmentGeneratorContext context)
      throws UnableToCompleteException {
    SourceWriter sw = context.sw;
    sw.print("@com.google.gwt.jsio.client.impl.JSONWrapperUtil::JSOPAQUE_EXTRACTOR");
  }
View Full Code Here

Examples of com.google.gwt.user.rebind.SourceWriter

                composerFactory.addImport(Serializer.class.getName());
                composerFactory.addImport(SerializationException.class.getName());
                composerFactory.addImport(Serializable.class.getName());

                composerFactory.setSuperclass(typeName);
                SourceWriter sourceWriter = composerFactory.createSourceWriter(context, printWriter);
                sourceWriter.print("private Serializer SERIALIZER = new " + realize + "();");
                sourceWriter.print("protected Serializer getRPCSerializer() {return SERIALIZER;}");
                sourceWriter.commit(logger);

            } catch (NotFoundException e) {
                logger.log(TreeLogger.ERROR, "", e);
                throw new UnableToCompleteException();
            }
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.