Package com.strobel.reflection

Examples of com.strobel.reflection.MethodList


        }
    }

    static MethodInfo getInvokeMethod(final Expression expression) {
        final Type interfaceType = expression.getType();
        final MethodList methods = interfaceType.getMethods();

        if (!interfaceType.isInterface() || methods.size() != 1) {
            throw Error.expressionTypeNotInvokable(interfaceType);
        }

        return methods.get(0);
    }
View Full Code Here


        final ParameterExpressionList parameters) {

        VerifyArgument.notNull(interfaceType, "interfaceType");
        verifyCanRead(body, "body");

        final MethodList methods = interfaceType.getMethods(BindingFlags.PublicInstance);

        if (!interfaceType.isInterface() || methods.size() != 1) {
            throw Error.lambdaTypeMustBeSingleMethodInterface();
        }

        final MethodInfo method = methods.get(0);
        final ParameterList methodParameters = method.getParameters();

        if (methodParameters.size() > 0) {
            if (parameters.size() != methodParameters.size()) {
                throw Error.incorrectNumberOfLambdaArguments();
View Full Code Here

    private void writeAnnotation(final AnnotationBuilder<? extends Annotation> a) {
        _dataBuffer.putShort(_typeBuilder.getUtf8StringToken(a.getAnnotationType().getSignature()));
        _dataBuffer.putShort(a.getValues().size());

        final MethodList attributes = a.getAttributes();
        final ReadOnlyList<Object> values = a.getValues();

        for (int i = 0, n = attributes.size(); i < n; i++) {
            final MethodInfo attribute = attributes.get(i);
            _dataBuffer.putShort(_typeBuilder.getUtf8StringToken(attribute.getName()));
            writeAttributeType(values.get(i));
        }
    }
View Full Code Here

            throw Error.annotationHasNoDefaultAttribute();
        }

        checkProperties(
            annotationType,
            new MethodList(valueProperty),
            new ReadOnlyList<>(value)
        );

        return new AnnotationBuilder<>(
            annotationType,
            new MethodList(valueProperty),
            new ReadOnlyList<>(value)
        );
    }
View Full Code Here

                throw Error.expressionTypeNotInvokable(interfaceType);
            }
            return null;
        }

        final MethodList methods = interfaceType.getMethods();

        MethodInfo invokeMethod = null;

        for (final MethodInfo method : methods) {
            if (method.isDefault()) {
View Full Code Here

TOP

Related Classes of com.strobel.reflection.MethodList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.