Package com.amazonaws.hal

Examples of com.amazonaws.hal.Link.method()


            throw e.getTargetException();
        }

        Link link;
        if ((link = method.getAnnotation(Link.class)) != null) {
            switch (link.method()) {
            case GET:
                if (List.class.isAssignableFrom(method.getReturnType())) {
                    //noinspection unchecked
                    return new HalLinkList(halResource, link.relation(),
                                           (Class) getCollectionType(method.getGenericReturnType(), 0, ResourceInfo.class),
View Full Code Here


            case DELETE:
                return halClient.deleteResource(method.getReturnType(),
                                                getRelationHref(link, args == null ? EMPTY_ARGS : args, method.getParameterAnnotations()));

            default:
                throw new UnsupportedOperationException("Unexpected HTTP method: " + link.method());
            }

        } else if (method.getName().startsWith("get")) {
            String propertyName = getPropertyName(method.getName());
            Object property = halResource.getProperty(propertyName);
View Full Code Here

            throw e.getTargetException();
        }

        Link link;
        if ((link = method.getAnnotation(Link.class)) != null) {
            switch (link.method()) {
            case GET:
                if (List.class.isAssignableFrom(method.getReturnType())) {
                    //noinspection unchecked
                    return new HalLinkList(halResource, link.relation(), getCollectionType(method.getGenericReturnType(), 0, ResourceInfo.class), halClient);
                } else if (Map.class.isAssignableFrom(method.getReturnType())) {
View Full Code Here

                halClient.deleteResource(getRelationHref(link.relation(), args));

                break;

            default:
                throw new UnsupportedOperationException("Unexpected HTTP method: " + link.method());
            }

        } else if (method.getName().startsWith("get")) {
            return convert(method.getGenericReturnType(), halResource.getProperty(getPropertyName(method.getName())));
        } else if (method.getName().equals("toString") && args == null) {
View Full Code Here

            throw e.getTargetException();
        }

        Link link;
        if ((link = method.getAnnotation(Link.class)) != null) {
            switch (link.method()) {
            case GET:
                if (List.class.isAssignableFrom(method.getReturnType())) {
                    //noinspection unchecked
                    return new HalLinkList(halResource, link.relation(),
                                           getCollectionType(method.getGenericReturnType(), 0, ResourceInfo.class),
View Full Code Here

                halClient.deleteResource(getRelationHref(link, args, method.getParameterAnnotations()));

                break;

            default:
                throw new UnsupportedOperationException("Unexpected HTTP method: " + link.method());
            }

        } else if (method.getName().startsWith("get")) {
            return convert(method.getGenericReturnType(), halResource.getProperty(getPropertyName(method.getName())));
        } else if (method.getName().equals("toString") && args == null) {
View Full Code Here

            throw e.getTargetException();
        }

        Link link;
        if ((link = method.getAnnotation(Link.class)) != null) {
            switch (link.method()) {
            case GET:
                if (List.class.isAssignableFrom(method.getReturnType())) {
                    //noinspection unchecked
                    return new HalLinkList(halResource, link.relation(),
                                           getCollectionType(method.getGenericReturnType(), 0, ResourceInfo.class),
View Full Code Here

            case DELETE:
                return halClient.deleteResource(method.getReturnType(),
                                                getRelationHref(link, args, method.getParameterAnnotations()));

            default:
                throw new UnsupportedOperationException("Unexpected HTTP method: " + link.method());
            }

        } else if (method.getName().startsWith("get")) {
            return convert(method.getGenericReturnType(), halResource.getProperty(getPropertyName(method.getName())));
        } else if (method.getName().equals("toString") && args == null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.