Skip to content

Commit 66614b9

Browse files
author
Dmitry Radchuk
committed
Add missing javadocs
DEVSIX-8872
1 parent ec50a2a commit 66614b9

14 files changed

+118
-2
lines changed

src/main/java/com/itextpdf/html2pdf/attach/impl/tags/HTagWorker.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ This file is part of the iText (R) project.
2727
import com.itextpdf.layout.IPropertyContainer;
2828
import com.itextpdf.styledxmlparser.node.IElementNode;
2929

30+
/**
31+
* TagWorker class for the {@code h} element.
32+
*/
3033
public class HTagWorker extends DivTagWorker {
3134

3235
private String role;

src/main/java/com/itextpdf/html2pdf/attach/impl/tags/PlaceholderTagWorker.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ This file is part of the iText (R) project.
3232
*/
3333
public class PlaceholderTagWorker implements ITagWorker {
3434

35+
/**
36+
* Creates a new {@link PlaceholderTagWorker} instance.
37+
*
38+
* @param element the element
39+
* @param context the context
40+
*/
3541
public PlaceholderTagWorker(IElementNode element, ProcessorContext context) {
3642
// Do nothing here
3743
}

src/main/java/com/itextpdf/html2pdf/attach/util/AccessiblePropHelper.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,28 @@ This file is part of the iText (R) project.
2727
import com.itextpdf.layout.tagging.IAccessibleElement;
2828
import com.itextpdf.styledxmlparser.node.IElementNode;
2929

30+
/**
31+
* Utility class to set lang attribute.
32+
*/
3033
public class AccessiblePropHelper {
34+
35+
/**
36+
* Set language attribute in elements accessibility properties if it is not set, does nothing otherwise.
37+
*
38+
* @param accessibleElement pdf element to set language property on
39+
* @param element html element from which lang property will be extracted
40+
*/
3141
public static void trySetLangAttribute(IAccessibleElement accessibleElement, IElementNode element) {
3242
String lang = element.getAttribute(AttributeConstants.LANG);
3343
trySetLangAttribute(accessibleElement, lang);
3444
}
3545

46+
/**
47+
* Set language attribute in elements accessibility properties if it is not set, does nothing otherwise.
48+
*
49+
* @param accessibleElement pdf element to set language property on
50+
* @param lang language to set
51+
*/
3652
public static void trySetLangAttribute(IAccessibleElement accessibleElement, String lang) {
3753
if (lang != null) {
3854
AccessibilityProperties properties = accessibleElement.getAccessibilityProperties();

src/main/java/com/itextpdf/html2pdf/attach/util/ContextMappingHelper.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,18 @@ This file is part of the iText (R) project.
2525
import com.itextpdf.html2pdf.attach.ProcessorContext;
2626
import com.itextpdf.svg.processors.impl.SvgConverterProperties;
2727

28+
/**
29+
* Utility class which helps to map {@link ProcessorContext} properties on {@link SvgConverterProperties}.
30+
*/
2831
public class ContextMappingHelper {
2932

33+
/**
34+
* Map {@link ProcessorContext} properties to {@link SvgConverterProperties}.
35+
*
36+
* @param context {@link ProcessorContext} instance
37+
*
38+
* @return {@link SvgConverterProperties} filled with necessary data for svg convertion
39+
*/
3040
public static SvgConverterProperties mapToSvgConverterProperties(ProcessorContext context){
3141
SvgConverterProperties svgConverterProperties = new SvgConverterProperties();
3242
svgConverterProperties.setFontProvider(context.getFontProvider())

src/main/java/com/itextpdf/html2pdf/attach/util/WaitingInlineElementsHelper.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ public void add(ILeafElement element) {
110110
waitingLeaves.add(element);
111111
}
112112

113+
/**
114+
* Adds a block element to the waiting leaves.
115+
*
116+
* @param element the element
117+
*/
113118
public void add(IBlockElement element) {
114119
waitingLeaves.add(element);
115120
}

src/main/java/com/itextpdf/html2pdf/attach/wrapelement/TableWrapper.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,17 @@ public class TableWrapper implements IWrapElement {
7575
/** The header lang attribute value. */
7676
private String headerLang;
7777

78+
/**
79+
* Create new {@link TableWrapper} instance.
80+
*/
7881
public TableWrapper() {
7982
}
8083

84+
/**
85+
* Create new {@link TableWrapper} instance.
86+
*
87+
* @param isRtl table direction value, true for right to left direction, false for left to right
88+
*/
8189
public TableWrapper(boolean isRtl) {
8290
this.isRtl = isRtl;
8391
}
@@ -169,14 +177,29 @@ public void addCell(Cell cell) {
169177
addCellToTable(cell, rows, rowShift);
170178
}
171179

180+
/**
181+
* Set language attribute of the table.
182+
*
183+
* @param lang language code string value (e.g en-us)
184+
*/
172185
public void setLang(String lang) {
173186
this.lang = lang;
174187
}
175188

189+
/**
190+
* Set footer language attribute of the table.
191+
*
192+
* @param footerLang language code string value (e.g en-us)
193+
*/
176194
public void setFooterLang(String footerLang) {
177195
this.footerLang = footerLang;
178196
}
179197

198+
/**
199+
* Set header language attribute of the table.
200+
*
201+
* @param headerLang language code string value (e.g en-us)
202+
*/
180203
public void setHeaderLang(String headerLang) {
181204
this.headerLang = headerLang;
182205
}

src/main/java/com/itextpdf/html2pdf/css/CssConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ This file is part of the iText (R) project.
2929
import java.util.HashSet;
3030
import java.util.Set;
3131

32+
/**
33+
* Class containing possible CSS property keys and values, pseudo-element keys,
34+
* units of measurement, and so on, specific for html2pdf module.
35+
*/
3236
public class CssConstants extends CommonCssConstants {
3337

3438
/** The Constant AUTO_FIT. */

src/main/java/com/itextpdf/html2pdf/css/apply/util/OutlineApplierUtil.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ This file is part of the iText (R) project.
5050

5151
import java.util.Map;
5252

53+
/**
54+
* Utility class to apply outline properties.
55+
*/
5356
public class OutlineApplierUtil {
5457

5558
/**

src/main/java/com/itextpdf/html2pdf/css/apply/util/TextDecorationApplierUtil.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ This file is part of the iText (R) project.
3131
import java.util.List;
3232
import java.util.Set;
3333

34+
/**
35+
* Utility class which processes text decoration properties.
36+
*/
3437
public final class TextDecorationApplierUtil {
3538
private static final String IGNORED = "__ignored__";
3639
private static final SupportedTextDecoration[] SUPPORTED_TEXT_DECORATION_PROPERTIES =
@@ -45,6 +48,16 @@ public final class TextDecorationApplierUtil {
4548
private TextDecorationApplierUtil() {
4649
}
4750

51+
/**
52+
* Expand text decoration properties to the element if needed.
53+
* <p>
54+
* E.g. the following:
55+
* {@code text-decoration-line: overline underline; text-decoration-color: pink}
56+
* will be translated to:
57+
* {@code text-decoration-line: overline underline; text-decoration-color: pink pink}
58+
*
59+
* @param currentNode the element which decoration properties shall be expanded
60+
*/
4861
public static void propagateTextDecorationProperties(IElementNode currentNode) {
4962
expandTextDecorationProperties(currentNode);
5063
if (!shouldPropagateTextDecorationProperties(currentNode)) {

src/main/java/com/itextpdf/html2pdf/css/apply/util/TransformationApplierUtil.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ This file is part of the iText (R) project.
3737
import static java.lang.Math.sin;
3838
import static java.lang.Math.tan;
3939

40+
/**
41+
* Utility class to apply transform properties.
42+
*/
4043
public class TransformationApplierUtil {
4144

4245
/**

0 commit comments

Comments
 (0)