Package org.apache.wink.common.internal.registry

Examples of org.apache.wink.common.internal.registry.Injectable


        List<Injectable> currentParameters =
            new ArrayList<Injectable>(metadata.getFormalParameters());
        metadata.getFormalParameters().clear();
        int i = 0;
        for (Injectable injectable : currentParameters) {
            Injectable fp =
                InjectableFactory.getInstance().create(parameterTypes[i],
                                                       injectable.getAnnotations(),
                                                       method,
                                                       getMetadata().isEncoded() || metadata
                                                           .isEncoded(),
View Full Code Here


        // add fields
        while (resourceClass != Object.class && resourceClass != null) {
            for (Field field : resourceClass.getDeclaredFields()) {
                Type fieldType = field.getGenericType();
                Injectable injectable = parseAccessibleObject(field, fieldType);
                logger.trace("Field is {} and injectable is {}", fieldType, injectable);

                if (injectable != null) {
                    injectableFields.add(injectable);
                }
            }
            resourceClass = resourceClass.getSuperclass();
        }
        logger.trace("Injectable fields: {}", injectableFields);

        // add properties
        PropertyDescriptor[] propertyDescriptors = metadata.getBeanInfo().getPropertyDescriptors();
        if(logger.isTraceEnabled()) {
            logger.trace("Property descriptors are: {}", Arrays.asList(propertyDescriptors));
        }
        if (propertyDescriptors != null) {
            l: for (PropertyDescriptor pd : propertyDescriptors) {
                Method writeMethod = pd.getWriteMethod();
                if (writeMethod == null) {
                    // the property cannot be written, ignore it.
                    continue l;
                }
                if(logger.isTraceEnabled()) {
                    logger.trace("Method under inspection: {}", writeMethod.getName());
                }
                Type genericReturnType = writeMethod.getParameterTypes()[0];
                Injectable injectable = parseAccessibleObject(writeMethod, genericReturnType);
                if (injectable != null) {
                    injectableFields.add(injectable);
                }
                if(logger.isTraceEnabled()) {
                    logger.trace("Injectable under inspection: {}", injectable);
View Full Code Here

            Annotation[][] parameterAnnotations = constructor.getParameterAnnotations();
            Type[] paramTypes = constructor.getGenericParameterTypes();
            // boolean isValidConstructor = true;
            // gather all formal parameters as list of injectable data
            for (int pos = 0, limit = paramTypes.length; pos < limit; pos++) {
                Injectable fp =
                    InjectableFactory.getInstance()
                        .create(paramTypes[pos],
                                parameterAnnotations[pos],
                                constructor,
                                getMetadata().isEncoded() || constructorMetadata.isEncoded(),
View Full Code Here

    public void testMultipartFormDataSomeFormParams() throws Exception {
        final Set<MediaType> mtSet = new HashSet<MediaType>();
        mtSet.add(MediaType.MULTIPART_FORM_DATA_TYPE);

        final List<Injectable> injectables = new ArrayList<Injectable>();
        final Injectable formParam1 = mockContext.mock(Injectable.class, "formParam1");
        final Injectable unknownParam2 = mockContext.mock(Injectable.class, "unknownParam2");
        final Injectable formParam3 = mockContext.mock(Injectable.class, "formParam3");
        injectables.add(formParam1);
        injectables.add(unknownParam2);
        injectables.add(formParam3);

        FormParam ann1 =
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.registry.Injectable

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.