Tabnine Logo
ContextualStatementBuilder.returnValue
Code IndexAdd Tabnine to your IDE (free)

How to use
returnValue
method
in
org.jboss.errai.codegen.builder.ContextualStatementBuilder

Best Java code snippets using org.jboss.errai.codegen.builder.ContextualStatementBuilder.returnValue (Showing top 20 results out of 315)

origin: org.jboss.errai/errai-bus

.extend()
.publicOverridesMethod("getProxy")
.append(Stmt.nestedCall(Stmt.newObject(remoteProxy.getClassDefinition())).returnValue())
.finish()
.finish();
origin: errai/errai

 @Override
 protected List<Statement> generateCreateInstanceStatements(final ClassStructureBuilder<?> bodyBlockBuilder,
     final Injectable injectable, final DependencyGraph graph, final InjectionContext injectionContext) {
  return Arrays.asList(Stmt.loadLiteral(value).returnValue());
 }
};
origin: errai/errai

@Override
protected List<Statement> generateCreateInstanceStatements(final ClassStructureBuilder<?> bodyBlockBuilder,
    final Injectable injectable, final DependencyGraph graph, final InjectionContext injectionContext) {
 return Collections.<Statement> singletonList(
     Stmt.castTo(injectable.getInjectedType(), invokeStatic(WindowInjectionContextStorage.class, "createOrGet")
         .invoke("getBean", injectable.getInjectedType().getFullyQualifiedName())).returnValue());
}
origin: errai/errai

private ObjectBuilder createJsTypeProvider(final MetaClass type) {
 return newObject(DummyJsTypeProvider.class)
  .extend()
  .publicOverridesMethod("getInstance")
  .append(nestedCall(createAnonymousImpl(type)).returnValue())
  .finish()
  .publicOverridesMethod("getName")
  .append(loadLiteral("Anti-inlining impl for: " + type.getFullyQualifiedName()).returnValue())
  .finish()
  .finish();
}
origin: errai/errai

private ObjectBuilder createAnnoImpl(final MetaClass annoType) {
 final AnonymousClassStructureBuilder builder = ObjectBuilder.newInstanceOf(annoType).extend();
 Arrays.stream(annoType.getDeclaredMethods())
    .forEach(m -> builder.publicOverridesMethod(m.getName())
        .append(castTo(m.getReturnType(), loadVariable("parameters").invoke("get", m.getName())).returnValue()).finish());
 builder.publicOverridesMethod("annotationType").append(loadLiteral(annoType).returnValue()).finish();
 return builder.finish();
}
origin: errai/errai

private void implementGetContext(final ClassStructureBuilder<?> proxyImpl, final Injectable injectable) {
 proxyImpl.publicMethod(Context.class, "getProxyContext")
      .body()
      .append(loadVariable("proxyHelper").invoke("getProxyContext").returnValue())
      .finish();
}
origin: errai/errai

private BlockBuilder<ElseBlockBuilder> updateGetMarshallerConditionalBlock(BlockBuilder<ElseBlockBuilder> getMarshallerConditionalBlock,
    final String helperMethodName) {
 getMarshallerConditionalBlock = getMarshallerConditionalBlock.finish().elseif_(StringStatement.of(helperMethodName + "(a0)", boolean.class))
     .append(Stmt.loadVariable(MARSHALLERS_VAR).invoke("get", Stmt.loadVariable("a0")).returnValue());
 return getMarshallerConditionalBlock;
}
origin: errai/errai

private void implementUnwrappedInstance(final ClassStructureBuilder<?> proxyImpl, final Injectable injectable) {
 proxyImpl.publicMethod(Object.class, "unwrap")
      .body()
      .append(loadVariable("proxyHelper").invoke("getInstance", loadVariable("this")).returnValue())
      .finish();
}
origin: org.jboss.errai/errai-marshalling

private BlockBuilder<ElseBlockBuilder> updateGetMarshallerConditionalBlock(BlockBuilder<ElseBlockBuilder> getMarshallerConditionalBlock,
    final String helperMethodName) {
 getMarshallerConditionalBlock = getMarshallerConditionalBlock.finish().elseif_(StringStatement.of(helperMethodName + "(a0)", boolean.class))
     .append(Stmt.loadVariable(MARSHALLERS_VAR).invoke("get", Stmt.loadVariable("a0")).returnValue());
 return getMarshallerConditionalBlock;
}
origin: org.jboss.errai/errai-ui

private static Statement supplierOf(final Statement value) {
 return newInstanceOf(parameterizedAs(Supplier.class, typeParametersOf(value.getType())))
     .extend()
     .publicOverridesMethod("get")
     .append(Stmt.nestedCall(value).returnValue())
     .finish()
     .finish();
}
origin: errai/errai

private static Statement supplierOf(final Statement value) {
 return newInstanceOf(parameterizedAs(Supplier.class, typeParametersOf(value.getType())))
     .extend()
     .publicOverridesMethod("get")
     .append(Stmt.nestedCall(value).returnValue())
     .finish()
     .finish();
}
origin: errai/errai

private void createPutMarshallerMethod() {
 classStructureBuilder
  .privateMethod(boolean.class, "putMarshaller", Parameter.of(String.class, "fqcn"), Parameter.of(Marshaller.class, "m"))
  .append(Stmt.loadVariable(MARSHALLERS_VAR).invoke("put", Stmt.loadVariable("fqcn"), Stmt.loadVariable("m")))
  .append(Stmt.loadLiteral(true).returnValue())
  .finish();
}
origin: org.jboss.errai/errai-marshalling

private void createPutMarshallerMethod() {
 classStructureBuilder
  .privateMethod(boolean.class, "putMarshaller", Parameter.of(String.class, "fqcn"), Parameter.of(Marshaller.class, "m"))
  .append(Stmt.loadVariable(MARSHALLERS_VAR).invoke("put", Stmt.loadVariable("fqcn"), Stmt.loadVariable("m")))
  .append(Stmt.loadLiteral(true).returnValue())
  .finish();
}
origin: org.jboss.errai/errai-cdi-shared

private static ObjectBuilder anonymousAttributeAccessorFor(final MetaMethod attr) {
 return newInstanceOf(Function.class).extend()
     .publicOverridesMethod("apply", Parameter.finalOf(Object.class, "anno"))
     .append(invokeStatic(SharedAnnotationSerializer.class, "stringify",
             castTo(attr.getDeclaringClass(), loadVariable("anno")).invoke(attr))
         .returnValue())
     .finish().finish();
}
origin: errai/errai

 @Override
 public Statement deferred(final MetaClass type, final MetaClass marshaller) {
  return
  Stmt.newObject(parameterizedAs(DeferredMarshallerCreationCallback.class, typeParametersOf(type)))
    .extend()
    .publicOverridesMethod("create", Parameter.of(Class.class, "type"))
    .append(
      Stmt.nestedCall(
        Stmt.newObject(QualifyingMarshallerWrapper.class,
          Stmt.castTo(Marshaller.class, Stmt.invokeStatic(GWT.class, "create", marshaller)), type))
        .returnValue())
    .finish()
    .finish();
 }
}
origin: errai/errai

private void implementEquals(final ClassStructureBuilder<?> proxyImpl) {
 proxyImpl.publicMethod(boolean.class, "equals", Parameter.of(Object.class, "obj")).body()
  .append(loadVariable("obj").assignValue(invokeStatic(Factory.class, "maybeUnwrapProxy", loadVariable("obj"))))
  .append(loadVariable("proxyHelper").invoke("getInstance", loadVariable("this")).invoke("equals", loadVariable("obj")).returnValue())
  .finish();
}
origin: org.jboss.errai/errai-ui

 private static Object createAccessorImpl(final MetaClass type, final String varName) {
  final MetaClass propertyType = type.getMethod("getValue", new Class[0]).getReturnType();

  return ObjectBuilder.newInstanceOf(NativeHasValueAccessors.Accessor.class)
      .extend()
      .publicMethod(Object.class, "get")
      .append(loadVariable(varName).invoke("getValue").returnValue())
      .finish()
      .publicMethod(void.class, "set", finalOf(Object.class, "value"))
      .append(loadVariable(varName).invoke("setValue", castTo(propertyType, loadVariable("value"))))
      .finish()
      .finish();
 }
}
origin: errai/errai

 private static Object createAccessorImpl(final MetaClass type, final String varName) {
  final MetaClass propertyType = type.getMethod("getValue", new Class[0]).getReturnType();

  return ObjectBuilder.newInstanceOf(NativeHasValueAccessors.Accessor.class)
      .extend()
      .publicMethod(Object.class, "get")
      .append(loadVariable(varName).invoke("getValue").returnValue())
      .finish()
      .publicMethod(void.class, "set", finalOf(Object.class, "value"))
      .append(loadVariable(varName).invoke("setValue", castTo(propertyType, loadVariable("value"))))
      .finish()
      .finish();
 }
}
origin: errai/errai

@Test
public void testDefineClassWithMethodCallingMethodOnThis() {
 final String cls = ClassBuilder.define("org.foo.Foo")
   .publicScope()
   .body()
   .publicMethod(void.class, "bar")
   .append(Stmt.loadVariable("this").invoke("foo"))
   .finish()
   .publicMethod(String.class, "foo")
   .append(Stmt.load(null).returnValue())
   .finish()
   .toJavaString();
 assertEquals("failed to generate class with method calling method on this",
   CLASS_WITH_METHOD_CALLING_METHOD_ON_THIS, cls);
}
origin: errai/errai

@Test
public void testDefineClassWithMethodCallingMethodOnSuper() {
 final String cls = ClassBuilder.define("org.foo.Foo")
   .publicScope()
   .body()
   .publicMethod(void.class, "bar")
   .append(Stmt.loadVariable("this").invoke("foo"))
   .finish()
   .publicMethod(String.class, "foo")
   .append(Stmt.loadVariable("super").invoke("toString").returnValue())
   .finish()
   .toJavaString();
 assertEquals("failed to generate class with method calling method on this",
   CLASS_WITH_METHOD_CALLING_METHOD_ON_SUPER, cls);
}
org.jboss.errai.codegen.builderContextualStatementBuilderreturnValue

Popular methods of ContextualStatementBuilder

  • invoke
  • loadField
  • foreach
  • generate
  • getType
  • if_
  • foreachIfNotNull
  • ifNot
  • switch_
  • toJavaString
  • while_
  • while_

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now