CompleteAutoloadTilesContainerFactory extends BasicTilesContainerFactory { @Override protected <T> PatternDefinitionResolver<T> createPatternDefinitionResolver(Class<T> customizationKeyClass) { DefinitionPatternMatcherFactory wildcardFactory = new WildcardDefinitionPatternMatcherFactory(); DefinitionPatternMatcherFactory regexpFactory = new RegexpDefinitionPatternMatcherFactory(); PrefixedPatternDefinitionResolver<T> resolver = new PrefixedPatternDefinitionResolver<T>(); resolver.registerDefinitionPatternMatcherFactory("WILDCARD", wildcardFactory); resolver.registerDefinitionPatternMatcherFactory("REGEXP", regexpFactory); return resolver; }  @Override TilesContainer createDecoratedContainer(TilesContainer originalContainer,
            ApplicationContext applicationContext);  }
@Test public void testCreatePatternDefinitionResolver() { PatternDefinitionResolver<Integer> resolver = factory.createPatternDefinitionResolver(Integer.class); assertTrue(resolver instanceof PrefixedPatternDefinitionResolver); Definition definitionWildcard = new Definition("WILDCARD:blah*", (Attribute) null, null); Definition definitionRegexp = new Definition("REGEXP:what(.*)", (Attribute) null, null); Map<String, Definition> definitionMap = new HashMap<String, Definition>(); definitionMap.put("WILDCARD:blah*", definitionWildcard); definitionMap.put("REGEXP:what(.*)", definitionRegexp); resolver.storeDefinitionPatterns(definitionMap, 1); Definition result = resolver.resolveDefinition("blahX", 1); assertEquals("blahX", result.getName()); result = resolver.resolveDefinition("whatX", 1); assertEquals("whatX", result.getName()); }