@Test public void alternatives() { SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.BOLD), Collections.<SpanHtmlElementStrategy> emptyList()); assertTrue(strategies.getStrategy(SpanType.STRONG, new Attributes()) instanceof SubstitutionSpanStrategy); }
@Override public SpanStrategy getStrategy(SpanType elementType, Attributes attributes) { SpanStrategy strategy = super.getStrategy(elementType, attributes); if (elementType == SpanType.SPAN && strategy instanceof UnsupportedSpanStrategy) { SpanStrategy alternateStrategy = calculateAlternateSpanStrategy(attributes); if (alternateStrategy != null) { strategy = alternateStrategy; } } return strategy; }
SpanStrategies extends ElementStrategies<SpanType, SpanStrategy, SpanHtmlElementStrategy> { @Override public SpanStrategy getStrategy(SpanType elementType, Attributes attributes) { SpanStrategy strategy = super.getStrategy(elementType, attributes); if (elementType == SpanType.SPAN && strategy instanceof UnsupportedSpanStrategy) { SpanStrategy alternateStrategy = calculateAlternateSpanStrategy(attributes); if (alternateStrategy != null) { strategy = alternateStrategy; } } return strategy; } }
SpanStrategies extends ElementStrategies<SpanType, SpanStrategy, SpanHtmlElementStrategy> { @Override public SpanStrategy getStrategy(SpanType elementType, Attributes attributes) { SpanStrategy strategy = super.getStrategy(elementType, attributes); if (elementType == SpanType.SPAN && strategy instanceof UnsupportedSpanStrategy) { SpanStrategy alternateStrategy = calculateAlternateSpanStrategy(attributes); if (alternateStrategy != null) { strategy = alternateStrategy; } } return strategy; } SpanStrategies(Set<SpanType> elementTypes, List<SpanHtmlElementStrategy> spanElementStrategies); }
SpanStrategies extends ElementStrategies<SpanType, SpanStrategy, SpanHtmlElementStrategy> { @Override public SpanStrategy getStrategy(SpanType elementType, Attributes attributes) { SpanStrategy strategy = super.getStrategy(elementType, attributes); if (elementType == SpanType.SPAN && strategy instanceof UnsupportedSpanStrategy) { SpanStrategy alternateStrategy = calculateAlternateSpanStrategy(attributes); if (alternateStrategy != null) { strategy = alternateStrategy; } } return strategy; } SpanStrategies(Set<SpanType> elementTypes, List<SpanHtmlElementStrategy> spanElementStrategies); @Override SpanStrategy getStrategy(SpanType elementType, Attributes attributes); }
SpanStrategies extends ElementStrategies<SpanType, SpanStrategy, SpanHtmlElementStrategy> { @Override public SpanStrategy getStrategy(SpanType elementType, Attributes attributes) { SpanStrategy strategy = super.getStrategy(elementType, attributes); if (elementType == SpanType.SPAN && strategy instanceof UnsupportedSpanStrategy) { SpanStrategy alternateStrategy = calculateAlternateSpanStrategy(attributes); if (alternateStrategy != null) { strategy = alternateStrategy; } } return strategy; } SpanStrategies(Set<SpanType> elementTypes, List<SpanHtmlElementStrategy> spanElementStrategies); @Override SpanStrategy getStrategy(SpanType elementType, Attributes attributes);  }