From: Yegor Kozlov Date: Thu, 3 Dec 2009 16:50:34 +0000 (+0000) Subject: added an annotation '@Internal' to mark program elements intended for POI internal... X-Git-Tag: REL_3_6~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=787da03838cbde811a9e73d3bcfe4c577df2f02e;p=poi.git added an annotation '@Internal' to mark program elements intended for POI internal use only, marked all public accessors to OOXML xmlbeans as @Internal git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@886846 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/util/Internal.java b/src/java/org/apache/poi/util/Internal.java new file mode 100644 index 0000000000..e510df14d4 --- /dev/null +++ b/src/java/org/apache/poi/util/Internal.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.poi.util; + +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Retention; +import java.lang.annotation.Documented; + + +/** + * Program elements annotated @Internal are intended for + * POI internal use only. Such elements are not public by design + * and likely to be removed in future versions of POI or access + * to such elements will be changed from 'public' to 'default' or less. + * + * @author Yegor Kozlov + * @since POI-3.6 + */ +@Documented +@Retention(RetentionPolicy.SOURCE) +public @interface Internal { + +} diff --git a/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java b/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java index 57b801d942..be8615cd9b 100644 --- a/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java +++ b/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java @@ -21,6 +21,7 @@ import java.util.LinkedList; import java.util.List; import org.apache.poi.POIXMLDocument; +import org.apache.poi.util.Internal; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.openxml4j.opc.OPCPackage; @@ -93,6 +94,7 @@ public class XSLFSlideShow extends POIXMLDocument { /** * Returns the low level presentation base object */ + @Internal public CTPresentation getPresentation() { return presentationDoc.getPresentation(); } @@ -103,6 +105,7 @@ public class XSLFSlideShow extends POIXMLDocument { * You'll need these to figure out the slide ordering, * and to get at the actual slides themselves */ + @Internal public CTSlideIdList getSlideReferences() { return getPresentation().getSldIdLst(); } @@ -112,6 +115,7 @@ public class XSLFSlideShow extends POIXMLDocument { * You'll need these to get at the actual slide * masters themselves */ + @Internal public CTSlideMasterIdList getSlideMasterReferences() { return getPresentation().getSldMasterIdLst(); } @@ -129,6 +133,7 @@ public class XSLFSlideShow extends POIXMLDocument { * Returns the low level slide master object from * the supplied slide master reference */ + @Internal public CTSlideMaster getSlideMaster(CTSlideMasterIdListEntry master) throws IOException, XmlException { PackagePart masterPart = getSlideMasterPart(master); SldMasterDocument masterDoc = @@ -149,6 +154,7 @@ public class XSLFSlideShow extends POIXMLDocument { * Returns the low level slide object from * the supplied slide reference */ + @Internal public CTSlide getSlide(CTSlideIdListEntry slide) throws IOException, XmlException { PackagePart slidePart = getSlidePart(slide); SldDocument slideDoc = @@ -188,6 +194,7 @@ public class XSLFSlideShow extends POIXMLDocument { * Returns the low level notes object for the given * slide, as found from the supplied slide reference */ + @Internal public CTNotesSlide getNotes(CTSlideIdListEntry slide) throws IOException, XmlException { PackagePart notesPart = getNodesPart(slide); if(notesPart == null) @@ -202,6 +209,7 @@ public class XSLFSlideShow extends POIXMLDocument { /** * Returns all the comments for the given slide */ + @Internal public CTCommentList getSlideComments(CTSlideIdListEntry slide) throws IOException, XmlException { PackageRelationshipCollection commentRels; PackagePart slidePart = getSlidePart(slide); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java index e4e96e6d51..90de6e8a0d 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java @@ -19,6 +19,7 @@ package org.apache.poi.xslf.usermodel; import org.apache.poi.sl.usermodel.Notes; import org.apache.poi.sl.usermodel.Slide; import org.apache.poi.sl.usermodel.SlideShow; +import org.apache.poi.util.Internal; import org.openxmlformats.schemas.presentationml.x2006.main.CTSlide; import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideIdListEntry; @@ -35,12 +36,14 @@ public class XSLFSlide extends XSLFSheet implements Slide { /** * While developing only! */ + @Internal public CTSlide _getCTSlide() { return slide; } /** * While developing only! */ + @Internal public CTSlideIdListEntry _getCTSlideId() { return slideId; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java index 2ad093e292..a3cc23a795 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java @@ -40,6 +40,7 @@ import org.apache.poi.ss.usermodel.RichTextString; import org.apache.poi.ss.util.CellReference; import org.apache.poi.xssf.model.SharedStringsTable; import org.apache.poi.xssf.model.StylesTable; +import org.apache.poi.util.Internal; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula; import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellFormulaType; @@ -851,6 +852,7 @@ public final class XSSFCell implements Cell { * * @return the xml bean containing information about this cell */ + @Internal public CTCell getCTCell(){ return _cell; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java index 4dea4de5e4..00dc1c4a5d 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java @@ -29,6 +29,7 @@ import org.apache.poi.xssf.usermodel.extensions.XSSFCellAlignment; import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder; import org.apache.poi.xssf.usermodel.extensions.XSSFCellFill; import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide; +import org.apache.poi.util.Internal; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellAlignment; @@ -74,6 +75,7 @@ public class XSSFCellStyle implements CellStyle { /** * Used so that StylesSource can figure out our location */ + @Internal public CTXf getCoreXf() { return _cellXf; } @@ -81,6 +83,7 @@ public class XSSFCellStyle implements CellStyle { /** * Used so that StylesSource can figure out our location */ + @Internal public CTXf getStyleXf() { return _cellStyleXf; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java index 5032395394..4dc3db8c48 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java @@ -20,6 +20,7 @@ package org.apache.poi.xssf.usermodel; import org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D; import org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D; import org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D; +import org.apache.poi.util.Internal; /** * @author Yegor Kozlov @@ -44,6 +45,7 @@ public final class XSSFChildAnchor extends XSSFAnchor { this.t2d = t2d; } + @Internal public CTTransform2D getCTTransform2D() { return t2d; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java index 28efca9def..76990c0173 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java @@ -18,6 +18,7 @@ package org.apache.poi.xssf.usermodel; import org.apache.poi.ss.usermodel.ClientAnchor; +import org.apache.poi.util.Internal; import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker; /** @@ -175,6 +176,7 @@ public final class XSSFClientAnchor extends XSSFAnchor implements ClientAnchor { * * @return starting anchor point */ + @Internal public CTMarker getFrom(){ return cell1; } @@ -188,6 +190,7 @@ public final class XSSFClientAnchor extends XSSFAnchor implements ClientAnchor { * * @return ending anchor point */ + @Internal public CTMarker getTo(){ return cell2; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFColor.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFColor.java index 4a2c63f03b..6c63195d40 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFColor.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFColor.java @@ -17,6 +17,7 @@ package org.apache.poi.xssf.usermodel; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor; +import org.apache.poi.util.Internal; /** * Represents a color in SpreadsheetML @@ -197,6 +198,7 @@ public class XSSFColor { * * @return the underlying XML bean */ + @Internal public CTColor getCTColor(){ return ctColor; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java index a5d2262c9c..7dab16c711 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java @@ -32,6 +32,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STSchemeColorVal; import org.openxmlformats.schemas.drawingml.x2006.main.STShapeType; import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTConnector; import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTConnectorNonVisual; +import org.apache.poi.util.Internal; /** * A connection shape drawing element. A connection shape is a line, etc. @@ -104,6 +105,7 @@ public final class XSSFConnector extends XSSFShape { return prototype; } + @Internal public CTConnector getCTConnector(){ return ctShape; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java index a2a651f97d..ae5410cc69 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java @@ -25,6 +25,7 @@ import java.util.Map; import javax.xml.namespace.QName; import org.apache.poi.POIXMLDocumentPart; +import org.apache.poi.util.Internal; import org.apache.poi.xssf.model.CommentsTable; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackagePartName; @@ -93,6 +94,7 @@ public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing { * * @return the underlying CTDrawing bean */ + @Internal public CTDrawing getCTDrawing(){ return drawing; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java index 8281ac3b11..7fbbee7951 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java @@ -17,6 +17,7 @@ package org.apache.poi.xssf.usermodel; import org.apache.poi.POIXMLException; +import org.apache.poi.util.Internal; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.FontCharset; import org.apache.poi.ss.usermodel.FontFamily; @@ -88,6 +89,7 @@ public class XSSFFont implements Font { /** * get the underlying CTFont font */ + @Internal public CTFont getCTFont() { return _ctFont; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java index 33c742f6e7..6d40b686ad 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFMap.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Vector; import org.apache.poi.POIXMLDocumentPart; +import org.apache.poi.util.Internal; import org.apache.poi.xssf.model.MapInfo; import org.apache.poi.xssf.model.SingleXmlCells; import org.apache.poi.xssf.model.Table; @@ -53,11 +54,13 @@ public class XSSFMap { } + @Internal public CTMap getCtMap() { return ctMap; } + @Internal public CTSchema getCTSchema() { String schemaId = ctMap.getSchemaID(); return mapInfo.getCTSchemaById(schemaId); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java index 0a0fdf086b..12f6b064de 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java @@ -34,6 +34,7 @@ import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.util.ImageUtils; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; +import org.apache.poi.util.Internal; import org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties; import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps; import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualPictureProperties; @@ -141,6 +142,7 @@ public final class XSSFPicture extends XSSFShape implements Picture { * * @return the underlying CTPicture bean */ + @Internal public CTPicture getCTPicture(){ return ctPicture; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java index 8775a9c11e..90b04a1d3a 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java @@ -24,6 +24,7 @@ import javax.xml.namespace.QName; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.RichTextString; import org.apache.poi.xssf.model.StylesTable; +import org.apache.poi.util.Internal; import org.apache.xmlbeans.XmlCursor; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont; @@ -416,6 +417,7 @@ public class XSSFRichTextString implements RichTextString { /** * Return the underlying xml bean */ + @Internal public CTRst getCTRst() { return st; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java index 91bb3e4c8d..9e564023e9 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java @@ -27,6 +27,7 @@ import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.util.CellReference; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; +import org.apache.poi.util.Internal; import org.apache.poi.xssf.model.CalculationChain; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRow; @@ -368,6 +369,7 @@ public class XSSFRow implements Row, Comparable { * * @return the underlying CTRow xml bean */ + @Internal public CTRow getCTRow(){ return _row; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFShapeGroup.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFShapeGroup.java index ce691561e5..b625134a7c 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFShapeGroup.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFShapeGroup.java @@ -18,6 +18,7 @@ package org.apache.poi.xssf.usermodel; import org.apache.poi.openxml4j.opc.PackageRelationship; +import org.apache.poi.util.Internal; import org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapeProperties; import org.openxmlformats.schemas.drawingml.x2006.main.CTGroupTransform2D; import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps; @@ -163,6 +164,7 @@ public final class XSSFShapeGroup extends XSSFShape { return shape; } + @Internal public CTGroupShape getCTGroupShape() { return ctGroup; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 318f2f6ddb..a9b0c145bf 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -49,6 +49,7 @@ import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellReference; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; +import org.apache.poi.util.Internal; import org.apache.poi.xssf.model.CommentsTable; import org.apache.poi.xssf.usermodel.helpers.ColumnHelper; import org.apache.poi.xssf.usermodel.helpers.XSSFRowShifter; @@ -218,6 +219,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * * @return the CTWorksheet bean holding this sheet's data */ + @Internal public CTWorksheet getCTWorksheet() { return this.worksheet; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java index 7fc27de89d..7900d8452e 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java @@ -42,6 +42,7 @@ import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape; import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShapeNonVisual; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRElt; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRPrElt; +import org.apache.poi.util.Internal; /** * Represents a shape with a predefined geometry in a SpreadsheetML drawing. @@ -126,6 +127,7 @@ public class XSSFSimpleShape extends XSSFShape { // TODO - instantiable supercla return prototype; } + @Internal public CTShape getCTShape(){ return ctShape; } diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index 9af7515af9..fc7fec6285 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -51,10 +51,7 @@ import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; import org.apache.poi.ss.util.CellReference; -import org.apache.poi.util.IOUtils; -import org.apache.poi.util.POILogFactory; -import org.apache.poi.util.POILogger; -import org.apache.poi.util.PackageHelper; +import org.apache.poi.util.*; import org.apache.poi.xssf.model.CalculationChain; import org.apache.poi.xssf.model.MapInfo; import org.apache.poi.xssf.model.SharedStringsTable; @@ -290,6 +287,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, IterableCalculationChain object or null if not defined */ + @Internal public CalculationChain getCalculationChain(){ return calcChain; } @@ -1367,6 +1367,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Iterable