org.glassfish.pfl.dynamic.codegen.spi
Class Signature

java.lang.Object
  extended by org.glassfish.pfl.dynamic.codegen.spi.Signature

@Immutable
public final class Signature
extends Object

Represents the signature of a method, which is sometimes needed for selecting the correct method.

Author:
Ken Cavanaugh

Method Summary
 List<Type> argTypes()
           
 void checkCompatibility(Type targetType, String ident, List<Expression> args)
          Check whether the list of expression in args is statically compatible with this Signature.
 void checkConstructorCompatibility(Type targetType, List<Expression> args)
          Check whether the list of expression in args is statically compatible with this Signature.
 void checkStaticCompatibility(Type targetType, String ident, List<Expression> args)
          Check whether the list of expression in args is statically compatible with this Signature.
 String displayAsMethod()
           
 String displayAsMethod(String methodName)
           
 boolean equals(Object obj)
           
static Signature fromCall(Type type, String ident, List<Expression> exprs)
           
static Signature fromCallUsingTypes(Type type, String ident, List<Type> types)
           
static Signature fromConstructor(Type type, List<Expression> exprs)
           
static Signature fromConstructorUsingTypes(Type type, List<Type> types)
           
static Signature fromStaticCall(Type type, String ident, List<Expression> exprs)
           
static Signature fromStaticCallUsingTypes(Type type, String ident, List<Type> types)
           
 int hashCode()
           
static Signature make(Type rtype, List<Type> types)
           
 Type returnType()
           
 String signature()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

make

public static Signature make(Type rtype,
                             List<Type> types)

returnType

public Type returnType()

argTypes

public List<Type> argTypes()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

signature

public String signature()

displayAsMethod

public String displayAsMethod()

displayAsMethod

public String displayAsMethod(String methodName)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

checkCompatibility

public void checkCompatibility(Type targetType,
                               String ident,
                               List<Expression> args)
Check whether the list of expression in args is statically compatible with this Signature. This means that args and this.types have the same length, and the type of each expression in args is assignment compatible with the corresponding types in this.types. Also, the targetType must actually contain a non-static method of the appropriate signature and name.

Throws:
IllegalArgumentException - if args is not compatible with this.types.

checkStaticCompatibility

public void checkStaticCompatibility(Type targetType,
                                     String ident,
                                     List<Expression> args)
Check whether the list of expression in args is statically compatible with this Signature. This means that args and this.types have the same length, and the type of each expression in args is assignment compatible with the corresponding types in this.types. Also, the targetType must actually contain a static method of the appropriate signature and name.

Throws:
IllegalArgumentException - if args is not compatible with this.types.

checkConstructorCompatibility

public void checkConstructorCompatibility(Type targetType,
                                          List<Expression> args)
Check whether the list of expression in args is statically compatible with this Signature. This means that args and this.types have the same length, and the type of each expression in args is assignment compatible with the corresponding types in this.types. Also, the targetType must actually contain a constructor of the appropriate signature and name.

Throws:
IllegalArgumentException - if args is not compatible with this.types.

fromCall

public static Signature fromCall(Type type,
                                 String ident,
                                 List<Expression> exprs)

fromCallUsingTypes

public static Signature fromCallUsingTypes(Type type,
                                           String ident,
                                           List<Type> types)

fromStaticCall

public static Signature fromStaticCall(Type type,
                                       String ident,
                                       List<Expression> exprs)

fromStaticCallUsingTypes

public static Signature fromStaticCallUsingTypes(Type type,
                                                 String ident,
                                                 List<Type> types)

fromConstructorUsingTypes

public static Signature fromConstructorUsingTypes(Type type,
                                                  List<Type> types)

fromConstructor

public static Signature fromConstructor(Type type,
                                        List<Expression> exprs)


Copyright © 2013 Oracle. All Rights Reserved.