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

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

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

origin: apache/tapestry-5

private EventHandlerMethodParameterProvider createQueryParameterProvider(PlasticMethod method, final int parameterIndex, final String parameterName,
                                     final String parameterTypeName, final boolean allowBlank)
  final String methodIdentifier = method.getMethodIdentifier();
origin: apache/tapestry-5

  private void validateMethod(PlasticMethod method)
  {
    MethodDescription description = method.getDescription();

    if (description.returnType.equals("void"))
      throw new IllegalArgumentException(String.format(
          "Method %s may not be used with @Cached because it returns void.", method.getMethodIdentifier()));

    if (description.argumentTypes.length != 0)
      throw new IllegalArgumentException(String.format(
          "Method %s may not be used with @Cached because it has parameters.", method.getMethodIdentifier()));
  }
}
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 ComponentIdValidator map(EventHandlerMethod element)
  {
    if (element.componentId.equals(""))
    {
      return null;
    }
    return new ComponentIdValidator(element.componentId, element.method.getMethodIdentifier());
  }
}).removeNulls().toArray(ComponentIdValidator.class);
origin: apache/tapestry-5

private void validateNoCheckedExceptions(PlasticMethod method)
{
  if (method.getDescription().checkedExceptionTypes.length > 0)
    throw new RuntimeException(
        String.format(
            "Method %s is not compatible with the @HeartbeatDeferred annotation, as it throws checked exceptions.",
            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

  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

return new EventHandlerMethodParameterSource(method.getMethodIdentifier(), operationTracker, providerArray);
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

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

  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.plasticPlasticMethodgetMethodIdentifier

Javadoc

Returns a short identifier for the method that includes the class name, the method name, and the types of all parameters. This is often used when producing debugging output about the method.

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
  • isVoid
    Returns true if this method is type void.
  • 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

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Runner (org.openjdk.jmh.runner)
  • 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