add @Internal annotation to methods that return a CT* class

add @Override annotation where missing

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800360 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2017-06-30 07:45:46 +00:00
parent 07a7987a48
commit 7cb0588daf
4 changed files with 60 additions and 3 deletions

View File

@ -23,6 +23,7 @@ import org.apache.poi.ss.usermodel.charts.AxisPosition;
import org.apache.poi.ss.usermodel.charts.AxisTickMark; import org.apache.poi.ss.usermodel.charts.AxisTickMark;
import org.apache.poi.ss.usermodel.charts.ChartAxis; import org.apache.poi.ss.usermodel.charts.ChartAxis;
import org.apache.poi.util.Beta; import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.usermodel.XSSFChart; import org.apache.poi.xssf.usermodel.XSSFChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos; import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean; import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean;
@ -55,18 +56,23 @@ public class XSSFCategoryAxis extends XSSFChartAxis {
this.ctCatAx = ctCatAx; this.ctCatAx = ctCatAx;
} }
@Override
public long getId() { public long getId() {
return ctCatAx.getAxId().getVal(); return ctCatAx.getAxId().getVal();
} }
@Override
@Internal
public CTShapeProperties getLine() { public CTShapeProperties getLine() {
return ctCatAx.getSpPr(); return ctCatAx.getSpPr();
} }
@Override
protected CTAxPos getCTAxPos() { protected CTAxPos getCTAxPos() {
return ctCatAx.getAxPos(); return ctCatAx.getAxPos();
} }
@Override
protected CTNumFmt getCTNumFmt() { protected CTNumFmt getCTNumFmt() {
if (ctCatAx.isSetNumFmt()) { if (ctCatAx.isSetNumFmt()) {
return ctCatAx.getNumFmt(); return ctCatAx.getNumFmt();
@ -74,10 +80,12 @@ public class XSSFCategoryAxis extends XSSFChartAxis {
return ctCatAx.addNewNumFmt(); return ctCatAx.addNewNumFmt();
} }
@Override
protected CTScaling getCTScaling() { protected CTScaling getCTScaling() {
return ctCatAx.getScaling(); return ctCatAx.getScaling();
} }
@Override
protected CTCrosses getCTCrosses() { protected CTCrosses getCTCrosses() {
return ctCatAx.getCrosses(); return ctCatAx.getCrosses();
} }
@ -97,10 +105,13 @@ public class XSSFCategoryAxis extends XSSFChartAxis {
return ctCatAx.getMinorTickMark(); return ctCatAx.getMinorTickMark();
} }
@Override
@Internal
public CTChartLines getMajorGridLines() { public CTChartLines getMajorGridLines() {
return ctCatAx.getMajorGridlines(); return ctCatAx.getMajorGridlines();
} }
@Override
public void crossAxis(ChartAxis axis) { public void crossAxis(ChartAxis axis) {
ctCatAx.getCrossAx().setVal(axis.getId()); ctCatAx.getCrossAx().setVal(axis.getId());
} }
@ -125,6 +136,7 @@ public class XSSFCategoryAxis extends XSSFChartAxis {
setMinorTickMark(AxisTickMark.NONE); setMinorTickMark(AxisTickMark.NONE);
} }
@Override
public boolean hasNumberFormat() { public boolean hasNumberFormat() {
return ctCatAx.isSetNumFmt(); return ctCatAx.isSetNumFmt();
} }

View File

@ -23,6 +23,7 @@ import org.apache.poi.ss.usermodel.charts.AxisPosition;
import org.apache.poi.ss.usermodel.charts.AxisTickMark; import org.apache.poi.ss.usermodel.charts.AxisTickMark;
import org.apache.poi.ss.usermodel.charts.ChartAxis; import org.apache.poi.ss.usermodel.charts.ChartAxis;
import org.apache.poi.util.Beta; import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.usermodel.XSSFChart; import org.apache.poi.xssf.usermodel.XSSFChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos; import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean; import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean;
@ -56,27 +57,33 @@ public abstract class XSSFChartAxis implements ChartAxis {
this.chart = chart; this.chart = chart;
} }
@Override
public AxisPosition getPosition() { public AxisPosition getPosition() {
return toAxisPosition(getCTAxPos()); return toAxisPosition(getCTAxPos());
} }
@Override
public void setPosition(AxisPosition position) { public void setPosition(AxisPosition position) {
getCTAxPos().setVal(fromAxisPosition(position)); getCTAxPos().setVal(fromAxisPosition(position));
} }
@Override
public void setNumberFormat(String format) { public void setNumberFormat(String format) {
getCTNumFmt().setFormatCode(format); getCTNumFmt().setFormatCode(format);
getCTNumFmt().setSourceLinked(true); getCTNumFmt().setSourceLinked(true);
} }
@Override
public String getNumberFormat() { public String getNumberFormat() {
return getCTNumFmt().getFormatCode(); return getCTNumFmt().getFormatCode();
} }
@Override
public boolean isSetLogBase() { public boolean isSetLogBase() {
return getCTScaling().isSetLogBase(); return getCTScaling().isSetLogBase();
} }
@Override
public void setLogBase(double logBase) { public void setLogBase(double logBase) {
if (logBase < MIN_LOG_BASE || if (logBase < MIN_LOG_BASE ||
MAX_LOG_BASE < logBase) { MAX_LOG_BASE < logBase) {
@ -90,6 +97,7 @@ public abstract class XSSFChartAxis implements ChartAxis {
} }
} }
@Override
public double getLogBase() { public double getLogBase() {
CTLogBase logBase = getCTScaling().getLogBase(); CTLogBase logBase = getCTScaling().getLogBase();
if (logBase != null) { if (logBase != null) {
@ -98,10 +106,12 @@ public abstract class XSSFChartAxis implements ChartAxis {
return 0.0; return 0.0;
} }
@Override
public boolean isSetMinimum() { public boolean isSetMinimum() {
return getCTScaling().isSetMin(); return getCTScaling().isSetMin();
} }
@Override
public void setMinimum(double min) { public void setMinimum(double min) {
CTScaling scaling = getCTScaling(); CTScaling scaling = getCTScaling();
if (scaling.isSetMin()) { if (scaling.isSetMin()) {
@ -111,6 +121,7 @@ public abstract class XSSFChartAxis implements ChartAxis {
} }
} }
@Override
public double getMinimum() { public double getMinimum() {
CTScaling scaling = getCTScaling(); CTScaling scaling = getCTScaling();
if (scaling.isSetMin()) { if (scaling.isSetMin()) {
@ -120,10 +131,12 @@ public abstract class XSSFChartAxis implements ChartAxis {
} }
} }
@Override
public boolean isSetMaximum() { public boolean isSetMaximum() {
return getCTScaling().isSetMax(); return getCTScaling().isSetMax();
} }
@Override
public void setMaximum(double max) { public void setMaximum(double max) {
CTScaling scaling = getCTScaling(); CTScaling scaling = getCTScaling();
if (scaling.isSetMax()) { if (scaling.isSetMax()) {
@ -133,6 +146,7 @@ public abstract class XSSFChartAxis implements ChartAxis {
} }
} }
@Override
public double getMaximum() { public double getMaximum() {
CTScaling scaling = getCTScaling(); CTScaling scaling = getCTScaling();
if (scaling.isSetMax()) { if (scaling.isSetMax()) {
@ -142,10 +156,12 @@ public abstract class XSSFChartAxis implements ChartAxis {
} }
} }
@Override
public AxisOrientation getOrientation() { public AxisOrientation getOrientation() {
return toAxisOrientation(getCTScaling().getOrientation()); return toAxisOrientation(getCTScaling().getOrientation());
} }
@Override
public void setOrientation(AxisOrientation orientation) { public void setOrientation(AxisOrientation orientation) {
CTScaling scaling = getCTScaling(); CTScaling scaling = getCTScaling();
STOrientation.Enum stOrientation = fromAxisOrientation(orientation); STOrientation.Enum stOrientation = fromAxisOrientation(orientation);
@ -156,34 +172,42 @@ public abstract class XSSFChartAxis implements ChartAxis {
} }
} }
@Override
public AxisCrosses getCrosses() { public AxisCrosses getCrosses() {
return toAxisCrosses(getCTCrosses()); return toAxisCrosses(getCTCrosses());
} }
@Override
public void setCrosses(AxisCrosses crosses) { public void setCrosses(AxisCrosses crosses) {
getCTCrosses().setVal(fromAxisCrosses(crosses)); getCTCrosses().setVal(fromAxisCrosses(crosses));
} }
@Override
public boolean isVisible() { public boolean isVisible() {
return !getDelete().getVal(); return !getDelete().getVal();
} }
@Override
public void setVisible(boolean value) { public void setVisible(boolean value) {
getDelete().setVal(!value); getDelete().setVal(!value);
} }
@Override
public AxisTickMark getMajorTickMark() { public AxisTickMark getMajorTickMark() {
return toAxisTickMark(getMajorCTTickMark()); return toAxisTickMark(getMajorCTTickMark());
} }
@Override
public void setMajorTickMark(AxisTickMark tickMark) { public void setMajorTickMark(AxisTickMark tickMark) {
getMajorCTTickMark().setVal(fromAxisTickMark(tickMark)); getMajorCTTickMark().setVal(fromAxisTickMark(tickMark));
} }
@Override
public AxisTickMark getMinorTickMark() { public AxisTickMark getMinorTickMark() {
return toAxisTickMark(getMinorCTTickMark()); return toAxisTickMark(getMinorCTTickMark());
} }
@Override
public void setMinorTickMark(AxisTickMark tickMark) { public void setMinorTickMark(AxisTickMark tickMark) {
getMinorCTTickMark().setVal(fromAxisTickMark(tickMark)); getMinorCTTickMark().setVal(fromAxisTickMark(tickMark));
} }
@ -195,8 +219,8 @@ public abstract class XSSFChartAxis implements ChartAxis {
protected abstract CTBoolean getDelete(); protected abstract CTBoolean getDelete();
protected abstract CTTickMark getMajorCTTickMark(); protected abstract CTTickMark getMajorCTTickMark();
protected abstract CTTickMark getMinorCTTickMark(); protected abstract CTTickMark getMinorCTTickMark();
public abstract CTChartLines getMajorGridLines(); @Internal public abstract CTChartLines getMajorGridLines();
public abstract CTShapeProperties getLine(); @Internal public abstract CTShapeProperties getLine();
private static STOrientation.Enum fromAxisOrientation(AxisOrientation orientation) { private static STOrientation.Enum fromAxisOrientation(AxisOrientation orientation) {
switch (orientation) { switch (orientation) {

View File

@ -23,10 +23,10 @@ import org.apache.poi.ss.usermodel.charts.AxisPosition;
import org.apache.poi.ss.usermodel.charts.AxisTickMark; import org.apache.poi.ss.usermodel.charts.AxisTickMark;
import org.apache.poi.ss.usermodel.charts.ChartAxis; import org.apache.poi.ss.usermodel.charts.ChartAxis;
import org.apache.poi.util.Beta; import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.usermodel.XSSFChart; import org.apache.poi.xssf.usermodel.XSSFChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos; import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean; import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTCatAx;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTChartLines; import org.openxmlformats.schemas.drawingml.x2006.chart.CTChartLines;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTCrosses; import org.openxmlformats.schemas.drawingml.x2006.chart.CTCrosses;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTDateAx; import org.openxmlformats.schemas.drawingml.x2006.chart.CTDateAx;
@ -63,18 +63,23 @@ public class XSSFDateAxis extends XSSFChartAxis {
this.ctDateAx = ctDateAx; this.ctDateAx = ctDateAx;
} }
@Override
public long getId() { public long getId() {
return ctDateAx.getAxId().getVal(); return ctDateAx.getAxId().getVal();
} }
@Override
@Internal
public CTShapeProperties getLine() { public CTShapeProperties getLine() {
return ctDateAx.getSpPr(); return ctDateAx.getSpPr();
} }
@Override
protected CTAxPos getCTAxPos() { protected CTAxPos getCTAxPos() {
return ctDateAx.getAxPos(); return ctDateAx.getAxPos();
} }
@Override
protected CTNumFmt getCTNumFmt() { protected CTNumFmt getCTNumFmt() {
if (ctDateAx.isSetNumFmt()) { if (ctDateAx.isSetNumFmt()) {
return ctDateAx.getNumFmt(); return ctDateAx.getNumFmt();
@ -82,10 +87,12 @@ public class XSSFDateAxis extends XSSFChartAxis {
return ctDateAx.addNewNumFmt(); return ctDateAx.addNewNumFmt();
} }
@Override
protected CTScaling getCTScaling() { protected CTScaling getCTScaling() {
return ctDateAx.getScaling(); return ctDateAx.getScaling();
} }
@Override
protected CTCrosses getCTCrosses() { protected CTCrosses getCTCrosses() {
return ctDateAx.getCrosses(); return ctDateAx.getCrosses();
} }
@ -105,10 +112,13 @@ public class XSSFDateAxis extends XSSFChartAxis {
return ctDateAx.getMinorTickMark(); return ctDateAx.getMinorTickMark();
} }
@Override
@Internal
public CTChartLines getMajorGridLines() { public CTChartLines getMajorGridLines() {
return ctDateAx.getMajorGridlines(); return ctDateAx.getMajorGridlines();
} }
@Override
public void crossAxis(ChartAxis axis) { public void crossAxis(ChartAxis axis) {
ctDateAx.getCrossAx().setVal(axis.getId()); ctDateAx.getCrossAx().setVal(axis.getId());
} }
@ -133,6 +143,7 @@ public class XSSFDateAxis extends XSSFChartAxis {
setMinorTickMark(AxisTickMark.NONE); setMinorTickMark(AxisTickMark.NONE);
} }
@Override
public boolean hasNumberFormat() { public boolean hasNumberFormat() {
return ctDateAx.isSetNumFmt(); return ctDateAx.isSetNumFmt();
} }

View File

@ -25,6 +25,7 @@ import org.apache.poi.ss.usermodel.charts.AxisTickMark;
import org.apache.poi.ss.usermodel.charts.ChartAxis; import org.apache.poi.ss.usermodel.charts.ChartAxis;
import org.apache.poi.ss.usermodel.charts.ValueAxis; import org.apache.poi.ss.usermodel.charts.ValueAxis;
import org.apache.poi.util.Beta; import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.usermodel.XSSFChart; import org.apache.poi.xssf.usermodel.XSSFChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos; import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean; import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean;
@ -58,18 +59,23 @@ public class XSSFValueAxis extends XSSFChartAxis implements ValueAxis {
this.ctValAx = ctValAx; this.ctValAx = ctValAx;
} }
@Override
public long getId() { public long getId() {
return ctValAx.getAxId().getVal(); return ctValAx.getAxId().getVal();
} }
@Override
@Internal
public CTShapeProperties getLine() { public CTShapeProperties getLine() {
return ctValAx.getSpPr(); return ctValAx.getSpPr();
} }
@Override
public void setCrossBetween(AxisCrossBetween crossBetween) { public void setCrossBetween(AxisCrossBetween crossBetween) {
ctValAx.getCrossBetween().setVal(fromCrossBetween(crossBetween)); ctValAx.getCrossBetween().setVal(fromCrossBetween(crossBetween));
} }
@Override
public AxisCrossBetween getCrossBetween() { public AxisCrossBetween getCrossBetween() {
return toCrossBetween(ctValAx.getCrossBetween().getVal()); return toCrossBetween(ctValAx.getCrossBetween().getVal());
} }
@ -112,10 +118,13 @@ public class XSSFValueAxis extends XSSFChartAxis implements ValueAxis {
return ctValAx.getMinorTickMark(); return ctValAx.getMinorTickMark();
} }
@Override
@Internal
public CTChartLines getMajorGridLines() { public CTChartLines getMajorGridLines() {
return ctValAx.getMajorGridlines(); return ctValAx.getMajorGridlines();
} }
@Override
public void crossAxis(ChartAxis axis) { public void crossAxis(ChartAxis axis) {
ctValAx.getCrossAx().setVal(axis.getId()); ctValAx.getCrossAx().setVal(axis.getId());
} }
@ -160,6 +169,7 @@ public class XSSFValueAxis extends XSSFChartAxis implements ValueAxis {
} }
} }
@Override
public boolean hasNumberFormat() { public boolean hasNumberFormat() {
return ctValAx.isSetNumFmt(); return ctValAx.isSetNumFmt();
} }