Package com.force.sdk.codegen.filter

Examples of com.force.sdk.codegen.filter.FieldFilter


   
    @Test
    public void testFieldFilterDefaultsToForceJPAFieldFilter() {
        ForceJPAClassGenerator generator = new ForceJPAClassGenerator();
       
        FieldFilter fieldFilter = generator.getFieldFilter();
        assertNotNull(fieldFilter, "ForceJPAClassGenerator fieldFilter should default when not specified");
        assertEquals(fieldFilter.getClass(), ForceJPAFieldFilter.class,
                "ForceJPAClassGenerator fieldFilter should default to ForceJPAFieldFilter");
    }
View Full Code Here


    @Test
    public void testFieldFilterAlwaysIncludesForceJPAFieldFilter() {
        ForceJPAClassGenerator generator = new ForceJPAClassGenerator();
        generator.setFieldFilter(new FieldNoOpFilter());
       
        FieldFilter fieldFilter = generator.getFieldFilter();
        assertNotNull(fieldFilter, "ForceJPAClassGenerator fieldFilter should never be null");
        assertEquals(fieldFilter.getClass(), FieldCombinationFilter.class,
                "ForceJPAClassGenerator should use a FieldCombinationFilter when a caller sets a field filter");
       
        List<FieldFilter> filterList = ((FieldCombinationFilter) fieldFilter).getFilterList();
        assertEquals(filterList.get(filterList.size() - 1).getClass(), ForceJPAFieldFilter.class,
                "ForceJPAFieldFilter should always be the last field filter in ForceJPAClassGenerator");
View Full Code Here

        GetUserInfoResult userInfo = conn.getUserInfo();
       
        ObjectFilter objectFilter = getObjectFilter();
        assert objectFilter != null;
       
        FieldFilter fieldFilter = getFieldFilter();
        assert fieldFilter != null;
       
        Template template = getTemplate();
        assert template != null;
       
        TemplateInjector templateInjector = getTemplateInjector();
        assert templateInjector != null;
       
        WriterProvider writerProvider = getWriterProvider(destDir);
        assert writerProvider != null;
       
        // Write filtered data to the template
        int numGeneratedCode = 0;
       
        for (DescribeSObjectResult dsr : objectFilter.filter(allOrgObjects)) {
            // Before we write a new source file, make sure the template is reset
            template.reset();
           
            // Inject the data into the template
            templateInjector.inject(userInfo, dsr, fieldFilter.filter(dsr), template);
           
            Writer writer = null;
            try {
                writer = writerProvider.getWriter(userInfo, dsr);
                template.write(writer);
View Full Code Here

TOP

Related Classes of com.force.sdk.codegen.filter.FieldFilter

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.