public static boolean hasSameArgs(final MethodInfo t, final MethodInfo p) { return containsTypeEquivalent( t.getParameters().getParameterTypes(), p.getParameters().getParameterTypes() ); }
public static boolean hasSameArgs(final MethodInfo t, final MethodInfo p) { return containsTypeEquivalent( t.getParameters().getParameterTypes(), p.getParameters().getParameterTypes() ); }
public static boolean hasSameArgs(final MethodInfo t, final MethodInfo p) { return containsTypeEquivalent( t.getParameters().getParameterTypes(), p.getParameters().getParameterTypes() ); }
@Override public boolean isEquivalentTo(final MemberInfo m) { return m instanceof MethodBase && super.isEquivalentTo(m) && ((MethodBase) m).getParameters().getParameterTypes().isEquivalentTo(getParameters().getParameterTypes()); } }
public static boolean isSubSignature(final MethodInfo t, final MethodInfo p) { return hasSameArgs(t, p) || containsTypeEquivalent(t.getParameters().getParameterTypes(), erasure(p.getParameters().getParameterTypes())); }
public static boolean isSubSignature(final MethodInfo t, final MethodInfo p) { return hasSameArgs(t, p) || containsTypeEquivalent(t.getParameters().getParameterTypes(), erasure(p.getParameters().getParameterTypes())); }
public static boolean isSubSignature(final MethodInfo t, final MethodInfo p) { return hasSameArgs(t, p) || containsTypeEquivalent(t.getParameters().getParameterTypes(), erasure(p.getParameters().getParameterTypes())); }
@Override public StringBuilder appendErasedSignature(final StringBuilder sb) { StringBuilder s = sb; s.append('('); final TypeList parameterTypes = getParameters().getParameterTypes(); for (int i = 0, n = parameterTypes.size(); i < n; ++i) { s = parameterTypes.get(i).appendErasedSignature(s); } s.append(')'); s = getReturnType().appendErasedSignature(s); return s; }
@Override public StringBuilder appendErasedSignature(final StringBuilder sb) { StringBuilder s = sb; s.append('('); final TypeList parameterTypes = getParameters().getParameterTypes(); for (int i = 0, n = parameterTypes.size(); i < n; ++i) { s = parameterTypes.get(i).appendErasedSignature(s); } s.append(')'); s = getReturnType().appendErasedSignature(s); return s; }
@Override public StringBuilder appendErasedSignature(final StringBuilder sb) { StringBuilder s = sb; s.append('('); final TypeList parameterTypes = getParameters().getParameterTypes(); for (int i = 0, n = parameterTypes.size(); i < n; ++i) { s = parameterTypes.get(i).appendErasedSignature(s); } s.append(')'); s = getReturnType().appendErasedSignature(s); return s; }
ReflectedConstructor(final Type declaringType, final Constructor rawConstructor, final ParameterList parameters, final TypeList thrownTypes) { _declaringType = VerifyArgument.notNull(declaringType, "declaringType"); _rawConstructor = VerifyArgument.notNull(rawConstructor, "rawConstructor"); _parameters = VerifyArgument.notNull(parameters, "parameters"); _thrownTypes = VerifyArgument.notNull(thrownTypes, "thrownTypes"); _signatureType = new SignatureType(PrimitiveTypes.Void, _parameters.getParameterTypes()); }
RuntimeConstructorInfo( final Constructor<?> rawConstructor, final RuntimeTypeCache<?> reflectedTypeCache, final int modifiers, final Set<BindingFlags> bindingFlags, final ParameterList parameters) { _rawConstructor = VerifyArgument.notNull(rawConstructor, "rawConstructor"); _reflectedTypeCache = VerifyArgument.notNull(reflectedTypeCache, "reflectedTypeCache"); _bindingFlags = VerifyArgument.notNull(bindingFlags, "bindingFlags"); _modifiers = modifiers; _parameters = VerifyArgument.notNull(parameters, "parameters"); _signatureType = new SignatureType(PrimitiveTypes.Void, _parameters.getParameterTypes()); }
RuntimeConstructorInfo( final Constructor<?> rawConstructor, final RuntimeTypeCache<?> reflectedTypeCache, final int modifiers, final Set<BindingFlags> bindingFlags, final ParameterList parameters) { _rawConstructor = VerifyArgument.notNull(rawConstructor, "rawConstructor"); _reflectedTypeCache = VerifyArgument.notNull(reflectedTypeCache, "reflectedTypeCache"); _bindingFlags = VerifyArgument.notNull(bindingFlags, "bindingFlags"); _modifiers = modifiers; _parameters = VerifyArgument.notNull(parameters, "parameters"); _signatureType = new SignatureType(PrimitiveTypes.Void, _parameters.getParameterTypes()); }
ReflectedConstructor(final Type declaringType, final Constructor rawConstructor, final ParameterList parameters, final TypeList thrownTypes) { _declaringType = VerifyArgument.notNull(declaringType, "declaringType"); _rawConstructor = VerifyArgument.notNull(rawConstructor, "rawConstructor"); _parameters = VerifyArgument.notNull(parameters, "parameters"); _thrownTypes = VerifyArgument.notNull(thrownTypes, "thrownTypes"); _signatureType = new SignatureType(PrimitiveTypes.Void, _parameters.getParameterTypes()); }
ReflectedConstructor(final Type declaringType, final Constructor rawConstructor, final ParameterList parameters, final TypeList thrownTypes) { _declaringType = VerifyArgument.notNull(declaringType, "declaringType"); _rawConstructor = VerifyArgument.notNull(rawConstructor, "rawConstructor"); _parameters = VerifyArgument.notNull(parameters, "parameters"); _thrownTypes = VerifyArgument.notNull(thrownTypes, "thrownTypes"); _signatureType = new SignatureType(PrimitiveTypes.Void, _parameters.getParameterTypes()); }
RuntimeConstructorInfo( final Constructor<?> rawConstructor, final RuntimeTypeCache<?> reflectedTypeCache, final int modifiers, final Set<BindingFlags> bindingFlags, final ParameterList parameters) { _rawConstructor = VerifyArgument.notNull(rawConstructor, "rawConstructor"); _reflectedTypeCache = VerifyArgument.notNull(reflectedTypeCache, "reflectedTypeCache"); _bindingFlags = VerifyArgument.notNull(bindingFlags, "bindingFlags"); _modifiers = modifiers; _parameters = VerifyArgument.notNull(parameters, "parameters"); _signatureType = new SignatureType(PrimitiveTypes.Void, _parameters.getParameterTypes()); }
ErasedMethod( final MethodInfo baseMethod, final Type<?> declaringType, final ParameterList parameters, final Type<?> returnType, final TypeList thrownTypes, final TypeBindings typeBindings) { _baseMethod = VerifyArgument.notNull(baseMethod, "baseMethod"); _declaringType = VerifyArgument.notNull(declaringType, "declaringType"); _parameters = VerifyArgument.notNull(parameters, "parameters"); _signatureType = new SignatureType(VerifyArgument.notNull(returnType, "returnType"), _parameters.getParameterTypes()); _thrownTypes = VerifyArgument.notNull(thrownTypes, "thrownTypes"); _typeBindings = VerifyArgument.notNull(typeBindings, "typeBindings"); }
private DynamicMethod(final MethodHandle methodHandle, final Method invokeMethod) { _methodHandle = VerifyArgument.notNull(methodHandle, "methodHandle"); _invokeMethod = VerifyArgument.notNull(invokeMethod, "invokeMethod"); final MethodType methodType = methodHandle.type(); final ParameterInfo[] parameters = new ParameterInfo[methodType.parameterCount()]; for (int i = 0, n = parameters.length; i < n; i++) { parameters[i] = new ParameterInfo( "p" + i, i, Type.of(methodType.parameterType(i)) ); } _parameters = new ParameterList(parameters); _signatureType = new SignatureType( Type.of(methodType.returnType()), _parameters.getParameterTypes() ); }
public MethodInfo findBaseMethod(final Type<?> relativeTo) { VerifyArgument.notNull(relativeTo, "relativeTo"); final Type<?> declaringType = getDeclaringType(); if (!relativeTo.isAssignableFrom(declaringType)) { throw Error.invalidAncestorType(relativeTo, declaringType); } if (isStatic() || isPrivate()) { return null; } final ParameterList parameters = getParameters(); return relativeTo.getMethod( getName(), BindingFlags.AllInstance, getCallingConvention(), parameters.getParameterTypes().toArray(new Type[parameters.size()]) ); }
public MethodInfo findBaseMethod(final Type<?> relativeTo) { VerifyArgument.notNull(relativeTo, "relativeTo"); final Type<?> declaringType = getDeclaringType(); if (!relativeTo.isAssignableFrom(declaringType)) { throw Error.invalidAncestorType(relativeTo, declaringType); } if (isStatic() || isPrivate() || declaringType.isInterface()) { return null; } final ParameterList parameters = getParameters(); return relativeTo.getMethod( getName(), BindingFlags.AllInstance, getCallingConvention(), parameters.getParameterTypes().toArray(new Type[parameters.size()]) ); }