Source:
public void write(ComponentDescriptor<?> componentDescriptor, OutputStream outputStream) throws IOException { final Map<String, Object> data = new HashMap<>(); try { data.put("breadcrumbs", _breadcrumbs); data.put("component", new ComponentDocumentationWrapper(componentDescriptor)); { final Set<ConfiguredPropertyDescriptor> configuredProperties = componentDescriptor .getConfiguredProperties(); final List<ConfiguredPropertyDescriptor> properties = new ArrayList<ConfiguredPropertyDescriptor>( configuredProperties); final List<ConfiguredPropertyDocumentationWrapper> propertyList = new ArrayList<>(); for (ConfiguredPropertyDescriptor property : properties) { final HiddenProperty hiddenProperty = property.getAnnotation(HiddenProperty.class); if (hiddenProperty == null) { ConfiguredPropertyDocumentationWrapper wrapper = new ConfiguredPropertyDocumentationWrapper( property); propertyList.add(wrapper); } } data.put("properties", propertyList); } { final Image descriptorIcon = IconUtils.getDescriptorIcon(componentDescriptor).getImage(); final BufferedImage bufferedImage = toBufferedImage(descriptorIcon); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(bufferedImage, "png", baos); byte[] imageInByte = baos.toByteArray(); baos.flush(); baos.close(); final String encodedImage = Base64.encodeBase64String(imageInByte); final String iconHtmlRepresentation = HTMLBASE64_PREFIX + encodedImage; data.put("icon", iconHtmlRepresentation); } Writer out = new OutputStreamWriter(outputStream); _template.process(data, out); out.flush(); out.close(); } catch (TemplateException e) { throw new IllegalStateException("Unexpected templare exception", e); } }

Target:
public void write(ComponentDescriptor<?> componentDescriptor, OutputStream outputStream) throws IOException { final Map<String, Object> data = new HashMap<>(); try { data.put("breadcrumbs", _breadcrumbs); data.put("component", new ComponentDocumentationWrapper(componentDescriptor)); { final Set<ConfiguredPropertyDescriptor> configuredProperties = componentDescriptor .getConfiguredProperties(); final List<ConfiguredPropertyDescriptor> properties = new ArrayList<ConfiguredPropertyDescriptor>( configuredProperties); final List<ConfiguredPropertyDocumentationWrapper> propertyList = new ArrayList<>(); for (ConfiguredPropertyDescriptor property : properties) { final HiddenProperty hiddenProperty = property.getAnnotation(HiddenProperty.class); if (hiddenProperty == null) { final ConfiguredPropertyDocumentationWrapper wrapper = new ConfiguredPropertyDocumentationWrapper( property); propertyList.add(wrapper); } } data.put("properties", propertyList); } { final Image descriptorIcon = IconUtils.getDescriptorIcon(componentDescriptor).getImage(); final BufferedImage bufferedImage = toBufferedImage(descriptorIcon); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(bufferedImage, "png", baos); byte[] imageInByte = baos.toByteArray(); baos.flush(); baos.close(); final String encodedImage = Base64.encodeBase64String(imageInByte); final String iconHtmlRepresentation = HTMLBASE64_PREFIX + encodedImage; data.put("icon", iconHtmlRepresentation); } Writer out = new OutputStreamWriter(outputStream); _template.process(data, out); out.flush(); out.close(); } catch (TemplateException e) { throw new IllegalStateException("Unexpected templare exception", e); } }