Tabnine Logo
PlasticMethod.isVoid
Code IndexAdd Tabnine to your IDE (free)

How to use
isVoid
method
in
org.apache.tapestry5.plastic.PlasticMethod

Best Java code snippets using org.apache.tapestry5.plastic.PlasticMethod.isVoid (Showing top 6 results out of 315)

origin: apache/tapestry-5

  private void validateVoid(PlasticMethod method)
  {
    if (!method.isVoid())
      throw new RuntimeException(String.format(
          "Method %s is not compatible with the @HeartbeatDeferred annotation, as it is not a void method.",
          method.getMethodIdentifier()));
  }
}
origin: apache/tapestry-5

  public void work(PlasticMethod method)
  {
    boolean valid = method.isVoid() && method.getParameters().isEmpty();
    if (!valid)
    {
      throw new RuntimeException(
          String.format(
              "Method %s is invalid: methods with the @PageReset annotation must return void, and have no parameters.",
              method.getMethodIdentifier()));
    }
  }
};
origin: apache/tapestry-5

  public void work(PlasticMethod method)
  {
    if (!method.isVoid())
      throw new RuntimeException(String.format("Method %s is a lifecycle method and should return void.", method
          .getMethodIdentifier()));
    if (!method.getParameters().isEmpty())
      throw new RuntimeException(String.format("Method %s is a lifecycle method and should take no parameters.",
          method.getMethodIdentifier()));
  }
};
origin: apache/tapestry-5

private void invokeMethod(InstructionBuilder builder, PlasticMethod method)
{
  // First, tell the Event object what method is being invoked.
  builder.loadArgument(1);
  builder.loadConstant( method.getMethodIdentifier());
  builder.invoke(Event.class, void.class, "setMethodDescription", String.class);
  builder.loadThis();
  // Methods either take no parameters, or take a MarkupWriter parameter.
  if (method.getParameters().size() > 0)
  {
    builder.loadArgument(0);
  }
  builder.invokeVirtual(method);
  // Non-void methods will pass a value to the event.
  if (!method.isVoid())
  {
    builder.boxPrimitive(method.getDescription().returnType);
    builder.loadArgument(1).swap();
    builder.invoke(Event.class, boolean.class, "storeResult", Object.class);
    builder.when(Condition.NON_ZERO, JUST_RETURN);
  }
}
origin: apache/tapestry-5

  private void testFailure(MethodDescription description, String messageFragment)
  {
    PlasticMethod method = newMock(PlasticMethod.class);

    boolean isVoid = description.returnType.equals("void");
    expect(method.isVoid()).andReturn(isVoid);

    if (isVoid)
    {
      expect(method.getDescription()).andReturn(description).atLeastOnce();
    }

    expect(method.getMethodIdentifier()).andReturn("<MethodId>");

    replay();

    try
    {
      worker.deferMethodInvocations(method);
      unreachable();
    } catch (RuntimeException ex)
    {
      assertMessageContains(ex, messageFragment);
    }

    verify();
  }
}
origin: apache/tapestry-5

  public void doBuild(InstructionBuilder builder)
  {
    builder.loadArgument(0).loadConstant(method.getMethodIdentifier()).invoke(Event.class, void.class, "setMethodDescription", String.class);
    builder.loadThis();
    int count = description.argumentTypes.length;
    for (int i = 0; i < count; i++)
    {
      builder.loadThis().getField(sourceField).loadArgument(0).loadConstant(i);
      builder.invoke(EventHandlerMethodParameterSource.class, Object.class, "get",
          ComponentEvent.class, int.class);
      builder.castOrUnbox(description.argumentTypes[i]);
    }
    builder.invokeVirtual(method);
    if (!method.isVoid())
    {
      builder.boxPrimitive(description.returnType);
      builder.loadArgument(0).swap();
      builder.invoke(Event.class, boolean.class, "storeResult", Object.class);
      // storeResult() returns true if the method is aborted. Return true since, certainly,
      // a method was invoked.
      builder.when(Condition.NON_ZERO, RETURN_TRUE);
    }
    // Set the result to true, to indicate that some method was invoked.
    builder.loadConstant(true).storeVariable(resultVariable);
  }
});
org.apache.tapestry5.plasticPlasticMethodisVoid

Javadoc

Returns true if this method is type void.

Popular methods of PlasticMethod

  • addAdvice
    Adds advice to the method. Adding advice implicitly rewrites the implementation of the method (this
  • changeImplementation
    Clears the instructions for this method, and creates a new empty InstructionBuilder so that the impl
  • delegateTo
    Much like #delegateTo(PlasticField), but the object to delegate to is dynamically computed by anothe
  • getDescription
    Returns a representation of the method's name, return value, argument types, etc.
  • getAnnotation
  • getPlasticClass
    Returns the PlasticClass containing this method.
  • hasAnnotation
  • getMethodIdentifier
    Returns a short identifier for the method that includes the class name, the method name, and the typ
  • getHandle
    Returns a handle that can be used to invoke a method of a transformed class instance.
  • getParameters
    Returns access to the parameters of the method and, in particular, the visible annotations on those
  • isOverride
    Returns true if the method is an override of a method from the parent class.
  • isOverride

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Top Sublime Text plugins
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