Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tapestry5.plastic
Class MethodDescription

    java.lang.Object
      org.apache.tapestry5.plastic.MethodDescription

All Implemented Interfaces:
  java.lang.Comparable<MethodDescription>

    public class MethodDescription

extends java.lang.Object
implements java.lang.Comparable<MethodDescription>

Describes a `PlasticMethod` in terms of a method name, a set of modifiers (public, private, static, final, etc.), a return type, types of method arguments, and types of checked exceptions. Types are represented as Java source names: either names of primitives ("void", "byte", "long") or fully qualified class names ("java.lang.Object", "java.lang.Runnable"). ASM refers to this as "class name".

MethodDescriptions are immutable, and properly implement equals() and hashCode(); they are often used as keys in Maps.

The natural sort order for a MethodDescription is ascending order by method name, then descending order by number of parameters (for the same name). Sort order is not currently specified for overrides of the same method with the same number of parameters.

TODO: Handling generic types.

Field Summary
`java.lang.String[]` | `argumentTypes` A non-null array of Java source names for arguments.
`java.lang.String[]` | `checkedExceptionTypes` A non-null array of Java source names for checked exceptions.
`java.lang.String` | `genericSignature`
`java.lang.String` | `methodName` The name of the method.
`int` | `modifiers` The full set of modifier flags for the method.
`java.lang.String` | `returnType` The Java source name for the return type, e.g., "void", "short", "java.util.Map", "java.lang.String[]".

Constructor Summary
`MethodDescription(int modifiers, java.lang.String returnType, java.lang.String methodName, java.lang.String[] argumentTypes, java.lang.String genericSignature, java.lang.String[] checkedExceptionTypes)`
`MethodDescription(java.lang.reflect.Method method)` Creates a MethodDescription from a Java Method.
`MethodDescription(java.lang.String returnType, java.lang.String methodName, java.lang.String... argumentTypes)` Convenience constructor for public methods that have no checked exceptions.

Method Summary
`int` | `compareTo(MethodDescription o)`
`boolean` | `equals(java.lang.Object obj)`
`int` | `hashCode()`
`java.lang.String` | `toShortString()` A string used to identify the method, containing just the method name and argument types (but ignoring visibility, return type and thrown exceptions).
`java.lang.String` | `toString()`
`MethodDescription` | `withModifiers(int newModifiers)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### modifiers

    public final int modifiers

  The full set of modifier flags for the method.

### returnType

    public final java.lang.String returnType

  The Java source name for the return type, e.g., "void", "short", "java.util.Map", "java.lang.String[]".

### methodName

    public final java.lang.String methodName

  The name of the method.

### genericSignature

    public final java.lang.String genericSignature

### argumentTypes

    public final java.lang.String[] argumentTypes

  A non-null array of Java source names for arguments. Do not modify the contents of this array.

### checkedExceptionTypes

    public final java.lang.String[] checkedExceptionTypes

  A non-null array of Java source names for checked exceptions. Do not modify the contents of this array.

Constructor Detail

### MethodDescription

    public MethodDescription(java.lang.String returnType,
                             java.lang.String methodName,
                             java.lang.String... argumentTypes)

  Convenience constructor for public methods that have no checked exceptions.

  Parameters:
    `returnType` - return type as type name
    `methodName` - name of method
    `argumentTypes` - type names for arguments

### MethodDescription

    public MethodDescription(int modifiers,
                             java.lang.String returnType,
                             java.lang.String methodName,
                             java.lang.String[] argumentTypes,
                             java.lang.String genericSignature,
                             java.lang.String[] checkedExceptionTypes)

Parameters:
  `modifiers` -
  `returnType` - Java source name for the return type
  `methodName` -
  `argumentTypes` - may be null
  `genericSignature` - TODO
  `checkedExceptionTypes` - may be null

### MethodDescription

    public MethodDescription(java.lang.reflect.Method method)

  Creates a MethodDescription from a Java Method. The generic signature will be null.

Method Detail

### withModifiers

    public MethodDescription withModifiers(int newModifiers)

### compareTo

    public int compareTo(MethodDescription o)

  Specified by:
    `compareTo` in interface `java.lang.Comparable<MethodDescription>`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object obj)

  Overrides:
    `equals` in class `java.lang.Object`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### toShortString

    public java.lang.String toShortString()

  A string used to identify the method, containing just the method name and argument types (but ignoring visibility, return type and thrown exceptions).

  Returns:
    method identifier

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 The Apache Software Foundation.