Code example for RegexPatternTypeFilter

0
    public void packageScanWithRegexIncludeFilter() throws Exception {
        setDirty(); 
        ClassPathScanningAmfConversionServiceConfigProcessor configProcessor = new ClassPathScanningAmfConversionServiceConfigProcessor("org.springframework.flex.core.io.domain");
        configProcessor.setBeanClassLoader(getApplicationContext().getClassLoader());
        configProcessor.setResourceLoader(getApplicationContext());
        configProcessor.addIncludeFilter(new RegexPatternTypeFilter(Pattern.compile(".*NP")));
        configProcessor.afterPropertiesSet();
 
        addStartupProcessor(configProcessor);
        getMessageBroker(); 
 
        assertNotNull(PropertyProxyRegistry.getProxy(new Person()));
        assertFalse(PropertyProxyRegistry 
                .getProxy(new Person()) instanceof SpringPropertyProxy);
        assertNotNull(PropertyProxyRegistry.getProxy(new PersonNP())); 
        assertTrue(PropertyProxyRegistry 
                .getProxy(new PersonNP()) instanceof SpringPropertyProxy); 
    } 
 
    @Test