@Test public void testRelativeInsertedContentRelation() throws Exception { try { this.sut.registerHandler(Fixture.Invalid.ContainerHC.Indirect.RelativeInsertedContentRelation.class); fail("Should not allow registering container handlers annotated as indirect containers with relative inserted content relation"); } catch (Exception e) { logFailure(e); } }
ResourceTemplate registerHandler(Class<?> targetClass) { Class<? extends ResourceHandler> handlerClass=toResourceHandlerClass(targetClass); checkArgument(!this.context.isRegistered(handlerClass),"Handler '%s' is already registered",handlerClass.getCanonicalName()); return loadTemplates(handlerClass,this.context); }
MutableTemplateLibrary implements TemplateLibrary { ResourceTemplate registerHandler(Class<?> targetClass) { Class<? extends ResourceHandler> handlerClass=toResourceHandlerClass(targetClass); checkArgument(!this.context.isRegistered(handlerClass),"Handler '%s' is already registered",handlerClass.getCanonicalName()); return loadTemplates(handlerClass,this.context); } }
MutableTemplateLibrary implements TemplateLibrary { ResourceTemplate registerHandler(Class<?> targetClass) { Class<? extends ResourceHandler> handlerClass=toResourceHandlerClass(targetClass); checkArgument(!this.context.isRegistered(handlerClass),"Handler '%s' is already registered",handlerClass.getCanonicalName()); return loadTemplates(handlerClass,this.context); } MutableTemplateLibrary(); }
MutableTemplateLibrary implements TemplateLibrary { ResourceTemplate registerHandler(Class<?> targetClass) { Class<? extends ResourceHandler> handlerClass=toResourceHandlerClass(targetClass); checkArgument(!this.context.isRegistered(handlerClass),"Handler '%s' is already registered",handlerClass.getCanonicalName()); return loadTemplates(handlerClass,this.context); } MutableTemplateLibrary(); @Override ResourceTemplate findByHandler(Class<? extends ResourceHandler> handlerClass); @Override ResourceTemplate findById(String templateId); @Override boolean contains(ResourceTemplate template); @Override void accept(TemplateVisitor visitor); @Override String toString(); }
MutableTemplateLibrary implements TemplateLibrary { ResourceTemplate registerHandler(Class<?> targetClass) { Class<? extends ResourceHandler> handlerClass=toResourceHandlerClass(targetClass); checkArgument(!this.context.isRegistered(handlerClass),"Handler '%s' is already registered",handlerClass.getCanonicalName()); return loadTemplates(handlerClass,this.context); } MutableTemplateLibrary(); @Override ResourceTemplate findByHandler(Class<? extends ResourceHandler> handlerClass); @Override ResourceTemplate findById(String templateId); @Override boolean contains(ResourceTemplate template); @Override void accept(TemplateVisitor visitor); @Override String toString();  }