Skip to content

Commit 35ca203

Browse files
Egor Martsynkovskyintrofog
authored andcommitted
Change extending
Update imports related to moving some classe to another package DEVSIX-5741
1 parent 41d9ae4 commit 35ca203

38 files changed

+89
-80
lines changed

src/main/java/com/itextpdf/html2pdf/attach/impl/layout/PageCountRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public IRenderer getNextRenderer() {
130130
if (PageCountRenderer.class != this.getClass()) {
131131
Logger logger = LoggerFactory.getLogger(PageCountRenderer.class);
132132
logger.error(MessageFormatUtil.format(
133-
com.itextpdf.io.LogMessageConstant.GET_NEXT_RENDERER_SHOULD_BE_OVERRIDDEN));
133+
LogMessageConstant.GET_NEXT_RENDERER_SHOULD_BE_OVERRIDDEN));
134134
}
135135
return new PageCountRenderer((PageCountElement) modelElement);
136136
}

src/main/java/com/itextpdf/html2pdf/attach/impl/layout/PageTargetCountRenderer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This file is part of the iText (R) project.
2424

2525
import com.itextpdf.html2pdf.css.resolve.func.counter.CounterDigitsGlyphStyle;
2626
import com.itextpdf.html2pdf.html.HtmlUtils;
27+
import com.itextpdf.io.LogMessageConstant;
2728
import com.itextpdf.io.font.otf.GlyphLine;
2829
import com.itextpdf.html2pdf.logs.Html2PdfLogMessageConstant;
2930
import com.itextpdf.commons.utils.MessageFormatUtil;
@@ -107,7 +108,7 @@ public IRenderer getNextRenderer() {
107108
if (PageTargetCountRenderer.class != this.getClass()) {
108109
Logger logger = LoggerFactory.getLogger(PageTargetCountRenderer.class);
109110
logger.error(MessageFormatUtil.format(
110-
com.itextpdf.io.LogMessageConstant.GET_NEXT_RENDERER_SHOULD_BE_OVERRIDDEN));
111+
LogMessageConstant.GET_NEXT_RENDERER_SHOULD_BE_OVERRIDDEN));
111112
}
112113
return new PageTargetCountRenderer((PageTargetCountElement) modelElement);
113114
}
@@ -120,7 +121,7 @@ protected TextRenderer createCopy(GlyphLine gl, PdfFont font) {
120121
if (PageTargetCountRenderer.class != this.getClass()) {
121122
Logger logger = LoggerFactory.getLogger(PageTargetCountRenderer.class);
122123
logger.error(MessageFormatUtil.format(
123-
com.itextpdf.io.LogMessageConstant.CREATE_COPY_SHOULD_BE_OVERRIDDEN));
124+
LogMessageConstant.CREATE_COPY_SHOULD_BE_OVERRIDDEN));
124125
}
125126
PageTargetCountRenderer copy = new PageTargetCountRenderer(this);
126127
copy.setProcessedGlyphLineAndFont(gl, font);

src/main/java/com/itextpdf/html2pdf/attach/impl/layout/form/renderer/InputButtonRenderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ This file is part of the iText (R) project.
4949
import com.itextpdf.html2pdf.attach.impl.layout.Html2PdfProperty;
5050
import com.itextpdf.html2pdf.attach.impl.layout.form.element.InputButton;
5151
import com.itextpdf.commons.utils.MessageFormatUtil;
52+
import com.itextpdf.io.LogMessageConstant;
5253
import com.itextpdf.kernel.geom.Rectangle;
5354
import com.itextpdf.kernel.pdf.PdfDocument;
5455
import com.itextpdf.kernel.pdf.PdfPage;
@@ -137,7 +138,7 @@ protected void applyAcroField(DrawContext drawContext) {
137138
UnitValue fontSize = (UnitValue) this.getPropertyAsUnitValue(Property.FONT_SIZE);
138139
if (!fontSize.isPointValue()) {
139140
Logger logger = LoggerFactory.getLogger(InputButtonRenderer.class);
140-
logger.error(MessageFormatUtil.format(com.itextpdf.io.LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
141+
logger.error(MessageFormatUtil.format(LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
141142
}
142143
PdfDocument doc = drawContext.getDocument();
143144
Rectangle area = flatRenderer.getOccupiedArea().getBBox().clone();

src/main/java/com/itextpdf/html2pdf/attach/impl/layout/form/renderer/InputFieldRenderer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ This file is part of the iText (R) project.
4848
import com.itextpdf.html2pdf.attach.impl.layout.Html2PdfProperty;
4949
import com.itextpdf.html2pdf.attach.impl.layout.form.element.InputField;
5050
import com.itextpdf.commons.utils.MessageFormatUtil;
51+
import com.itextpdf.io.LogMessageConstant;
5152
import com.itextpdf.kernel.geom.Rectangle;
5253
import com.itextpdf.kernel.pdf.PdfDocument;
5354
import com.itextpdf.kernel.pdf.PdfPage;
@@ -163,7 +164,7 @@ protected void applyAcroField(DrawContext drawContext) {
163164
UnitValue fontSize = (UnitValue) this.getPropertyAsUnitValue(Property.FONT_SIZE);
164165
if (!fontSize.isPointValue()) {
165166
Logger logger = LoggerFactory.getLogger(InputFieldRenderer.class);
166-
logger.error(MessageFormatUtil.format(com.itextpdf.io.LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
167+
logger.error(MessageFormatUtil.format(LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
167168
}
168169
PdfDocument doc = drawContext.getDocument();
169170
Rectangle area = flatRenderer.getOccupiedArea().getBBox().clone();
@@ -192,7 +193,7 @@ public <T1> T1 getProperty(int key) {
192193
UnitValue fontSize = (UnitValue) this.getPropertyAsUnitValue(Property.FONT_SIZE);
193194
if (!fontSize.isPointValue()) {
194195
Logger logger = LoggerFactory.getLogger(InputFieldRenderer.class);
195-
logger.error(MessageFormatUtil.format(com.itextpdf.io.LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
196+
logger.error(MessageFormatUtil.format(LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
196197
}
197198
int size = getSize();
198199
return (T1) (Object) UnitValue.createPointValue(updateHtmlColsSizeBasedWidth(fontSize.getValue() * (size * 0.5f + 2) + 2));

src/main/java/com/itextpdf/html2pdf/attach/impl/layout/form/renderer/TextAreaRenderer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ This file is part of the iText (R) project.
4848
import com.itextpdf.html2pdf.attach.impl.layout.Html2PdfProperty;
4949
import com.itextpdf.html2pdf.attach.impl.layout.form.element.TextArea;
5050
import com.itextpdf.commons.utils.MessageFormatUtil;
51+
import com.itextpdf.io.LogMessageConstant;
5152
import com.itextpdf.kernel.geom.Rectangle;
5253
import com.itextpdf.kernel.pdf.PdfDocument;
5354
import com.itextpdf.kernel.pdf.PdfPage;
@@ -169,7 +170,7 @@ protected void applyAcroField(DrawContext drawContext) {
169170
UnitValue fontSize = (UnitValue) this.getPropertyAsUnitValue(Property.FONT_SIZE);
170171
if (!fontSize.isPointValue()) {
171172
Logger logger = LoggerFactory.getLogger(TextAreaRenderer.class);
172-
logger.error(MessageFormatUtil.format(com.itextpdf.io.LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
173+
logger.error(MessageFormatUtil.format(LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
173174
}
174175
PdfDocument doc = drawContext.getDocument();
175176
Rectangle area = flatRenderer.getOccupiedArea().getBBox().clone();
@@ -191,7 +192,7 @@ public <T1> T1 getProperty(int key) {
191192
UnitValue fontSize = (UnitValue) this.getPropertyAsUnitValue(Property.FONT_SIZE);
192193
if (!fontSize.isPointValue()) {
193194
Logger logger = LoggerFactory.getLogger(TextAreaRenderer.class);
194-
logger.error(MessageFormatUtil.format(com.itextpdf.io.LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
195+
logger.error(MessageFormatUtil.format(LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE));
195196
}
196197
int cols = getCols();
197198
return (T1) (Object) UnitValue.createPointValue(updateHtmlColsSizeBasedWidth(fontSize.getValue() * (cols * 0.5f + 2) + 2));

src/main/java/com/itextpdf/html2pdf/exceptions/CssApplierInitializationException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ This file is part of the iText (R) project.
4242
*/
4343
package com.itextpdf.html2pdf.exceptions;
4444

45+
import com.itextpdf.commons.exceptions.ITextException;
4546
import com.itextpdf.commons.utils.MessageFormatUtil;
4647

4748
/**
4849
* Runtime exception in case a CSS applier can't be initialized.
4950
*/
50-
public class CssApplierInitializationException extends RuntimeException {
51+
public class CssApplierInitializationException extends ITextException {
5152

5253
/** The message template in case reflection failed. */
5354
public static final String REFLECTION_FAILED = "Could not instantiate CssApplier-class {0} for tag {1}.";

src/main/java/com/itextpdf/html2pdf/exceptions/Html2PdfException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ This file is part of the iText (R) project.
4242
*/
4343
package com.itextpdf.html2pdf.exceptions;
4444

45+
import com.itextpdf.commons.exceptions.ITextException;
46+
4547
/**
4648
* Runtime exception that gets thrown if something goes wrong in the HTML to PDF conversion.
4749
*/
48-
public class Html2PdfException extends RuntimeException {
50+
public class Html2PdfException extends ITextException {
4951

5052
/** Message in case one tries to write to a PDF document that isn't in writing mode. */
5153
public static final String PDF_DOCUMENT_SHOULD_BE_IN_WRITING_MODE = "PdfDocument should be created "

src/main/java/com/itextpdf/html2pdf/exceptions/TagWorkerInitializationException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ This file is part of the iText (R) project.
4242
*/
4343
package com.itextpdf.html2pdf.exceptions;
4444

45+
import com.itextpdf.commons.exceptions.ITextException;
4546
import com.itextpdf.commons.utils.MessageFormatUtil;
4647

4748
/**
4849
* Runtime exception that gets thrown if a tag worker can't be initialized.
4950
*/
50-
public class TagWorkerInitializationException extends RuntimeException {
51+
public class TagWorkerInitializationException extends ITextException {
5152

5253
/** Template for the error message in case a tag worker couldn't be instantiated. */
5354
public static final String REFLECTION_IN_TAG_WORKER_FACTORY_IMPLEMENTATION_FAILED = "Could not "

src/test/java/com/itextpdf/html2pdf/Html2ElementsTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This file is part of the iText (R) project.
4747
import com.itextpdf.html2pdf.logs.Html2PdfLogMessageConstant;
4848
import com.itextpdf.io.source.ByteArrayOutputStream;
4949
import com.itextpdf.io.util.UrlUtil;
50-
import com.itextpdf.kernel.PdfException;
50+
import com.itextpdf.kernel.exceptions.PdfException;
5151
import com.itextpdf.commons.actions.EventManager;
5252
import com.itextpdf.commons.actions.IEvent;
5353
import com.itextpdf.commons.actions.IEventHandler;
@@ -70,6 +70,7 @@ This file is part of the iText (R) project.
7070
import com.itextpdf.layout.properties.Leading;
7171
import com.itextpdf.layout.properties.Property;
7272
import com.itextpdf.layout.properties.UnitValue;
73+
import com.itextpdf.styledxmlparser.LogMessageConstant;
7374
import com.itextpdf.test.ExtendedITextTest;
7475
import com.itextpdf.test.annotations.LogMessage;
7576
import com.itextpdf.test.annotations.LogMessages;
@@ -201,7 +202,7 @@ public void htmlToElementsTest09() {
201202
}
202203

203204
@Test
204-
@LogMessages(messages = {@LogMessage(messageTemplate = com.itextpdf.styledxmlparser.LogMessageConstant.UNABLE_TO_RETRIEVE_STREAM_WITH_GIVEN_BASE_URI, count = 1),
205+
@LogMessages(messages = {@LogMessage(messageTemplate = LogMessageConstant.UNABLE_TO_RETRIEVE_STREAM_WITH_GIVEN_BASE_URI, count = 1),
205206
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_OTHER_WORKER, count = 1),
206207
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.PDF_DOCUMENT_NOT_PRESENT, count = 1),
207208
})

src/test/java/com/itextpdf/html2pdf/Html2PdfTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ This file is part of the iText (R) project.
5555
import com.itextpdf.styledxmlparser.IXmlParser;
5656
import com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription;
5757
import com.itextpdf.styledxmlparser.css.media.MediaType;
58+
import com.itextpdf.styledxmlparser.LogMessageConstant;
5859
import com.itextpdf.styledxmlparser.node.IDocumentNode;
5960
import com.itextpdf.styledxmlparser.node.impl.jsoup.JsoupHtmlParser;
6061
import com.itextpdf.test.ExtendedITextTest;
@@ -139,7 +140,7 @@ public void base64svgTest() throws IOException, InterruptedException {
139140
}
140141

141142
@Test
142-
@LogMessages(messages = {@LogMessage(messageTemplate = com.itextpdf.styledxmlparser.LogMessageConstant.UNABLE_TO_RETRIEVE_STREAM_WITH_GIVEN_BASE_URI, count = 1),
143+
@LogMessages(messages = {@LogMessage(messageTemplate = LogMessageConstant.UNABLE_TO_RETRIEVE_STREAM_WITH_GIVEN_BASE_URI, count = 1),
143144
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_OTHER_WORKER, count = 1)})
144145
public void htmlObjectIncorrectBase64Test() throws IOException, InterruptedException {
145146
HtmlConverter.convertToPdf(new File(sourceFolder + "objectTag_incorrectBase64svg.html"), new File(destinationFolder + "objectTag_incorrectBase64svg.pdf"));
@@ -167,7 +168,7 @@ public void htmlObjectNestedObjectTest() throws IOException, InterruptedExceptio
167168

168169
@Test
169170
@LogMessages(ignore = true, messages = {
170-
@LogMessage(messageTemplate = com.itextpdf.styledxmlparser.LogMessageConstant.RULE_IS_NOT_SUPPORTED),
171+
@LogMessage(messageTemplate = LogMessageConstant.RULE_IS_NOT_SUPPORTED),
171172
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.CSS_PROPERTY_IN_PERCENTS_NOT_SUPPORTED),
172173
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.PADDING_VALUE_IN_PERCENT_NOT_SUPPORTED),
173174
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.MARGIN_VALUE_IN_PERCENT_NOT_SUPPORTED),

0 commit comments

Comments
 (0)