@Test public void testNullTransformer() { final QName fromName = new QName("garfield"); final QName toName = new QName("odie"); Transformer<?, ?> transformer = _registry.getTransformer(fromName, toName); Assert.assertTrue(transformer == null); }
@Override public Transformer<?, ?> getTransformer(QName from, QName to) { NameKey nameKey = new NameKey(from, to); Transformer<?,?> transformer = _transformers.get(nameKey); if (transformer == null) { transformer = _fallbackTransformers.get(nameKey); if (transformer == null && QNameUtil.isJavaMessageType(from)) { transformer = getJavaFallbackTransformer(from, to); if (transformer != null && _log.isDebugEnabled()) { _log.debug("Selecting fallback transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } else if (_log.isDebugEnabled()) { _log.debug("No compatible transformer registered: from '" + from + "' to '" + to + "'"); } } } else if (_log.isDebugEnabled()) { _log.debug("Selecting transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } return transformer == NULL_TRANSFORMER ? null : transformer; }
BaseTransformerRegistry implements TransformerRegistry { @Override public Transformer<?, ?> getTransformer(QName from, QName to) { NameKey nameKey = new NameKey(from, to); Transformer<?,?> transformer = _transformers.get(nameKey); if (transformer == null) { transformer = _fallbackTransformers.get(nameKey); if (transformer == null && QNameUtil.isJavaMessageType(from)) { transformer = getJavaFallbackTransformer(from, to); if (transformer != null && _log.isDebugEnabled()) { _log.debug("Selecting fallback transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } else if (_log.isDebugEnabled()) { _log.debug("No compatible transformer registered: from '" + from + "' to '" + to + "'"); } } } else if (_log.isDebugEnabled()) { _log.debug("Selecting transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } return transformer == NULL_TRANSFORMER ? null : transformer; } }
BaseTransformerRegistry implements TransformerRegistry { @Override public Transformer<?, ?> getTransformer(QName from, QName to) { NameKey nameKey = new NameKey(from, to); Transformer<?,?> transformer = _transformers.get(nameKey); if (transformer == null) { transformer = _fallbackTransformers.get(nameKey); if (transformer == null && QNameUtil.isJavaMessageType(from)) { transformer = getJavaFallbackTransformer(from, to); if (transformer != null && _log.isDebugEnabled()) { _log.debug("Selecting fallback transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } else if (_log.isDebugEnabled()) { _log.debug("No compatible transformer registered: from '" + from + "' to '" + to + "'"); } } } else if (_log.isDebugEnabled()) { _log.debug("Selecting transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } return transformer == NULL_TRANSFORMER ? null : transformer; } BaseTransformerRegistry();  BaseTransformerRegistry(Set<Transformer<?,?>> transformers); }
BaseTransformerRegistry implements TransformerRegistry { @Override public Transformer<?, ?> getTransformer(QName from, QName to) { NameKey nameKey = new NameKey(from, to); Transformer<?,?> transformer = _transformers.get(nameKey); if (transformer == null) { transformer = _fallbackTransformers.get(nameKey); if (transformer == null && QNameUtil.isJavaMessageType(from)) { transformer = getJavaFallbackTransformer(from, to); if (transformer != null && _log.isDebugEnabled()) { _log.debug("Selecting fallback transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } else if (_log.isDebugEnabled()) { _log.debug("No compatible transformer registered: from '" + from + "' to '" + to + "'"); } } } else if (_log.isDebugEnabled()) { _log.debug("Selecting transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } return transformer == NULL_TRANSFORMER ? null : transformer; } BaseTransformerRegistry();  BaseTransformerRegistry(Set<Transformer<?,?>> transformers); @Override BaseTransformerRegistry addTransformer(Transformer<?, ?> transformer); @Override TransformerRegistry addTransformer(Transformer<?, ?> transformer, QName from, QName to); void setEventPublisher(EventPublisher eventPublisher); @Override Transformer<?, ?> getTransformer(QName from, QName to); @Override TransformSequence getTransformSequence(QName from, QName to); @Override boolean hasTransformer(QName from, QName to); @Override boolean removeTransformer(Transformer<?, ?> transformer); @Override List<Transformer<?, ?>> getRegisteredTransformers(); @Override List<Transformer<?,?>> getTransformersFrom(QName type); @Override List<Transformer<?,?>> getTransformersTo(QName type); @Override void setTransfomResolver(TransformResolver resolver); }
BaseTransformerRegistry implements TransformerRegistry { @Override public Transformer<?, ?> getTransformer(QName from, QName to) { NameKey nameKey = new NameKey(from, to); Transformer<?,?> transformer = _transformers.get(nameKey); if (transformer == null) { transformer = _fallbackTransformers.get(nameKey); if (transformer == null && QNameUtil.isJavaMessageType(from)) { transformer = getJavaFallbackTransformer(from, to); if (transformer != null && _log.isDebugEnabled()) { _log.debug("Selecting fallback transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } else if (_log.isDebugEnabled()) { _log.debug("No compatible transformer registered: from '" + from + "' to '" + to + "'"); } } } else if (_log.isDebugEnabled()) { _log.debug("Selecting transformer: from '" + transformer.getFrom() + "' to '" + transformer.getTo() + "'. Type: " + transformer.getClass().getName()); } return transformer == NULL_TRANSFORMER ? null : transformer; } BaseTransformerRegistry();  BaseTransformerRegistry(Set<Transformer<?,?>> transformers); @Override BaseTransformerRegistry addTransformer(Transformer<?, ?> transformer); @Override TransformerRegistry addTransformer(Transformer<?, ?> transformer, QName from, QName to); void setEventPublisher(EventPublisher eventPublisher); @Override Transformer<?, ?> getTransformer(QName from, QName to); @Override TransformSequence getTransformSequence(QName from, QName to); @Override boolean hasTransformer(QName from, QName to); @Override boolean removeTransformer(Transformer<?, ?> transformer); @Override List<Transformer<?, ?>> getRegisteredTransformers(); @Override List<Transformer<?,?>> getTransformersFrom(QName type); @Override List<Transformer<?,?>> getTransformersTo(QName type); @Override void setTransfomResolver(TransformResolver resolver);  }