Package org.mojavemvc.marshalling

Examples of org.mojavemvc.marshalling.DefaultEntityMarshaller


public class TestEntityMarshallers {

    @Test
    public void defaultEntityMarshallerSupportsNoContentTypes() {
       
        DefaultEntityMarshaller m = new DefaultEntityMarshaller();
        String[] contentTypes = m.contentTypesHandled();
        assertNull(contentTypes);
    }
View Full Code Here


    }
   
    @Test
    public void defaultEntityMarshallerReturnsView() {
       
        DefaultEntityMarshaller m = new DefaultEntityMarshaller();
        View v = new EmptyView();
        assertEquals(v, m.marshall(v));
    }
View Full Code Here

    }
   
    @Test
    public void defaultEntityMarshallerReturnsNullAfterUnmarshall() {
       
        DefaultEntityMarshaller m = new DefaultEntityMarshaller();
        assertNull(m.unmarshall(null, null));
    }
View Full Code Here

    private final Annotation[] methodAnnotations;

    public BaseActionSignature(int fastIndex, String methodName, Class<?>[] paramTypes,
            Annotation[][] paramAnnotations, Annotation[] methodAnnotations) {
        this(fastIndex, methodName, paramTypes, paramAnnotations, methodAnnotations,
                null, new DefaultEntityMarshaller());
    }
View Full Code Here

        addRoute(method, fastClass.getJavaClass().getName(), controllerVariable, action, isDefaultController);
    }

    private EntityMarshaller getParamEntityMarshaller(Method method, String className) {
       
        EntityMarshaller paramMarshaller = new DefaultEntityMarshaller();
        Annotation[][] paramAnnotations = method.getParameterAnnotations();
        List<Entity> entityAnnotations = new ArrayList<Entity>();
        for (Annotation[] annotationsForParam : paramAnnotations) {
            for (Annotation annotation : annotationsForParam) {
                if (annotation instanceof Entity) {
View Full Code Here

        return paramMarshaller;
    }
   
    private EntityMarshaller getViewEntityMarshaller(Method method, String className) {
       
        EntityMarshaller viewMarshaller = new DefaultEntityMarshaller();
       
        Returns returnsAnnotation = method.getAnnotation(Returns.class);
        if (returnsAnnotation != null) {
            String contentType = returnsAnnotation.value();
            EntityMarshaller marshaller = entityMarshallerMap.get(contentType);
View Full Code Here

TOP

Related Classes of org.mojavemvc.marshalling.DefaultEntityMarshaller

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.