| | |
| | | import com.deepoove.poi.template.ElementTemplate; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | |
| | |
| | | )); |
| | | |
| | | private final Configure.ClearHandler clearHandler = new Configure.ClearHandler(); |
| | | private final Set<String> clearPictureTags; |
| | | |
| | | public PreserveReportPicturePlaceholderHandler() { |
| | | this(Collections.emptySet()); |
| | | } |
| | | |
| | | public PreserveReportPicturePlaceholderHandler(Set<String> clearPictureTags) { |
| | | this.clearPictureTags = clearPictureTags == null ? Collections.emptySet() : clearPictureTags; |
| | | } |
| | | |
| | | @Override |
| | | public void handler(RenderContext<?> context) { |
| | | ElementTemplate template = context.getEleTemplate(); |
| | | if (template != null |
| | | && Character.valueOf('@').equals(template.getSign()) |
| | | && DEFERRED_PICTURE_TAGS.contains(template.getTagName())) { |
| | | && DEFERRED_PICTURE_TAGS.contains(template.getTagName()) |
| | | && !clearPictureTags.contains(template.getTagName())) { |
| | | return; |
| | | } |
| | | clearHandler.handler(context); |