Browse Source

Sonar Fixes - public final class with private constructor for examples

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1875902 13f79535-47bb-0310-9956-ffa450edef68
tags/before_ooxml_3rd_edition
Alain Béarez 4 years ago
parent
commit
65990027e1

+ 1
- 0
src/examples/src/org/apache/poi/xslf/usermodel/DataExtraction.java View File

@@ -32,6 +32,7 @@ import org.apache.poi.openxml4j.opc.PackagePart;
* Demonstrates how you can extract data from a .pptx file
*/
public final class DataExtraction {
private DataExtraction() {}

public static void main(String[] args) throws IOException, OpenXML4JException {


+ 1
- 0
src/examples/src/org/apache/poi/xslf/usermodel/MergePresentations.java View File

@@ -26,6 +26,7 @@ import java.io.FileOutputStream;
* Merge multiple pptx presentations together
*/
public final class MergePresentations {
private MergePresentations() {}

public static void main(String[] args) throws Exception {
try (XMLSlideShow ppt = new XMLSlideShow()) {

+ 3
- 1
src/examples/src/org/apache/poi/xslf/usermodel/PieChartDemo.java View File

@@ -38,7 +38,9 @@ import org.apache.poi.xddf.usermodel.chart.XDDFPieChartData;
/**
* Build a pie chart from a template pptx
*/
public class PieChartDemo {
public final class PieChartDemo {
private PieChartDemo() {}

private static void usage(){
System.out.println("Usage: PieChartDemo <pie-chart-template.pptx> <pie-chart-data.txt>");
System.out.println(" pie-chart-template.pptx template with a pie chart");

+ 2
- 1
src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java View File

@@ -26,7 +26,8 @@ import java.io.IOException;
* Demonstrates how to create slides with predefined layout
* and fill the placeholder shapes
*/
public class Tutorial1 {
public final class Tutorial1 {
private Tutorial1() {}

public static void main(String[] args) throws IOException{
try (XMLSlideShow ppt = new XMLSlideShow()) {

+ 2
- 1
src/examples/src/org/apache/poi/xslf/usermodel/Tutorial2.java View File

@@ -27,7 +27,8 @@ import java.io.IOException;
/**
* Basic paragraph and text formatting
*/
public class Tutorial2 {
public final class Tutorial2 {
private Tutorial2() {}

public static void main(String[] args) throws IOException{
try (XMLSlideShow ppt = new XMLSlideShow()) {

+ 2
- 1
src/examples/src/org/apache/poi/xslf/usermodel/Tutorial3.java View File

@@ -28,7 +28,8 @@ import org.apache.poi.sl.usermodel.Placeholder;
/**
* How to set slide title
*/
public class Tutorial3 {
public final class Tutorial3 {
private Tutorial3() {}

public static void main(String[] args) throws IOException{
try (XMLSlideShow ppt = new XMLSlideShow()) {

+ 2
- 1
src/examples/src/org/apache/poi/xslf/usermodel/Tutorial4.java View File

@@ -30,7 +30,8 @@ import org.apache.poi.sl.usermodel.TextParagraph.TextAlign;
/**
* PPTX Tables
*/
public class Tutorial4 {
public final class Tutorial4 {
private Tutorial4() {}

public static void main(String[] args) throws IOException{
try (XMLSlideShow ppt = new XMLSlideShow()) {

+ 2
- 1
src/examples/src/org/apache/poi/xslf/usermodel/Tutorial5.java View File

@@ -28,7 +28,8 @@ import org.apache.poi.sl.usermodel.PictureData.PictureType;
/**
* Images
*/
public class Tutorial5 {
public final class Tutorial5 {
private Tutorial5() {}

public static void main(String[] args) throws IOException{
try (XMLSlideShow ppt = new XMLSlideShow()) {

+ 2
- 1
src/examples/src/org/apache/poi/xslf/usermodel/Tutorial6.java View File

@@ -26,7 +26,8 @@ import java.io.IOException;
/**
* Hyperlinks
*/
public class Tutorial6 {
public final class Tutorial6 {
private Tutorial6() {}

public static void main(String[] args) throws IOException{
try (XMLSlideShow ppt = new XMLSlideShow()) {

+ 2
- 1
src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java View File

@@ -29,7 +29,8 @@ import org.apache.poi.sl.usermodel.AutoNumberingScheme;
/**
* Bullets and numbering
*/
public class Tutorial7 {
public final class Tutorial7 {
private Tutorial7() {}

public static void main(String[] args) throws IOException {
try (XMLSlideShow ppt = new XMLSlideShow()) {

+ 2
- 1
src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java View File

@@ -31,7 +31,8 @@ import org.apache.poi.xslf.usermodel.XSLFTextShape;
/**
* Reading a .pptx presentation and printing basic shape properties
*/
public class Step1 {
public final class Step1 {
private Step1() {}

public static void main(String[] args) throws Exception {
if(args.length == 0) {

+ 3
- 1
src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step2.java View File

@@ -31,7 +31,9 @@ import java.io.FileOutputStream;
/**
* Create slides from pre-defined slide layouts
*/
public class Step2 {
public final class Step2 {
private Step2() {}

public static void main(String[] args) throws Exception{
try (XMLSlideShow ppt = new XMLSlideShow()) {


+ 2
- 1
src/examples/src/org/apache/poi/xssf/usermodel/examples/BarChart.java View File

@@ -48,7 +48,8 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
* Line chart example.
*/
public class BarChart {
public final class BarChart {
private BarChart() {}

public static void main(String[] args) throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {

+ 2
- 1
src/examples/src/org/apache/poi/xssf/usermodel/examples/ExcelChartWithTargetLine.java View File

@@ -62,7 +62,8 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
* @see <a href="https://stackoverflow.com/questions/50873700/">Change axis color and font of the chart in openxmlformats</a>
* @see <a href="https://stackoverflow.com/questions/51530552/">Change colors of line chart Apache POI</a>
*/
class ExcelChartWithTargetLine {
public final class ExcelChartWithTargetLine {
private ExcelChartWithTargetLine() {}

private static final int NUM_OF_ROWS = 6;


+ 2
- 1
src/examples/src/org/apache/poi/xssf/usermodel/examples/LineChart.java View File

@@ -49,7 +49,8 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
* Line chart example.
*/
public class LineChart {
public final class LineChart {
private LineChart() {}

public static void main(String[] args) throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {

+ 2
- 1
src/examples/src/org/apache/poi/xssf/usermodel/examples/ScatterChart.java View File

@@ -50,7 +50,8 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
* Illustrates how to create a simple scatter chart.
*/
public class ScatterChart {
public final class ScatterChart {
private ScatterChart() {}

public static void main(String[] args) throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {

+ 3
- 1
src/examples/src/org/apache/poi/xwpf/usermodel/examples/BarChartExample.java View File

@@ -43,7 +43,9 @@ import org.apache.poi.xwpf.usermodel.XWPFDocument;
/**
* Build a bar chart from a template docx
*/
public class BarChartExample {
public final class BarChartExample {
private BarChartExample() {}

private static void usage(){
System.out.println("Usage: BarChartExample <bar-chart-template.docx> <bar-chart-data.txt>");
System.out.println(" bar-chart-template.docx template with a bar chart");

Loading…
Cancel
Save