Interface Parameter

All Superinterfaces:
Variable

public interface Parameter extends Variable
Represents a method parameter. Note that the most commonly used features are inherited from the Variable interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    Indicate that this parameter is final.
    Indicate that this parameter is mandated, which means that the compiler has implicitly declared it by necessity.
    name(String name)
    Optionally assign a parameter name.
    signature(Object... components)
    Define a signature for this named parameter, which is a string for supporting generic types.
    Indicate that this parameter is synthetic, which means that it wasn't implicitly or explicitly declared.

    Methods inherited from interface Variable

    add, addAnnotation, aget, alength, and, aset, box, boxedType, cast, classType, clear, com, condy, dec, div, eq, field, ge, get, gt, ifEq, ifEq, ifEq, ifFalse, ifFalse, ifFalse, ifGe, ifGe, ifGe, ifGt, ifGt, ifGt, ifLe, ifLe, ifLe, ifLt, ifLt, ifLt, ifNe, ifNe, ifNe, ifTrue, ifTrue, ifTrue, inc, indy, instanceOf, invoke, invoke, le, lt, makerType, methodHandle, methodMaker, monitorEnter, monitorExit, mul, name, ne, neg, not, or, rem, set, setExact, shl, shr, sub, switch_, switch_, switch_, switch_, synchronized_, throw_, type, unbox, unboxedType, ushr, xor
    Modifier and Type
    Method
    Description
    add(Object value)
    Add this variable with another variable or a constant, and assign the result to a new variable.
    addAnnotation(Object annotationType, boolean visible)
    Add an annotation to this variable.
    aget(Object index)
    Access an element from this array.
    Access the length of this array.
    and(Object value)
    Compute the bitwise and of this variable with another variable or a constant, and assign the result to a new variable.
    void
    aset(Object index, Object value)
    Set an element into this array.
    box()
    Box this primitive variable into its object peer.
    Returns a boxed object type for this variable.
    cast(Object type)
    Cast this variable to another type, and assign the result to a new variable.
    default Class<?>
    Returns the type of this variable, if bound to an existing class.
    Assign a value of 0, false, or null to this variable, depending on its type.
    com()
    Compute the bitwise complement of this variable and assign the result to a new variable.
    condy(String name, Object... args)
    Specify a static bootstrap method for dynamically generating constants, as found in the class type of this variable.
    void
    dec(Object value)
    Decrement this variable with another variable or a constant, and assign the result back to this variable.
    div(Object value)
    Divide this variable with another variable or a constant, and assign the result to a new variable.
    eq(Object value)
    Determine if this variable is equal to another variable or constant, and assign the result to a new boolean variable.
    field(String name)
    Access a static or instance field from the object referred to by this variable.
    ge(Object value)
    Determine if this variable is greater than or equal to another variable or constant, and assign the result to a new boolean variable.
    get()
    Return a new variable with the same type and value as this one.
    gt(Object value)
    Determine if this variable is greater than another variable or constant, and assign the result to a new boolean variable.
    default void
    ifEq(Object value, Runnable then)
    Convenience method to generate conditional code if this variable is equal to another variable or constant.
    default void
    ifEq(Object value, Runnable then, Runnable else_)
    Convenience method to generate conditional code if this variable is equal to another variable or constant.
    void
    ifEq(Object value, Label label)
    Conditional goto if this variable is equal to another variable or constant.
    default void
    Convenience method to generate conditional code if this variable is false.
    default void
    ifFalse(Runnable then, Runnable else_)
    Convenience method to generate conditional code if this variable is false.
    void
    ifFalse(Label label)
    Conditional goto if this variable is false.
    default void
    ifGe(Object value, Runnable then)
    Convenience method to generate conditional code if this variable is greater than or equal to another variable or constant.
    default void
    ifGe(Object value, Runnable then, Runnable else_)
    Convenience method to generate conditional code if this variable is greater than or equal to another variable or constant.
    void
    ifGe(Object value, Label label)
    Conditional goto if this variable is greater than or equal to another variable or constant.
    default void
    ifGt(Object value, Runnable then)
    Convenience method to generate conditional code if this variable is greater than another variable or constant.
    default void
    ifGt(Object value, Runnable then, Runnable else_)
    Convenience method to generate conditional code if this variable is greater than another variable or constant.
    void
    ifGt(Object value, Label label)
    Conditional goto if this variable is greater than another variable or constant.
    default void
    ifLe(Object value, Runnable then)
    Convenience method to generate conditional code if this variable is less than or equal to another variable or constant.
    default void
    ifLe(Object value, Runnable then, Runnable else_)
    Convenience method to generate conditional code if this variable is less than or equal to another variable or constant.
    void
    ifLe(Object value, Label label)
    Conditional goto if this variable is less than or equal to another variable or constant.
    default void
    ifLt(Object value, Runnable then)
    Convenience method to generate conditional code if this variable is less than another variable or constant.
    default void
    ifLt(Object value, Runnable then, Runnable else_)
    Convenience method to generate conditional code if this variable is less than another variable or constant.
    void
    ifLt(Object value, Label label)
    Conditional goto if this variable is less than another variable or constant.
    default void
    ifNe(Object value, Runnable then)
    Convenience method to generate conditional code if this variable is not equal to another variable or constant.
    default void
    ifNe(Object value, Runnable then, Runnable else_)
    Convenience method to generate conditional code if this variable is not equal to another variable or constant.
    void
    ifNe(Object value, Label label)
    Conditional goto if this variable is not equal to another variable or constant.
    default void
    Convenience method to generate conditional code if this variable is true.
    default void
    ifTrue(Runnable then, Runnable else_)
    Convenience method to generate conditional code if this variable is true.
    void
    ifTrue(Label label)
    Conditional goto if this variable is true.
    void
    inc(Object value)
    Increment this variable with another variable or a constant, and assign the result back to this variable.
    indy(String name, Object... args)
    Specify a static bootstrap method for dynamically generating methods, as found in the class type of this variable.
    Determine if this variable is an instance of the given class or interface, and assign the result to a new boolean variable.
    invoke(Object returnType, String name, Object[] types, Object... values)
    Invoke a static or instance method on the object referenced by this variable.
    invoke(String name, Object... values)
    Invoke a static or instance method on the object referenced by this variable.
    le(Object value)
    Determine if this variable is less than or equal to another variable or constant, and assign the result to a new boolean variable.
    lt(Object value)
    Determine if this variable is less than another variable or constant, and assign the result to a new boolean variable.
    Returns the type of this variable, if bound to a class which is being made.
    methodHandle(Object returnType, String name, Object... types)
    Returns a MethodHandle variable which can invoke a static or instance method on the object referenced by this variable.
    Returns the MethodMaker that this variable belongs to.
    void
    Enter a synchronized block on this variable.
    void
    Exit a synchronized block on this variable.
    mul(Object value)
    Multiply this variable with another variable or a constant, and assign the result to a new variable.
    Returns the name of this variable, which is null if it's unnamed.
    ne(Object value)
    Determine if this variable is not equal to another variable or constant, and assign the result to a new boolean variable.
    neg()
    Negate the value of this variable and assign the result to a new variable.
    not()
    Compute the logical negation of this boolean variable, and assign the result to a new variable.
    or(Object value)
    Compute the bitwise or of this variable with another variable or a constant, and assign the result to a new variable.
    rem(Object value)
    Compute the division remainder of this variable with another variable or a constant, and assign the result to a new variable.
    set(Object value)
    Assign a value to this variable, either from another variable or from a constant.
    Assign an exact object instance to this variable, supported only when the class is built dynamically instead of loaded from a file.
    shl(Object value)
    Compute the bitwise left shift of this variable with another variable or a constant, and assign the result to a new variable.
    shr(Object value)
    Compute the bitwise right shift of this variable with another variable or a constant, and assign the result to a new variable.
    sub(Object value)
    Subtract this variable with another variable or a constant, and assign the result to a new variable.
    void
    switch_(Label defaultLabel, int[] cases, Label... labels)
    Generates a switch statement against this int or non-null Integer variable.
    void
    switch_(Label defaultLabel, Enum<?>[] cases, Label... labels)
    Generates a switch statement against this non-null Enum variable.
    void
    switch_(Label defaultLabel, Object[] cases, Label... labels)
    Generates a switch statement against this non-null variable, of any type.
    void
    switch_(Label defaultLabel, String[] cases, Label... labels)
    Generates a switch statement against this non-null String variable.
    void
    Convenience method for defining a synchronized block on this variable.
    void
    Throw the exception object referred to by this variable.
    Returns the type of this variable.
    Unbox this object variable into its primitive peer.
    Returns an unboxed primitive type for this variable.
    ushr(Object value)
    Compute the bitwise unsigned right shift of this variable with another variable or a constant, and assign the result to a new variable.
    xor(Object value)
    Compute the bitwise xor of this variable with another variable or a constant, and assign the result to a new variable.
  • Method Details

    • name

      Parameter name(String name)
      Optionally assign a parameter name.
      Specified by:
      name in interface Variable
      Returns:
      this parameter
      Throws:
      IllegalStateException - if already named
    • signature

      Parameter signature(Object... components)
      Define a signature for this named parameter, which is a string for supporting generic types. The components can be strings or types (class, ClassMaker, etc.), which are concatenated into a single string. Consult the JVM specification for the signature syntax.
      Specified by:
      signature in interface Variable
      Returns:
      this
      Throws:
      IllegalArgumentException - if given an unsupported component
    • final_

      Parameter final_()
      Indicate that this parameter is final.
      Returns:
      this
    • synthetic

      Parameter synthetic()
      Indicate that this parameter is synthetic, which means that it wasn't implicitly or explicitly declared.
      Returns:
      this
    • mandated

      Parameter mandated()
      Indicate that this parameter is mandated, which means that the compiler has implicitly declared it by necessity.
      Returns:
      this