Package org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest

Examples of org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.DomainModel


       
        this.followLinks = Collections.unmodifiableList(getArg(RequestParameter.FOLLOW_LINKS));
    }

    private void ensureDomainModelQueryParamSupported() {
        final DomainModel domainModel = getArg(RequestParameter.DOMAIN_MODEL);
        if(domainModel != DomainModel.FORMAL) {
            throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.BAD_REQUEST, 
                                           "x-ro-domain-model of '%s' is not supported", domainModel);
        }
    }
View Full Code Here


    @Test
    public void parser_roundtrips() {
        final Parser<DomainModel> parser = RestfulRequest.DomainModel.parser();
        for (final DomainModel domainModel : DomainModel.values()) {
            final String asString = parser.asString(domainModel);
            final DomainModel roundtripped = parser.valueOf(asString);
            assertSame(roundtripped, domainModel);
        }
    }
View Full Code Here

    }

    @Test
    public void simple() {
        repr.mapPut("x-ro-domain-model", "simple");
        final DomainModel valueOf = requestParameter.valueOf(repr);

        assertThat(valueOf, is(DomainModel.SIMPLE));
    }
View Full Code Here

        assertThat(valueOf, is(DomainModel.SIMPLE));
    }

    @Test
    public void whenNone() {
        final DomainModel valueOf = requestParameter.valueOf(repr);

        assertThat(valueOf, is(DomainModel.FORMAL));
    }
View Full Code Here

       
        this.followLinks = Collections.unmodifiableList(getArg(RequestParameter.FOLLOW_LINKS));
    }

    private void ensureDomainModelQueryParamSupported() {
        final DomainModel domainModel = getArg(RequestParameter.DOMAIN_MODEL);
        if(domainModel != DomainModel.FORMAL) {
            throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.BAD_REQUEST,
                    "x-ro-domain-model of '%s' is not supported", domainModel);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.DomainModel

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.