Package org.skyscreamer.yoga.model

Examples of org.skyscreamer.yoga.model.ObjectMapHierarchicalModelImpl


        FieldSelector fieldSelector = new FieldSelector();
        fieldSelector.register( "leaf", new FieldSelector() );
        CompositeSelector selector = new CompositeSelector( resolver.getBaseSelector(), fieldSelector );

        ObjectMapHierarchicalModelImpl model = new ObjectMapHierarchicalModelImpl();

        resultTraverser.traverse( input, selector, model, requestContext );

        Map<String, Object> objectTree = model.getUnderlyingModel();
        Assert.assertEquals( "fooId", objectTree.get( "id" ) );

        Map<String, Object> childTree = (Map<String, Object>) objectTree.get( "leaf" );
        Assert.assertEquals( 0, childTree.get( "id" ) );
    }
View Full Code Here


    @Test
    public void testConfiguration() throws IOException
    {
        BasicTestDataLeaf input = new BasicTestDataLeaf();
        ObjectMapHierarchicalModelImpl model = new ObjectMapHierarchicalModelImpl();
        FieldSelector fieldSelector = new FieldSelector();
        fieldSelector.register( "someField", new FieldSelector() );
        resultTraverser.traverse( input, new CompositeSelector( resolver.getBaseSelector(), fieldSelector ), model, requestContext );
        Map<String, Object> objectTree = model.getUnderlyingModel();
        Assert.assertEquals( "customValue", objectTree.get( "someField" ) );
    }
View Full Code Here

TOP

Related Classes of org.skyscreamer.yoga.model.ObjectMapHierarchicalModelImpl

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.