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

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

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

origin: apache/tapestry-5

  public boolean accept(PlasticMethod method)
  {
    return method.getDescription().argumentTypes.length == 0
        && method.getDescription().methodName.equalsIgnoreCase(methodName);
  }
};
origin: org.got5/tapestry5-jquery

  public boolean accept(PlasticMethod method)
  {
    return "getClientId".equalsIgnoreCase(method.getDescription().methodName);
  }
});
origin: apache/tapestry-5

private boolean hasCorrectPrefix(PlasticMethod method)
{
  return method.getDescription().methodName.startsWith("on");
}
origin: apache/tapestry-5

  public boolean accept(PlasticMethod method)
  {
    return method.getDescription().methodName.equalsIgnoreCase(methodAlias)
        || method.hasAnnotation(methodAnnotationClass);
  }
};
origin: apache/tapestry-5

  public boolean accept(PlasticMethod method)
  {
    return !method.isOverride() && !lifecycleMethods.contains(method.getDescription());
  }
});
origin: apache/tapestry-5

  public boolean accept(PlasticMethod method)
  {
    return method.getDescription().methodName.equalsIgnoreCase("pageReset") ||
        method.hasAnnotation(PageReset.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

private Class categorizeMethod(PlasticMethod method)
{
  for (Class annotationClass : annotationToDescription.keySet())
  {
    if (method.hasAnnotation(annotationClass))
      return annotationClass;
  }
  return nameToAnnotation.get(method.getDescription().methodName);
}
origin: apache/tapestry-5

private void validateAsRenderPhaseMethod(PlasticMethod method)
{
  final String[] argumentTypes = method.getDescription().argumentTypes;
  switch (argumentTypes.length)
  {
    case 0:
      break;
    case 1:
      if (argumentTypes[0].equals(MarkupWriter.class.getName()))
        break;
    default:
      throw new RuntimeException(
          String.format(
              "Method %s is not a valid render phase method: it should take no parameters, or take a single parameter of type MarkupWriter.",
              method.toString()));
  }
}
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

EventHandlerMethod(PlasticMethod method)
{
  this.method = method;
  description = method.getDescription();
  parameterSource = buildSource();
  String methodName = method.getDescription().methodName;
  OnEvent onEvent = method.getAnnotation(OnEvent.class);
  eventType = extractEventType(methodName, onEvent);
  componentId = extractComponentId(methodName, onEvent);
  
  publishEvent = method.getAnnotation(PublishEvent.class);
}
origin: apache/tapestry-5

final MethodDescription providerDescriptor = delegateProvidingMethod.getDescription();
final String delegateType = providerDescriptor.returnType;
origin: org.apache.tapestry/plastic

final MethodDescription providerDescriptor = delegateProvidingMethod.getDescription();
final String delegateType = providerDescriptor.returnType;
origin: org.apache.tapestry/plastic

@Override
public InstructionBuilder invokeVirtual(PlasticMethod method)
{
  check();
  assert method != null;
  MethodDescription description = method.getDescription();
  return invokeVirtual(method.getPlasticClass().getClassName(), description.returnType, description.methodName,
      description.argumentTypes);
}
origin: apache/tapestry-5

@Override
public InstructionBuilder invokeVirtual(PlasticMethod method)
{
  check();
  assert method != null;
  MethodDescription description = method.getDescription();
  return invokeVirtual(method.getPlasticClass().getClassName(), description.returnType, description.methodName,
      description.argumentTypes);
}
origin: apache/tapestry-5

final FieldHandle bindingFieldHandle = plasticClass.introduceField(Binding.class, "cache$watchBinding$" + method.getDescription().methodName).getHandle();
origin: apache/tapestry-5

private void decorateMethodWithOperation(PlasticClass componentClass, MutableComponentModel model,
                     PlasticMethod method, String[] paths, Worker<Asset> operation)
{
  if (paths.length == 0)
  {
    return;
  }
  String[] expandedPaths = expandPaths(paths);
  PlasticField assetListField = componentClass.introduceField(Asset[].class,
      "importedAssets_" + method.getDescription().methodName);
  initializeAssetsFromPaths(expandedPaths, assetListField, model.getLibraryName());
  addMethodAssetOperationAdvice(method, assetListField.getHandle(), operation);
}
origin: apache/tapestry-5

private void adviseMethod(PlasticClass plasticClass, PlasticMethod method)
{
  // Every instance of the clas srequires its own per-thread value. This handles the case of multiple
  // pages containing the component, or the same page containing the component multiple times.
  PlasticField cacheField =
      plasticClass.introduceField(PerThreadValue.class, "cache$" + method.getDescription().methodName);
  cacheField.injectComputed(new ComputedValue<PerThreadValue>()
  {
    public PerThreadValue get(InstanceContext context)
    {
      // Each instance will get a new PerThreadValue
      return perThreadManager.createValue();
    }
  });
  Cached annotation = method.getAnnotation(Cached.class);
  MethodResultCacheFactory factory = createFactory(plasticClass, annotation.watch(), method);
  MethodAdvice advice = createAdvice(cacheField, factory);
  method.addAdvice(advice);
}
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();
  }
}
org.apache.tapestry5.plasticPlasticMethodgetDescription

Javadoc

Returns a representation of the method's name, return value, argument types, etc.

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
  • 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
  • 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

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ImageIO (javax.imageio)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • CodeWhisperer alternatives
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