Skip to content

Commit

Permalink
chore: remove deprecated apis (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
maruTA-bis5 authored Feb 18, 2024
1 parent 10a9fbd commit e49aba7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 341 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -46,115 +44,6 @@ public DataTableExcellaExporter() {
super(new ExCellaExporterOptions(), ALL_FACETS, true);
}

private DataTableExcellaExporter(Builder builder) {
super(builder.options, ALL_FACETS, true);
setTemplatePath(builder.templatePath);
setTemplateUrl(builder.templateUrl);
setTemplateSheetName(builder.templateSheetName);
setDataColumnsTag(builder.dataColumnsTag);
setHeadersTag(builder.headersTag);
setFootersTag(builder.footersTag);
}

/**
* @deprecated Use {@link ExCellaExporterOptions}. This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
public static Builder builder() {
return new Builder();
}

/**
* @deprecated Use {@link ExCellaExporterOptions}. This class will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
public static class Builder {
private Path templatePath;
private URL templateUrl;
private String templateSheetName;
private String dataColumnsTag;
private String headersTag;
private String footersTag;
private ExCellaExporterOptions options = new ExCellaExporterOptions();

public Builder templatePath(Path templatePath) {
this.templatePath = templatePath;
return this;
}

public Builder templateUrl(URL templateUrl) {
this.templateUrl = templateUrl;
return this;
}

public Builder templateSheetName(String templateSheetName) {
this.templateSheetName = templateSheetName;
return this;
}

public Builder dataColumnsTag(String dataColumnsTag) {
this.dataColumnsTag = dataColumnsTag;
return this;
}

public Builder headersTag(String headersTag) {
this.headersTag = headersTag;
return this;
}

public Builder footersTag(String footersTag) {
this.footersTag = footersTag;
return this;
}

public Builder options(ExCellaExporterOptions options) {
this.options = options;
return this;
}

public DataTableExcellaExporter build() {
return new DataTableExcellaExporter(this);
}
}

/**
* @deprecated Use {@link ExCellaExporterOptions}. This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
@Override
public void setTemplatePath(Path templatePath) {
getExporterOptions().setTemplatePath(templatePath);
}

/**
* @deprecated Use {@link ExCellaExporterOptions}. This method will be removed in 5.0.0.
* @implNote Make this getter private in 5.0.0.
*/
@Deprecated(forRemoval = true)
@Override
public Path getTemplatePath() {
return getExporterOptions().getTemplatePath();
}

/**
* @deprecated Use {@link ExCellaExporterOptions}. This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
@Override
public void setTemplateUrl(URL templateUrl) {
getExporterOptions().setTemplateUrl(templateUrl);
}

/**
* @deprecated Use {@link ExCellaExporterOptions}. This method will be removed in 5.0.0.
* @implNote Make this getter private in 5.0.0.
*/
@Deprecated(forRemoval = true)
@Override
public URL getTemplateUrl() {
return getExporterOptions().getTemplateUrl();
}

@Override
public void setTemplateType(TemplateType templateType) {
this.templateType = templateType;
Expand All @@ -165,25 +54,6 @@ public TemplateType getTemplateType() {
return templateType;
}

/**
* @deprecated Use {@link #builder()}. This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
@Override
public void setTemplateSheetName(String templateSheetName) {
getExporterOptions().setTemplateSheetName(templateSheetName);
}

/**
* @deprecated Use {@link ExCellaExporterOptions}. This method will be removed in 5.0.0.
* @implNote Make this getter private in 5.0.0.
*/
@Deprecated(forRemoval = true)
@Override
public String getTemplateSheetName() {
return getExporterOptions().getTemplateSheetName();
}

@Override
public void addListener(ReportProcessListener listener) {
listeners.add(listener);
Expand Down Expand Up @@ -227,38 +97,14 @@ protected void exportCellValue(FacesContext context, DataTable table, UIColumn c
addCellValue(context, dataContainer, table, index, col);
}

/**
* @deprecated Use {@link #builder()}. This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
public void setDataColumnsTag(String dataColumnsTag) {
getExporterOptions().setDataColumnsTag(dataColumnsTag);
}

private String getDataColumnsTag() {
return getExporterOptions().getDataColumnsTag();
}

/**
* @deprecated Use {@link #builder()}. This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
public void setHeadersTag(String headersTag) {
getExporterOptions().setHeadersTag(headersTag);
}

private String getHeadersTag() {
return getExporterOptions().getHeadersTag();
}

/**
* @deprecated Use {@link #builder()}. This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
public void setFootersTag(String footersTag) {
getExporterOptions().setFootersTag(footersTag);
}

private String getFootersTag() {
return getExporterOptions().getFootersTag();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,17 @@ interface ExCellaExporter<T extends UITable<?>> {
String DEFAULT_TEMPLATE_SHEET_NAME = "DATA";
String DATA_CONTAINER_KEY = "DATA_CONTAINER_KEY";

/**
* @deprecated use each exporter's builder(). This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
void setTemplatePath(Path templatePath);
private Path getTemplatePath() {
return getExporterOptions().getTemplatePath();
}

/**
* @deprecated Use {@link ExCellaExporterOptions}. This method will be removed in 5.0.0.
* @implNote Make this getter private in 5.0.0.
*/
@Deprecated(forRemoval = true)
Path getTemplatePath();
/**
* @deprecated use each exporter's builder(). This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
void setTemplateUrl(URL templateUrl);
/**
* @deprecated Use {@link ExCellaExporterOptions}. This method will be removed in 5.0.0.
* @implNote Make this getter private in 5.0.0.
*/
@Deprecated(forRemoval = true)
URL getTemplateUrl();
private URL getTemplateUrl() {
return getExporterOptions().getTemplateUrl();
}

private String getTemplateSheetName() {
return getExporterOptions().getTemplateSheetName();
}

private URL getTemplateFileUrl() throws MalformedURLException {
if (getTemplatePath() != null) {
Expand All @@ -102,11 +90,6 @@ private URL getTemplateFileUrl() throws MalformedURLException {
return DEFAULT_TEMPLATE_URL;
}

/**
* @deprecated use each exporter's builder(). This method will be removed in 5.0.0.
*/
@Deprecated(forRemoval = true)
void setTemplateSheetName(String templateSheetName);
void setTemplateType(TemplateType templateType);
TemplateType getTemplateType();
void addListener(ReportProcessListener listener);
Expand Down Expand Up @@ -168,13 +151,6 @@ private void writeResponse(Path outputFile) throws IOException {

void reset();

/**
* @deprecated Use {@link ExCellaExporterOptions}. This method will be removed in 5.0.0.
* @implNote Make this getter private in 5.0.0.
*/
@Deprecated(forRemoval = true)
String getTemplateSheetName();

default void exportTable(FacesContext facesContext, T table, int index) throws IOException {
// 一度の出力で複数のテーブルが対象となった場合、このメソッドは引数のtable, indexを変えて複数回呼ばれる。
// このExporterでは1テーブルを1シートに出力する方針とする。
Expand Down
Loading

0 comments on commit e49aba7

Please sign in to comment.