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.ChartAxis;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.usermodel.XSSFChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean;
@ -55,18 +56,23 @@ public class XSSFCategoryAxis extends XSSFChartAxis {
this.ctCatAx = ctCatAx;
}
@Override
public long getId() {
return ctCatAx.getAxId().getVal();
}
@Override
@Internal
public CTShapeProperties getLine() {
return ctCatAx.getSpPr();
}
@Override
protected CTAxPos getCTAxPos() {
return ctCatAx.getAxPos();
}
@Override
protected CTNumFmt getCTNumFmt() {
if (ctCatAx.isSetNumFmt()) {
return ctCatAx.getNumFmt();
@ -74,10 +80,12 @@ public class XSSFCategoryAxis extends XSSFChartAxis {
return ctCatAx.addNewNumFmt();
}
@Override
protected CTScaling getCTScaling() {
return ctCatAx.getScaling();
}
@Override
protected CTCrosses getCTCrosses() {
return ctCatAx.getCrosses();
}
@ -97,10 +105,13 @@ public class XSSFCategoryAxis extends XSSFChartAxis {
return ctCatAx.getMinorTickMark();
}
@Override
@Internal
public CTChartLines getMajorGridLines() {
return ctCatAx.getMajorGridlines();
}
@Override
public void crossAxis(ChartAxis axis) {
ctCatAx.getCrossAx().setVal(axis.getId());
}
@ -125,6 +136,7 @@ public class XSSFCategoryAxis extends XSSFChartAxis {
setMinorTickMark(AxisTickMark.NONE);
}
@Override
public boolean hasNumberFormat() {
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.ChartAxis;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.usermodel.XSSFChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean;
@ -56,27 +57,33 @@ public abstract class XSSFChartAxis implements ChartAxis {
this.chart = chart;
}
@Override
public AxisPosition getPosition() {
return toAxisPosition(getCTAxPos());
}
@Override
public void setPosition(AxisPosition position) {
getCTAxPos().setVal(fromAxisPosition(position));
}
@Override
public void setNumberFormat(String format) {
getCTNumFmt().setFormatCode(format);
getCTNumFmt().setSourceLinked(true);
}
@Override
public String getNumberFormat() {
return getCTNumFmt().getFormatCode();
}
@Override
public boolean isSetLogBase() {
return getCTScaling().isSetLogBase();
}
@Override
public void setLogBase(double logBase) {
if (logBase < MIN_LOG_BASE ||
MAX_LOG_BASE < logBase) {
@ -90,6 +97,7 @@ public abstract class XSSFChartAxis implements ChartAxis {
}
}
@Override
public double getLogBase() {
CTLogBase logBase = getCTScaling().getLogBase();
if (logBase != null) {
@ -98,10 +106,12 @@ public abstract class XSSFChartAxis implements ChartAxis {
return 0.0;
}
@Override
public boolean isSetMinimum() {
return getCTScaling().isSetMin();
}
@Override
public void setMinimum(double min) {
CTScaling scaling = getCTScaling();
if (scaling.isSetMin()) {
@ -111,6 +121,7 @@ public abstract class XSSFChartAxis implements ChartAxis {
}
}
@Override
public double getMinimum() {
CTScaling scaling = getCTScaling();
if (scaling.isSetMin()) {
@ -120,10 +131,12 @@ public abstract class XSSFChartAxis implements ChartAxis {
}
}
@Override
public boolean isSetMaximum() {
return getCTScaling().isSetMax();
}
@Override
public void setMaximum(double max) {
CTScaling scaling = getCTScaling();
if (scaling.isSetMax()) {
@ -133,6 +146,7 @@ public abstract class XSSFChartAxis implements ChartAxis {
}
}
@Override
public double getMaximum() {
CTScaling scaling = getCTScaling();
if (scaling.isSetMax()) {
@ -142,10 +156,12 @@ public abstract class XSSFChartAxis implements ChartAxis {
}
}
@Override
public AxisOrientation getOrientation() {
return toAxisOrientation(getCTScaling().getOrientation());
}
@Override
public void setOrientation(AxisOrientation orientation) {
CTScaling scaling = getCTScaling();
STOrientation.Enum stOrientation = fromAxisOrientation(orientation);
@ -156,34 +172,42 @@ public abstract class XSSFChartAxis implements ChartAxis {
}
}
@Override
public AxisCrosses getCrosses() {
return toAxisCrosses(getCTCrosses());
}
@Override
public void setCrosses(AxisCrosses crosses) {
getCTCrosses().setVal(fromAxisCrosses(crosses));
}
@Override
public boolean isVisible() {
return !getDelete().getVal();
}
@Override
public void setVisible(boolean value) {
getDelete().setVal(!value);
}
@Override
public AxisTickMark getMajorTickMark() {
return toAxisTickMark(getMajorCTTickMark());
}
@Override
public void setMajorTickMark(AxisTickMark tickMark) {
getMajorCTTickMark().setVal(fromAxisTickMark(tickMark));
}
@Override
public AxisTickMark getMinorTickMark() {
return toAxisTickMark(getMinorCTTickMark());
}
@Override
public void setMinorTickMark(AxisTickMark tickMark) {
getMinorCTTickMark().setVal(fromAxisTickMark(tickMark));
}
@ -195,8 +219,8 @@ public abstract class XSSFChartAxis implements ChartAxis {
protected abstract CTBoolean getDelete();
protected abstract CTTickMark getMajorCTTickMark();
protected abstract CTTickMark getMinorCTTickMark();
public abstract CTChartLines getMajorGridLines();
public abstract CTShapeProperties getLine();
@Internal public abstract CTChartLines getMajorGridLines();
@Internal public abstract CTShapeProperties getLine();
private static STOrientation.Enum fromAxisOrientation(AxisOrientation 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.ChartAxis;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.usermodel.XSSFChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos;
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.CTCrosses;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTDateAx;
@ -63,18 +63,23 @@ public class XSSFDateAxis extends XSSFChartAxis {
this.ctDateAx = ctDateAx;
}
@Override
public long getId() {
return ctDateAx.getAxId().getVal();
}
@Override
@Internal
public CTShapeProperties getLine() {
return ctDateAx.getSpPr();
}
@Override
protected CTAxPos getCTAxPos() {
return ctDateAx.getAxPos();
}
@Override
protected CTNumFmt getCTNumFmt() {
if (ctDateAx.isSetNumFmt()) {
return ctDateAx.getNumFmt();
@ -82,10 +87,12 @@ public class XSSFDateAxis extends XSSFChartAxis {
return ctDateAx.addNewNumFmt();
}
@Override
protected CTScaling getCTScaling() {
return ctDateAx.getScaling();
}
@Override
protected CTCrosses getCTCrosses() {
return ctDateAx.getCrosses();
}
@ -105,10 +112,13 @@ public class XSSFDateAxis extends XSSFChartAxis {
return ctDateAx.getMinorTickMark();
}
@Override
@Internal
public CTChartLines getMajorGridLines() {
return ctDateAx.getMajorGridlines();
}
@Override
public void crossAxis(ChartAxis axis) {
ctDateAx.getCrossAx().setVal(axis.getId());
}
@ -133,6 +143,7 @@ public class XSSFDateAxis extends XSSFChartAxis {
setMinorTickMark(AxisTickMark.NONE);
}
@Override
public boolean hasNumberFormat() {
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.ValueAxis;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.xssf.usermodel.XSSFChart;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTBoolean;
@ -58,18 +59,23 @@ public class XSSFValueAxis extends XSSFChartAxis implements ValueAxis {
this.ctValAx = ctValAx;
}
@Override
public long getId() {
return ctValAx.getAxId().getVal();
}
@Override
@Internal
public CTShapeProperties getLine() {
return ctValAx.getSpPr();
}
@Override
public void setCrossBetween(AxisCrossBetween crossBetween) {
ctValAx.getCrossBetween().setVal(fromCrossBetween(crossBetween));
}
@Override
public AxisCrossBetween getCrossBetween() {
return toCrossBetween(ctValAx.getCrossBetween().getVal());
}
@ -112,10 +118,13 @@ public class XSSFValueAxis extends XSSFChartAxis implements ValueAxis {
return ctValAx.getMinorTickMark();
}
@Override
@Internal
public CTChartLines getMajorGridLines() {
return ctValAx.getMajorGridlines();
}
@Override
public void crossAxis(ChartAxis axis) {
ctValAx.getCrossAx().setVal(axis.getId());
}
@ -160,6 +169,7 @@ public class XSSFValueAxis extends XSSFChartAxis implements ValueAxis {
}
}
@Override
public boolean hasNumberFormat() {
return ctValAx.isSetNumFmt();
}