Skip to content

Commit

Permalink
Quality gate fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Aug 20, 2023
1 parent 99caf0e commit eeae34f
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 89 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
/*****************************************************************
<copyright>
Fugerit Java Library org.fugerit.java.doc.base
Copyright (c) 2019 Fugerit
All rights reserved. This program and the accompanying materials
are made available under the terms of the Apache License v2.0
which accompanies this distribution, and is available at
http://www.apache.org/licenses/
(txt version : http://www.apache.org/licenses/LICENSE-2.0.txt
html version : http://www.apache.org/licenses/LICENSE-2.0.html)
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
</copyright>
*****************************************************************/
/*
* @(#)ITextDocHandler.java
*
* @project : org.fugerit.java.doc.base
* @package : org.fugerit.java.doc.mod.itext
* @creation : 06/set/06
* @license : META-INF/LICENSE.TXT
*/
package org.fugerit.java.doc.mod.openpdf;


Expand Down Expand Up @@ -56,6 +31,8 @@ The Apache Software Foundation (http://www.apache.org/).
import org.fugerit.java.doc.base.model.DocStyle;
import org.fugerit.java.doc.base.model.DocTable;
import org.fugerit.java.doc.base.xml.DocModelUtils;
import org.fugerit.java.doc.mod.openpdf.helpers.CellParent;
import org.fugerit.java.doc.mod.openpdf.helpers.DocumentParent;

import com.lowagie.text.Anchor;
import com.lowagie.text.Cell;
Expand Down Expand Up @@ -85,12 +62,6 @@ The Apache Software Foundation (http://www.apache.org/).
import com.lowagie.text.rtf.RtfWriter2;
import com.lowagie.text.rtf.headerfooter.RtfHeaderFooter;

/**
*
*
* @author mfranci
*
*/
public class ITextDocHandler {


Expand All @@ -100,7 +71,7 @@ public class ITextDocHandler {

public static final String PARAM_PAGE_TOTAL = "totalPage";

public static final String PARAM_PAGE_TOTAL_FINDER = ParamFinder.DEFAULT_PRE+"totalPage"+ParamFinder.DEFAULT_POST;
public static final String PARAM_PAGE_TOTAL_FINDER = ParamFinder.DEFAULT_PRE+PARAM_PAGE_TOTAL+ParamFinder.DEFAULT_POST;

private static HashMap<String, BaseFont> fonts = new HashMap<>();

Expand Down Expand Up @@ -698,60 +669,3 @@ private HeaderFooter createHeaderFooter( DocHeaderFooter container, int align, I

}


interface ParentElement {

public void add( Element element ) throws Exception;

}

class PhraseParent implements ParentElement {

private Phrase phrase;

public PhraseParent( Phrase phrase ) {
this.phrase = phrase;
}

/* (non-Javadoc)
* @see org.fugerit.java.doc.mod.itext.ParentElement#add(com.lowagie.text.Element)
*/
public void add(Element element) throws Exception {
this.phrase.add( element );
}

}

class DocumentParent implements ParentElement {

private Document document;

public DocumentParent( Document document) {
this.document = document;
}

/* (non-Javadoc)
* @see org.fugerit.java.doc.mod.itext.ParentElement#add(com.lowagie.text.Element)
*/
public void add(Element element) throws Exception {
this.document.add( element );
}

}

class CellParent implements ParentElement {

private Cell cell;

public CellParent( Cell cell ) {
this.cell = cell;
}

/* (non-Javadoc)
* @see org.fugerit.java.doc.mod.itext.ParentElement#add(com.lowagie.text.Element)
*/
public void add(Element element) throws Exception {
this.cell.addElement( element );
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.fugerit.java.doc.mod.openpdf.helpers;

import com.lowagie.text.Cell;
import com.lowagie.text.Element;

public class CellParent implements ParentElement {

private Cell cell;

public CellParent( Cell cell ) {
this.cell = cell;
}

/* (non-Javadoc)
* @see org.fugerit.java.doc.mod.itext.ParentElement#add(com.lowagie.text.Element)
*/
public void add(Element element) throws Exception {
this.cell.addElement( element );
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.fugerit.java.doc.mod.openpdf.helpers;

import com.lowagie.text.Document;
import com.lowagie.text.Element;

public class DocumentParent implements ParentElement {

private Document document;

public DocumentParent( Document document) {
this.document = document;
}

/* (non-Javadoc)
* @see org.fugerit.java.doc.mod.itext.ParentElement#add(com.lowagie.text.Element)
*/
public void add(Element element) throws Exception {
this.document.add( element );
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.fugerit.java.doc.mod.openpdf.helpers;

import com.lowagie.text.Element;

public interface ParentElement {

public void add( Element element ) throws Exception;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.fugerit.java.doc.mod.openpdf.helpers;

import com.lowagie.text.Element;
import com.lowagie.text.Phrase;

public class PhraseParent implements ParentElement {

private Phrase phrase;

public PhraseParent( Phrase phrase ) {
this.phrase = phrase;
}

/* (non-Javadoc)
* @see org.fugerit.java.doc.mod.itext.ParentElement#add(com.lowagie.text.Element)
*/
public void add(Element element) throws Exception {
this.phrase.add( element );
}

}

0 comments on commit eeae34f

Please sign in to comment.