DefaultSvgNodeRendererFactory implements ISvgNodeRendererFactory { @Override public ISvgNodeRenderer createSvgNodeRendererForTag(IElementNode tag, ISvgNodeRenderer parent) { ISvgNodeRenderer result; if (tag == null) { throw new SvgProcessingException(SvgLogMessageConstant.TAGPARAMETERNULL); } try { Class<? extends ISvgNodeRenderer> clazz = rendererMap.get(tag.name()); if (clazz == null) { Logger logger = LoggerFactory.getLogger(this.getClass()); logger.warn(MessageFormatUtil.format(SvgLogMessageConstant.UNMAPPEDTAG, tag.name())); return null; } result = (ISvgNodeRenderer) rendererMap.get(tag.name()).newInstance(); } catch (ReflectiveOperationException ex) { throw new SvgProcessingException(SvgLogMessageConstant.COULDNOTINSTANTIATE, ex).setMessageParams(tag.name()); } if (parent != null && !(result instanceof INoDrawSvgNodeRenderer) && !(parent instanceof DefsSvgNodeRenderer)) { result.setParent(parent); } return result; } DefaultSvgNodeRendererFactory(); @Deprecated  DefaultSvgNodeRendererFactory(ISvgNodeRendererMapper mapper); @Override ISvgNodeRenderer createSvgNodeRendererForTag(IElementNode tag, ISvgNodeRenderer parent); @Override boolean isTagIgnored(IElementNode tag);  }
@Test public void createSvgNodeRenderer() { junitExpectedException.expect(SvgProcessingException.class); junitExpectedException.expectMessage(SvgLogMessageConstant.TAGPARAMETERNULL); ISvgNodeRendererFactory nodeRendererFactory = new DefaultSvgNodeRendererFactory(null); nodeRendererFactory.createSvgNodeRendererForTag(null, null); }