git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888780 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2021-04-14 22:53:33 +00:00
parent 7c67bba960
commit bb5d321b79
730 changed files with 1931 additions and 3375 deletions

View File

@ -45,8 +45,6 @@ import org.apache.poi.sl.usermodel.VerticalAlignment;
/**
* Presentation for Fast Feather Track on ApacheconEU 2008
*
* @author Yegor Kozlov
*/
@SuppressWarnings("java:S1192")
public final class ApacheconEU08 {

View File

@ -50,7 +50,6 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
/**
* A XLS -> CSV processor, that uses the MissingRecordAware
* EventModel code to ensure it outputs all columns and rows.
* @author Nick Burch
*/
@SuppressWarnings({"java:S106","java:S4823"})
public class XLS2CSVmra implements HSSFListener {

View File

@ -31,8 +31,6 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
/**
* Shows how various alignment options work.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class Alignment {
public static void main(String[] args) throws IOException {

View File

@ -27,8 +27,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
/**
* Illustrates how to create cell values.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class CreateCells {
public static void main(String[] args) throws IOException {

View File

@ -46,8 +46,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
* are not strictly necessary. If the inputs to the listInCell() and
* multilLevelListInCell() methods are constructed to include the bullet
* character or the item numbers then these methods alone may be sufficient.
*
* @author Mark Beardsley [msb at apache.org]
*/
@SuppressWarnings({"java:S106","java:S4823"})
public class InCellLists {

View File

@ -35,8 +35,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
/**
* Demonstrates the use of the EscherGraphics2d library.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class OfficeDrawingWithGraphics {
public static void main( String[] args ) throws IOException {

View File

@ -30,8 +30,6 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
/**
* This example demonstrates opening a workbook, modifying it and writing
* the results back out.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class ReadWriteWorkbook {
public static void main(String[] args) throws IOException {

View File

@ -27,8 +27,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
/**
* Sets the zoom magnication for a sheet.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class ZoomSheet
{

View File

@ -180,7 +180,6 @@ import org.apache.poi.util.IOUtils;
* grow in size of the column is made wider or the row higher but it will shrink
* if the columns width or rows height are reduced.
*
* @author Mark Beardsley [msb at apache.org] and Mark Southern [southern at scripps.edu]
* @version 1.00 5th August 2009.
* 2.00 26th February 2010.
* Ported to make use of the the SS usermodel classes.
@ -859,7 +858,6 @@ public class AddDimensionedImage {
* either how far the image should be inset from the top or the left hand
* edge of the cell.
*
* @author Mark Beardsley [msb at apache.org]
* @version 1.00 5th August 2009.
*/
public class ClientAnchorDetail {
@ -928,7 +926,6 @@ public class AddDimensionedImage {
* size measurements into pixels and/or millimetres. The class also contains
* various constants that are required in other calculations.
*
* @author xio[darjino@hotmail.com]
* @version 1.01 30th July 2009.
* Added by Mark Beardsley [msb at apache.org].
* Additional constants.

View File

@ -44,8 +44,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
* A business plan demo
* Usage:
* BusinessPlan -xls|xlsx
*
* @author Yegor Kozlov
*/
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
public final class BusinessPlan {

View File

@ -45,8 +45,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
* Usage:
* CalendarDemo -xls|xlsx <year>
* </pre>
*
* @author Yegor Kozlov
*/
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
public final class CalendarDemo {

View File

@ -60,7 +60,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
* better to include the name of the sheet when calling the setRefersToFormula()
* method.
*
* @author Mark Beardsley [msb at apache.org]
* @version 1.00 30th March 2012
*/
public class LinkedDropDownLists {

View File

@ -42,8 +42,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
*
* Usage:
* LoanCalculator -xls|xlsx
*
* @author Yegor Kozlov
*/
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
public final class LoanCalculator {

View File

@ -41,8 +41,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
* A weekly timesheet created using Apache POI.
* Usage:
* TimesheetDemo -xls|xlsx
*
* @author Yegor Kozlov
*/
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
public final class TimesheetDemo {

View File

@ -118,7 +118,7 @@ import org.apache.poi.ss.usermodel.WorkbookFactory;
* class has to be modified to produce files to suit a specific application
* or requirement.
* </p>
* @author Mark B
*
* @version 1.00 9th April 2010
* 1.10 13th April 2010 - Added support for processing all Excel
* workbooks in a folder along with the ability

View File

@ -26,10 +26,6 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction;
/**
* A simple user-defined function to calculate principal and interest.
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public class CalculateMortgage implements FreeRefFunction {
@ -81,7 +77,7 @@ public class CalculateMortgage implements FreeRefFunction {
/**
* Excel does not support infinities and NaNs, rather, it gives a #NUM! error in these cases
*
* @throws EvaluationException (#NUM!) if <tt>result</tt> is <tt>NaN</> or <tt>Infinity</tt>
* @throws EvaluationException (#NUM!) if {@code result} is {@code NaN} or {@code Infinity}
*/
private void checkValue(double result) throws EvaluationException {
if (Double.isNaN(result) || Double.isInfinite(result)) {

View File

@ -26,8 +26,6 @@ import org.apache.poi.ss.usermodel.CellStyle;
* formats. If you are writing such code, you can add a method to this
* interface, and then implement it for both HSSF and XSSF workbooks, letting
* the driving code stay independent of format.
*
* @author Ken Arnold, Industrious Media LLC
*/
public interface HtmlHelper {
/**

View File

@ -125,7 +125,7 @@ public final class ToHtml {
/**
* Creates a new examples to HTML for the given workbook. If the path ends
* with "<tt>.xlsx</tt>" an {@link XSSFWorkbook} will be used; otherwise
* with "{@code .xlsx}" an {@link XSSFWorkbook} will be used; otherwise
* this will use an {@link HSSFWorkbook}.
*
* @param path The file that has the workbook.

View File

@ -24,8 +24,6 @@ import org.apache.poi.xssf.usermodel.XSSFColor;
/**
* Implementation of {@link HtmlHelper} for XSSF files.
*
* @author Ken Arnold, Industrious Media LLC
*/
public class XSSFHtmlHelper implements HtmlHelper {
@Override

View File

@ -49,22 +49,19 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
* Demonstrates a workaround you can use to generate large workbooks and avoid OutOfMemory exception.
*
* <p>
* Note - You probably <em>don't want to use this approach any more</em>! POI
* now includes the SXSSF which handles all of this for you, you should
* be using that instead! This code remains mostly for historical interest.
* <p>
* See <a "https://poi.apache.org/spreadsheet/how-to.html#sxssf">
* https://poi.apache.org/spreadsheet/how-to.html#sxssf</a>.
* <p>
* If you really want to use this approach, which is also the one that SXSSF
* does for you, it works as follows:
* <ol>
* <li>create a template workbook, create sheets and global objects such as cell styles, number formats, etc.</li>
* <li>create an application that streams data in a text file</li>
* <li>Substitute the sheet in the template with the generated data</li>
* </ol>
*
* 1. create a template workbook, create sheets and global objects such as cell styles, number formats, etc.
* 2. create an application that streams data in a text file
* 3. Substitute the sheet in the template with the generated data
*
* <p>
* Since 3.8 POI provides a low-memory footprint SXSSF API, which implements
* ths "BigGridDemo" strategy. SXSSF is an API-compatible streaming extension
* of XSSF to be used when very large spreadsheets have to be produced, and
@ -72,9 +69,8 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
* access to the rows that are within a sliding window, while XSSF gives access
* to all rows in the document. Older rows that are no longer in the window
* become inaccessible, as they are written to the disk.
* </p>
* See <a "https://poi.apache.org/spreadsheet/how-to.html#sxssf">
* https://poi.apache.org/spreadsheet/how-to.html#sxssf</a>.
*
* @see <a href="https://poi.apache.org/spreadsheet/how-to.html#sxssf">SXSSF (Streaming Usermodel API)</a>.
*/
public final class BigGridDemo {
private static final String XML_ENCODING = "UTF-8";

View File

@ -47,8 +47,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
* Usage:
* CalendarDemo &lt;year&gt;
* </pre>
*
* @author Yegor Kozlov
*/
public class CalendarDemo {

View File

@ -39,8 +39,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
* Excel comment is a kind of a text shape,
* so inserting a comment is very similar to placing a text box in a worksheet
* </p>
*
* @author Yegor Kozlov
*/
public class CellComments {
public static void main(String[] args) throws IOException {

View File

@ -28,11 +28,6 @@ import org.apache.poi.xwpf.usermodel.XWPFRun;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
/**
*
* @author Richard Ngo
*
*/
public class SimpleDocumentWithHeader {
public static void main(String[] args) throws IOException {

View File

@ -45,9 +45,6 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc;
* that not all referenced wordprocessingml classes are defined in the
* poi-ooxml-lite jar. If this is the case, you'll need to use the
* poi-ooxml-full jar library.
*
* @author gisella bronzetti (original)
* @author Gregg Morris (styled table)
*/
public class SimpleTable {

View File

@ -23,7 +23,6 @@ import java.io.OutputStream;
import java.io.IOException;
/**
* @author aviks
* Wrap a java.io.OutputStream around a Ruby IO object
*/

View File

@ -29,11 +29,6 @@ import org.apache.tools.ant.Task;
* by a WorkbookUtil instance. The evaluate() method of the WorkbookUtil
* class returns an EvaluationResult which encapsulates the results and
* information from the evaluation.
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public class ExcelAntEvaluateCell extends Task {

View File

@ -39,10 +39,6 @@ import org.apache.tools.ant.Task;
* <code>IExcelAntWorkbookHandler</code> interface. After writing the
* class you should package it and it's dependencies into a jar file to
* add as library in your Ant build file.
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public class ExcelAntHandlerTask extends Task {

View File

@ -19,20 +19,14 @@ package org.apache.poi.ss.excelant;
import org.apache.tools.ant.taskdefs.Typedef;
/**
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public class ExcelAntPrecision extends Typedef {
private double value ;
public void setValue( double precision ) {
value = precision ;
}
public double getValue() {
return value ;
}

View File

@ -20,27 +20,21 @@ package org.apache.poi.ss.excelant;
import org.apache.poi.ss.excelant.util.ExcelAntWorkbookUtil;
import org.apache.tools.ant.Task;
/**
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public abstract class ExcelAntSet extends Task {
protected String cellStr ;
protected ExcelAntWorkbookUtil wbUtil ;
public void setCell( String cellName ) {
cellStr = cellName ;
}
public String getCell() {
return cellStr ;
}
public void setWorkbookUtil( ExcelAntWorkbookUtil wb ) {
wbUtil = wb ;
}

View File

@ -23,16 +23,12 @@ import org.apache.tools.ant.Project;
/**
* Class for use in an Ant build script that sets the value of an Excel
* sheet cell using the cell id ('Sheet Name'!cellId).
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public class ExcelAntSetDoubleCell extends ExcelAntSet {
private double cellValue;
public ExcelAntSetDoubleCell() {}
/**
* Set the value of the specified cell as the double passed in.
* @param value The double-value that should be set when this task is executed.
@ -49,11 +45,11 @@ public class ExcelAntSetDoubleCell extends ExcelAntSet {
public double getCellValue() {
return cellValue;
}
@Override
public void execute() throws BuildException {
wbUtil.setDoubleValue(cellStr, cellValue ) ;
log( "set cell " + cellStr + " to value " + cellValue + " as double.", Project.MSG_DEBUG ) ;
}
}

View File

@ -23,18 +23,14 @@ import org.apache.tools.ant.Project;
/**
* Class for use in an Ant build script that sets the formula of an Excel
* sheet cell using the cell id ('Sheet Name'!cellId).
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public class ExcelAntSetFormulaCell extends ExcelAntSet {
private String cellValue ;
public ExcelAntSetFormulaCell() {}
public void setValue( String value ) {
cellValue = value ;
}
@ -42,12 +38,12 @@ public class ExcelAntSetFormulaCell extends ExcelAntSet {
protected String getCellValue() {
return cellValue;
}
@Override
public void execute() throws BuildException {
wbUtil.setFormulaValue( cellStr, cellValue ) ;
log( "set cell " + cellStr + " to formula " + cellValue, Project.MSG_DEBUG ) ;
}
}

View File

@ -23,10 +23,6 @@ import org.apache.tools.ant.Project;
/**
* Class for use in an Ant build script that sets the value of an Excel
* sheet cell using the cell id ('Sheet Name'!cellId).
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public class ExcelAntSetStringCell extends ExcelAntSet {
private String stringValue ;
@ -49,11 +45,11 @@ public class ExcelAntSetStringCell extends ExcelAntSet {
public String getCellValue() {
return stringValue;
}
@Override
public void execute() throws BuildException {
wbUtil.setStringValue(cellStr, stringValue ) ;
log( "set cell " + cellStr + " to value " + stringValue + " as String.", Project.MSG_DEBUG ) ;
}
}

View File

@ -31,10 +31,6 @@ import org.apache.tools.ant.Task;
* This class represents a single test. In order for the test any and all
* ExcelAntEvaluateCell evaluations must pass. Therefore it is recommended
* that you use only 1 evaluator but you can use more if you choose.
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
@SuppressWarnings("unused")
public class ExcelAntTest extends Task{

View File

@ -22,10 +22,6 @@ import org.apache.tools.ant.taskdefs.Typedef;
/**
* This class encapsulates the Strings necessary to create the User Defined
* Function instances that will be passed to POI's Evaluator instance.
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public class ExcelAntUserDefinedFunction extends Typedef {

View File

@ -21,7 +21,7 @@ import org.apache.poi.ss.usermodel.Workbook;
/**
* In Excel there are many ways to handle manipulating a workbook based
* In Excel there are many ways to handle manipulating a workbook based
* on some arbitrary user action (onChange, etc). You use this interface
* to create classes that will handle the workbook in whatever manner is needed
* that cannot be handled by POI.
@ -30,13 +30,9 @@ import org.apache.poi.ss.usermodel.Workbook;
* does some calculations and updates other cells based on that change. In
* ExcelAnt you would set the value of the cell then write your own handler
* then call that from your Ant task after the set task.
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public interface IExcelAntWorkbookHandler {
public void setWorkbook( Workbook workbook ) ;
public void execute() ;
}

View File

@ -20,52 +20,48 @@ package org.apache.poi.ss.excelant.util;
/**
* A simple class that encapsulates information about a cell evaluation
* from POI.
*
* @author Jon Svede (jon [at] loquatic [dot] com)
* @author Brian Bush (brian [dot] bush [at] nrel [dot] gov)
*
*/
public class ExcelAntEvaluationResult {
/**
* This boolean flag is used to determine if the evaluation completed
* without error. This alone doesn't ensure that the evaluation was
* without error. This alone doesn't ensure that the evaluation was
* successful.
*/
private boolean evaluationCompletedWithError ;
/**
* This boolean flag is used to determine if the result was within
* the specified precision.
*/
private boolean didPass ;
/**
* This is the actual value returned from the evaluation.
*/
private double returnValue ;
/**
* Any error message String values that need to be returned.
*/
private String errorMessage ;
/**
* Stores the absolute value of the delta for this evaluation.
*/
private double actualDelta ;
/**
* This stores the fully qualified cell name (sheetName!cellId).
*/
private String cellName ;
public ExcelAntEvaluationResult(boolean completedWithError,
boolean passed,
double retValue,
String errMessage,
boolean passed,
double retValue,
String errMessage,
double delta,
String cellId) {
@ -84,19 +80,19 @@ public class ExcelAntEvaluationResult {
public String getErrorMessage() {
return errorMessage;
}
public boolean didTestPass() {
return didPass ;
}
public boolean evaluationCompleteWithError() {
return evaluationCompletedWithError ;
}
public double getDelta() {
return actualDelta ;
}
public String getCellName() {
return cellName ;
}
@ -108,5 +104,5 @@ public class ExcelAntEvaluationResult {
+ ", returnValue=" + returnValue + ", errorMessage="
+ errorMessage + ", actualDelta=" + actualDelta + ", cellName="
+ cellName + "]";
}
}
}

View File

@ -49,10 +49,6 @@ import org.apache.tools.ant.taskdefs.Typedef;
/**
* A general utility class that abstracts the POI details of loading the
* workbook, accessing and updating cells.
*
* @author Jon Svede (jon [at] loquatic [dot] com)
* @author Brian Bush (brian [dot] bush [at] nrel [dot] gov)
*
*/
public class ExcelAntWorkbookUtil extends Typedef {

View File

@ -24,10 +24,6 @@ import java.util.Map;
/**
* This is a factory class maps file names to WorkbookUtil instances. This
* helps ExcelAnt be more efficient when being run many times in an Ant build.
*
* @author Jon Svede (jon [at] loquatic [dot] com)
* @author Brian Bush (brian [dot] bush [at] nrel [dot] gov)
*
*/
public final class ExcelAntWorkbookUtilFactory {

View File

@ -26,12 +26,6 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction;
/**
* A simple user-defined function to calculate principal and interest.
*
* Used by {@link org.apache.poi.ss.excelant.util.TestExcelAntWorkbookUtil}.
*
* @author Jon Svede ( jon [at] loquatic [dot] com )
* @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov )
*
*/
public class CalculateMortgageFunction implements FreeRefFunction {
@ -83,7 +77,7 @@ public class CalculateMortgageFunction implements FreeRefFunction {
/**
* Excel does not support infinities and NaNs, rather, it gives a #NUM! error in these cases
*
* @throws EvaluationException (#NUM!) if <tt>result</tt> is <tt>NaN</> or <tt>Infinity</tt>
* @throws EvaluationException (#NUM!) if {@code result} is {@code NaN} or {@code Infinity}
*/
private void checkValue(double result) throws EvaluationException {
if (Double.isNaN(result) || Double.isInfinite(result)) {

View File

@ -22,9 +22,6 @@ import org.apache.poi.ss.usermodel.Workbook;
/**
* A helper class to allow testing of protected methods and constructors.
*
* @author jsvede
*
*/
public class ExcelAntWorkbookUtilTestHelper extends ExcelAntWorkbookUtil {
@ -46,5 +43,5 @@ public class ExcelAntWorkbookUtilTestHelper extends ExcelAntWorkbookUtil {
return super.getEvaluator(excelFileName);
}
}

View File

@ -139,6 +139,22 @@ tasks.withType(Jar) {
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
}
javadoc {
failOnError = true
maxMemory = "1024M"
doFirst {
options {
if (JavaVersion.current().isJava9Compatible()) {
addBooleanOption('html5', true)
}
links 'https://xmlbeans.apache.org/docs/5.0.0/'
use = true
splitIndex = true
source = "1.8"
}
}
}
task sourceJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allJava

View File

@ -18,13 +18,10 @@ package org.apache.poi.ooxml;
/**
* Indicates a generic OOXML error.
*
* @author Yegor Kozlov
*/
@SuppressWarnings("serial")
public final class POIXMLException extends RuntimeException{
/**
* Create a new <code>POIXMLException</code> with no
* Create a new {@code POIXMLException} with no
* detail mesage.
*/
public POIXMLException() {
@ -32,8 +29,8 @@ public final class POIXMLException extends RuntimeException{
}
/**
* Create a new <code>POIXMLException</code> with
* the <code>String</code> specified as an error message.
* Create a new {@code POIXMLException} with
* the {@code String} specified as an error message.
*
* @param msg The error message for the exception.
*/
@ -42,12 +39,12 @@ public final class POIXMLException extends RuntimeException{
}
/**
* Create a new <code>POIXMLException</code> with
* the <code>String</code> specified as an error message and the cause.
* Create a new {@code POIXMLException} with
* the {@code String} specified as an error message and the cause.
*
* @param msg The error message for the exception.
* @param cause the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A <tt>null</tt> value is
* {@link #getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or
* unknown.)
*/
@ -56,11 +53,11 @@ public final class POIXMLException extends RuntimeException{
}
/**
* Create a new <code>POIXMLException</code> with
* Create a new {@code POIXMLException} with
* the specified cause.
*
* @param cause the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A <tt>null</tt> value is
* {@link #getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or
* unknown.)
*/

View File

@ -87,11 +87,11 @@ public class POIXMLUnits {
}
/**
* This type seems to be interpreted as percent value when the trailing percent sign is missing.<br/>
* This type seems to be interpreted as percent value when the trailing percent sign is missing.<p>
* sample snippet from settings.xml
* <pre>
* &lt;w:zoom w:percent="50" /&gt;
* <pre>
* <pre>{@code
* <w:zoom w:percent="50" />
* }</pre>
*
* @return the percent scaled by 1000, so 100% = 100000
*/
@ -100,11 +100,11 @@ public class POIXMLUnits {
}
/**
* This type seems to be interpreted as percent value when the trailing percent sign is missing.<br/>
* This type seems to be interpreted as percent value when the trailing percent sign is missing.<p>
* sample snippet from settings.xml
* <pre>
* &lt;w:textscale w:w="50" /&gt;
* <pre>
* <pre>{@code
* <w:textscale w:w="50" />
* }</pre>
*
* @return the percent scaled by 1000, so 100% = 100000
*/
@ -235,7 +235,7 @@ public class POIXMLUnits {
private static long parseLengthInner(org.apache.xmlbeans.XmlAnySimpleType coordUnion, double noUnitEmuFactor) {
String strVal = coordUnion.getStringValue().toLowerCase(Locale.ROOT);
double digVal = Double.parseDouble(strVal.replaceAll("(mm|cm|in|pt|pc|pi)", ""));
long emu = 0;
long emu;
// http://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/
if (strVal.endsWith("mm")) {
emu = (long)(((digVal/10f)/2.54f)*EMU_PER_INCH);

View File

@ -22,7 +22,6 @@ package org.apache.poi.openxml4j.exceptions;
* set as Runtime in order not to force the user to manage the exception in a
* try/catch).
*
* @author Julien Chable
* @version 1.0
*/
@SuppressWarnings("serial")

View File

@ -19,8 +19,6 @@ package org.apache.poi.openxml4j.opc;
/**
* Specifies the location where the X.509 certificate that is used in signing is stored.
*
* @author Julien Chable
*/
public enum CertificateEmbeddingOption {
/** The certificate is embedded in its own PackagePart. */

View File

@ -22,8 +22,6 @@ import java.util.Locale;
/**
* Open Packaging Convention content types (see Annex F : Standard Namespaces
* and Content Types).
*
* @author CDubettier define some constants, Julien Chable
*/
public final class ContentTypes {

View File

@ -602,7 +602,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
*
* @param partName
* Part name of the part to retrieve.
* @return The part with the specified name, else <code>null</code>.
* @return The part with the specified name, else {@code null}.
*/
public PackagePart getPart(PackagePartName partName) {
throwExceptionIfWriteOnly();
@ -958,7 +958,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* part, then delete all relationships in the source part.
*
* @param part
* The part to remove. If <code>null</code>, skip the action.
* The part to remove. If {@code null}, skip the action.
* @see #removePart(PackagePartName)
*/
public void removePart(PackagePart part) {
@ -1217,8 +1217,6 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* @param relationshipType
* Type of relationship.
* @return The newly created and added relationship
* @see RelationshipSource#addExternalRelationship(String,
* String)
*/
@Override
public PackageRelationship addExternalRelationship(String target,
@ -1347,25 +1345,16 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
}
}
/**
* @see RelationshipSource#getRelationship(String)
*/
@Override
public PackageRelationship getRelationship(String id) {
return this.relationships.getRelationshipByID(id);
}
/**
* @see RelationshipSource#hasRelationships()
*/
@Override
public boolean hasRelationships() {
return (relationships.size() > 0);
}
/**
* @see RelationshipSource#isRelationshipExists(PackageRelationship)
*/
@Override
public boolean isRelationshipExists(PackageRelationship rel) {
for (PackageRelationship r : relationships) {
@ -1559,32 +1548,29 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
throws InvalidFormatException;
/**
* Replace a content type in this package.
*
* <p>
* A typical scneario to call this method is to rename a template file to the main format, e.g.
* ".dotx" to ".docx"
* ".dotm" to ".docm"
* ".xltx" to ".xlsx"
* ".xltm" to ".xlsm"
* ".potx" to ".pptx"
* ".potm" to ".pptm"
* </p>
* Replace a content type in this package.<p>
* A typical scneario to call this method is to rename a template file to the main format, e.g.
* <ul>
* <li>".dotx" to ".docx"</li>
* <li>".dotm" to ".docm"</li>
* <li>".xltx" to ".xlsx"</li>
* <li>".xltm" to ".xlsm"</li>
* <li>".potx" to ".pptx"</li>
* <li>".potm" to ".pptm"</li>
* </ul>
* For example, a code converting a .xlsm macro workbook to .xlsx would look as follows:
* <p>
* <pre><code>
* <pre>{@code
*
* OPCPackage pkg = OPCPackage.open(new FileInputStream("macro-workbook.xlsm"));
* pkg.replaceContentType(
* "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
* "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml");
* OPCPackage pkg = OPCPackage.open(new FileInputStream("macro-workbook.xlsm"));
* pkg.replaceContentType(
* "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
* "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml");
*
* FileOutputStream out = new FileOutputStream("workbook.xlsx");
* pkg.save(out);
* out.close();
* FileOutputStream out = new FileOutputStream("workbook.xlsx");
* pkg.save(out);
* out.close();
*
* </code></pre>
* </p>
* }</pre>
*
* @param oldContentType the content type to be replaced
* @param newContentType the replacement

View File

@ -19,8 +19,6 @@ package org.apache.poi.openxml4j.opc;
/**
* Specifies package access.
*
* @author Julien Chable
* @version 1.0
*/
public enum PackageAccess {

View File

@ -20,7 +20,6 @@ package org.apache.poi.openxml4j.opc;
/**
* Open Packaging Convention namespaces URI.
*
* @author Julien Chable
* @version 1.0
*/
public interface PackageNamespaces {

View File

@ -151,9 +151,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
* @param relationshipType
* Type of relationship.
* @return The newly created and added relationship
* @see org.apache.poi.openxml4j.opc.RelationshipSource#addExternalRelationship(java.lang.String,
* java.lang.String)
*/
@Override
public PackageRelationship addExternalRelationship(String target,
String relationshipType) {
return addExternalRelationship(target, relationshipType, null);
@ -176,6 +175,7 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
* @see org.apache.poi.openxml4j.opc.RelationshipSource#addExternalRelationship(java.lang.String,
* java.lang.String)
*/
@Override
public PackageRelationship addExternalRelationship(String target,
String relationshipType, String id) {
if (target == null) {
@ -211,9 +211,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
* @param relationshipType
* Type of relationship.
* @return The newly created and added relationship
* @see org.apache.poi.openxml4j.opc.RelationshipSource#addRelationship(org.apache.poi.openxml4j.opc.PackagePartName,
* org.apache.poi.openxml4j.opc.TargetMode, java.lang.String)
*/
@Override
public PackageRelationship addRelationship(PackagePartName targetPartName,
TargetMode targetMode, String relationshipType) {
return addRelationship(targetPartName, targetMode, relationshipType,
@ -244,9 +243,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
* invalid nested relations are created.
* @throws IllegalArgumentException if targetPartName, targetMode
* or relationshipType are passed as null
* @see org.apache.poi.openxml4j.opc.RelationshipSource#addRelationship(org.apache.poi.openxml4j.opc.PackagePartName,
* org.apache.poi.openxml4j.opc.TargetMode, java.lang.String, java.lang.String)
*/
@Override
public PackageRelationship addRelationship(PackagePartName targetPartName,
TargetMode targetMode, String relationshipType, String id) {
_container.throwExceptionIfReadOnly();
@ -347,9 +345,7 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
targetMode, relationshipType, id);
}
/**
* @see org.apache.poi.openxml4j.opc.RelationshipSource#clearRelationships()
*/
@Override
public void clearRelationships() {
if (_relationships != null) {
_relationships.clear();
@ -361,8 +357,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
*
* @param id
* The ID identified the part to delete.
* @see org.apache.poi.openxml4j.opc.RelationshipSource#removeRelationship(java.lang.String)
*/
@Override
public void removeRelationship(String id) {
this._container.throwExceptionIfReadOnly();
if (this._relationships != null)
@ -375,8 +371,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
* @return This part's relationships.
* @throws InvalidOperationException
* Throws if the package is open en write only mode.
* @see org.apache.poi.openxml4j.opc.RelationshipSource#getRelationships()
*/
@Override
public PackageRelationshipCollection getRelationships()
throws InvalidFormatException {
return getRelationshipsCore(null);
@ -388,8 +384,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
* @param id
* ID of the package relationship to retrieve.
* @return The package relationship
* @see org.apache.poi.openxml4j.opc.RelationshipSource#getRelationship(java.lang.String)
*/
@Override
public PackageRelationship getRelationship(String id) {
return this._relationships.getRelationshipByID(id);
}
@ -405,8 +401,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
* If an error occurs while parsing the part.
* @throws InvalidOperationException
* If the package is open in write only mode.
* @see org.apache.poi.openxml4j.opc.RelationshipSource#getRelationshipsByType(java.lang.String)
*/
@Override
public PackageRelationshipCollection getRelationshipsByType(
String relationshipType) throws InvalidFormatException {
_container.throwExceptionIfWriteOnly();
@ -443,8 +439,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
*
* @return <b>true</b> if the part have at least one relationship else
* <b>false</b>.
* @see org.apache.poi.openxml4j.opc.RelationshipSource#hasRelationships()
*/
@Override
public boolean hasRelationships() {
return (!this._isRelationshipPart && (_relationships != null && _relationships
.size() > 0));
@ -457,8 +453,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
* The relationship to check.
* @return <b>true</b> if the specified relationship exists in this part,
* else returns <b>false</b>
* @see org.apache.poi.openxml4j.opc.RelationshipSource#isRelationshipExists(org.apache.poi.openxml4j.opc.PackageRelationship)
*/
@Override
public boolean isRelationshipExists(PackageRelationship rel) {
return rel != null && _relationships.getRelationshipByID(rel.getId()) != null;
}
@ -500,7 +496,7 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack
* Get the input stream of this part to read its content.
*
* @return The input stream of the content of this part, else
* <code>null</code>.
* {@code null}.
*
* @throws IOException If creating the input-stream fails.
*/

View File

@ -22,8 +22,7 @@ import java.util.Optional;
/**
* Represents the core properties of an OPC package.
*
* @author Julien Chable
*
* @version 1.0
* @see org.apache.poi.openxml4j.opc.OPCPackage
*/

View File

@ -23,8 +23,6 @@ import java.util.Objects;
/**
* A part relationship.
*
* @author Julien Chable
* @version 1.0
*/
public final class PackageRelationship {

View File

@ -33,9 +33,6 @@ import org.w3c.dom.NodeList;
/**
* Represents a collection of PackageRelationship elements that are owned by a
* given PackagePart or the Package.
*
* @author Julien Chable, CDubettier
* @version 0.1
*/
public final class PackageRelationshipCollection implements Iterable<PackageRelationship> {

View File

@ -31,7 +31,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
/**
* Helper for part and pack URI.
*
* @author Julien Chable, CDubet, Kim Ung
* @version 0.1
*/
public final class PackagingURIHelper {

View File

@ -34,7 +34,7 @@ public interface RelationshipSource {
* Type of relationship.
* @return The newly created and added relationship
*/
public abstract PackageRelationship addRelationship(
PackageRelationship addRelationship(
PackagePartName targetPartName, TargetMode targetMode,
String relationshipType);
@ -56,11 +56,8 @@ public interface RelationshipSource {
* @param id
* Relationship unique id.
* @return The newly created and added relationship
*
* @throws InvalidFormatException
* If the URI point to a relationship part URI.
*/
public abstract PackageRelationship addRelationship(
PackageRelationship addRelationship(
PackagePartName targetPartName, TargetMode targetMode,
String relationshipType, String id);
@ -76,9 +73,8 @@ public interface RelationshipSource {
* @param target External target of the relationship
* @param relationshipType Type of relationship.
* @return The newly created and added relationship
* @see org.apache.poi.openxml4j.opc.RelationshipSource#addExternalRelationship(java.lang.String, java.lang.String)
*/
public PackageRelationship addExternalRelationship(String target, String relationshipType);
PackageRelationship addExternalRelationship(String target, String relationshipType);
/**
* Adds an external relationship to a part
@ -95,12 +91,12 @@ public interface RelationshipSource {
* @return The newly created and added relationship
* @see org.apache.poi.openxml4j.opc.RelationshipSource#addExternalRelationship(java.lang.String, java.lang.String)
*/
public PackageRelationship addExternalRelationship(String target, String relationshipType, String id);
PackageRelationship addExternalRelationship(String target, String relationshipType, String id);
/**
* Delete all the relationships attached to this.
*/
public abstract void clearRelationships();
void clearRelationships();
/**
* Delete the relationship specified by its id.
@ -108,16 +104,14 @@ public interface RelationshipSource {
* @param id
* The ID identified the part to delete.
*/
public abstract void removeRelationship(String id);
void removeRelationship(String id);
/**
* Retrieve all the relationships attached to this.
*
* @return This part's relationships.
* @throws OpenXML4JException
*/
public abstract PackageRelationshipCollection getRelationships()
throws InvalidFormatException, OpenXML4JException;
PackageRelationshipCollection getRelationships() throws OpenXML4JException;
/**
* Retrieves a package relationship from its id.
@ -126,7 +120,7 @@ public interface RelationshipSource {
* ID of the package relationship to retrieve.
* @return The package relationship
*/
public abstract PackageRelationship getRelationship(String id);
PackageRelationship getRelationship(String id);
/**
* Retrieve all relationships attached to this part which have the specified
@ -140,9 +134,8 @@ public interface RelationshipSource {
* @throws InvalidOperationException
* If the package is open in write only mode.
*/
public abstract PackageRelationshipCollection getRelationshipsByType(
String relationshipType) throws InvalidFormatException,
IllegalArgumentException, OpenXML4JException;
PackageRelationshipCollection getRelationshipsByType(String relationshipType)
throws IllegalArgumentException, OpenXML4JException;
/**
* Knows if the part have any relationships.
@ -150,7 +143,7 @@ public interface RelationshipSource {
* @return <b>true</b> if the part have at least one relationship else
* <b>false</b>.
*/
public abstract boolean hasRelationships();
boolean hasRelationships();
/**
* Checks if the specified relationship is part of this package part.
@ -160,6 +153,6 @@ public interface RelationshipSource {
* @return <b>true</b> if the specified relationship exists in this part,
* else returns <b>false</b>
*/
public abstract boolean isRelationshipExists(PackageRelationship rel);
boolean isRelationshipExists(PackageRelationship rel);
}

View File

@ -18,10 +18,8 @@
package org.apache.poi.openxml4j.opc;
/**
* Specifies whether the target of a PackageRelationship is inside or outside a
* Package.
* Specifies whether the target of a PackageRelationship is inside or outside a Package.
*
* @author Julien Chable
* @version 1.0
*/
public enum TargetMode {

View File

@ -32,7 +32,6 @@ import org.apache.poi.util.NotImplemented;
/**
* Zip implementation of a PackagePart.
*
* @author Julien Chable
* @version 1.0
* @see PackagePart
*/

View File

@ -45,8 +45,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
* retrieving a part from a package; format designers shall specify only such
* content types for inclusion in the format.
* </p>
* @author Julien Chable
* @version 0.1
*
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">http://www.ietf.org/rfc/rfc2045.txt</a>
* @see <a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a>

View File

@ -42,8 +42,6 @@ import org.xml.sax.SAXException;
/**
* Manage package content types ([Content_Types].xml part).
*
* @author Julien Chable
*/
public abstract class ContentTypeManager {

View File

@ -25,8 +25,6 @@ import java.nio.channels.FileChannel;
/**
* Provide useful method to manage file.
*
* @author Julien Chable
* @version 0.1
*/
public final class FileHelper {
@ -67,7 +65,7 @@ public final class FileHelper {
FileOutputStream fos = new FileOutputStream(out);
FileChannel sourceChannel = fis.getChannel();
FileChannel destinationChannel = fos.getChannel()) {
sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel);
}
}

View File

@ -33,8 +33,7 @@ import org.apache.poi.util.IOUtils;
/**
* Memory version of a package part. Use to
*
* @author Julien Chable
*
* @version 1.0
*/
public final class MemoryPackagePart extends PackagePart {
@ -46,7 +45,7 @@ public final class MemoryPackagePart extends PackagePart {
/**
* Constructor.
*
*
* @param pack
* The owner package.
* @param partName
@ -63,7 +62,7 @@ public final class MemoryPackagePart extends PackagePart {
/**
* Constructor.
*
*
* @param pack
* The owner package.
* @param partName
@ -121,10 +120,10 @@ public final class MemoryPackagePart extends PackagePart {
} catch(IOException e) {
throw new InvalidFormatException(e.getMessage());
}
// Save it
data = baos.toByteArray();
// All done
return true;
}

View File

@ -23,8 +23,6 @@ import java.io.OutputStream;
/**
* Build an output stream for MemoryPackagePart.
*
* @author Julien Chable
*/
public final class MemoryPackagePartOutputStream extends OutputStream {

View File

@ -41,8 +41,6 @@ import org.apache.poi.util.LocaleUtil;
/**
* Represents the core properties part of a package.
*
* @author Julien Chable
*/
public final class PackagePropertiesPart extends PackagePart implements PackageProperties {

View File

@ -27,7 +27,6 @@ import org.apache.poi.openxml4j.opc.PackagePart;
* marshaller is responsible to marshall a part in order to be save in a
* package.
*
* @author Julien Chable
* @version 0.1
*/
public interface PartMarshaller {

View File

@ -29,9 +29,6 @@ import org.apache.poi.openxml4j.opc.internal.unmarshallers.UnmarshallContext;
* Classes implementing this interface are considered as part unmarshaller. A part
* unmarshaller is responsible to unmarshall a part in order to load it from a
* package.
*
* @author Julien Chable
* @version 0.1
*/
public interface PartUnmarshaller {

View File

@ -33,7 +33,6 @@ import org.w3c.dom.Document;
/**
* Zip implementation of the ContentTypeManager.
*
* @author Julien Chable
* @version 1.0
* @see ContentTypeManager
*/

View File

@ -26,7 +26,6 @@ import org.apache.poi.openxml4j.opc.internal.PartMarshaller;
/**
* Default marshaller that specified that the part is responsible to marshall its content.
*
* @author Julien Chable
* @version 1.0
* @see PartMarshaller
*/

View File

@ -29,8 +29,6 @@ import org.apache.poi.openxml4j.opc.internal.ZipHelper;
/**
* Package core properties marshaller specialized for zipped package.
*
* @author Julien Chable
*/
public final class ZipPackagePropertiesMarshaller extends PackagePropertiesMarshaller {

View File

@ -41,8 +41,6 @@ import org.xml.sax.SAXException;
/**
* Package properties unmarshaller.
*
* @author Julien Chable
*/
public final class PackagePropertiesUnmarshaller implements PartUnmarshaller {

View File

@ -23,8 +23,7 @@ import org.apache.poi.openxml4j.opc.PackagePartName;
/**
* Context needed for the unmarshall process of a part. This class is immutable.
*
* @author Julien Chable
*
* @version 1.0
*/
public final class UnmarshallContext {
@ -37,7 +36,7 @@ public final class UnmarshallContext {
/**
* Constructor.
*
*
* @param targetPackage
* Container.
* @param partName

View File

@ -41,8 +41,6 @@ import org.w3c.dom.Document;
/**
* Signature Facet implementation to create enveloped signatures.
*
* @author Frank Cornelis
*/
public class EnvelopedSignatureFacet implements SignatureFacet {

View File

@ -51,8 +51,6 @@ import org.w3c.dom.NodeList;
/**
* Signature Facet implementation that adds ds:KeyInfo to the XML signature.
*
* @author Frank Cornelis
*/
public class KeyInfoSignatureFacet implements SignatureFacet {

View File

@ -41,8 +41,6 @@ import org.w3c.dom.NodeList;
* Work-around for Office2010 to accept the XAdES-BES/EPES signature.
*
* xades:UnsignedProperties/xades:UnsignedSignatureProperties needs to be present.
*
* @author Frank Cornelis
*/
public class Office2010SignatureFacet implements SignatureFacet {

View File

@ -86,7 +86,6 @@ import org.w3c.dom.Element;
* This implementation has been tested against an implementation that
* participated multiple ETSI XAdES plugtests.
*
* @author Frank Cornelis
* @see <a href="http://en.wikipedia.org/wiki/XAdES">XAdES</a>
*
*/

View File

@ -82,7 +82,6 @@ import org.w3c.dom.NodeList;
* This implementation has been tested against an implementation that
* participated multiple ETSI XAdES plugtests.
*
* @author Frank Cornelis
* @see XAdESSignatureFacet
*/
public class XAdESXLSignatureFacet implements SignatureFacet {

View File

@ -18,9 +18,9 @@
/* ====================================================================
This product contains an ASLv2 licensed version of the OOXML signer
package from the eID Applet project
http://code.google.com/p/eid-applet/source/browse/trunk/README.txt
http://code.google.com/p/eid-applet/source/browse/trunk/README.txt
Copyright (C) 2008-2014 FedICT.
================================================================= */
================================================================= */
package org.apache.poi.poifs.crypt.dsig.services;
@ -31,9 +31,6 @@ import java.util.List;
/**
* Container class for PKI revocation data.
*
* @author Frank Cornelis
*
*/
public class RevocationData {
@ -51,7 +48,7 @@ public class RevocationData {
/**
* Adds a CRL to this revocation data set.
*
*
* @param encodedCrl
*/
public void addCRL(byte[] encodedCrl) {
@ -60,7 +57,7 @@ public class RevocationData {
/**
* Adds a CRL to this revocation data set.
*
*
* @param crl
*/
public void addCRL(X509CRL crl) {
@ -76,7 +73,7 @@ public class RevocationData {
/**
* Adds an OCSP response to this revocation data set.
*
*
* @param encodedOcsp
*/
public void addOCSP(byte[] encodedOcsp) {
@ -85,7 +82,7 @@ public class RevocationData {
/**
* Gives back a list of all CRLs.
*
*
* @return a list of all CRLs
*/
public List<byte[]> getCRLs() {
@ -94,7 +91,7 @@ public class RevocationData {
/**
* Gives back a list of all OCSP responses.
*
*
* @return a list of all OCSP response
*/
public List<byte[]> getOCSPs() {
@ -104,7 +101,7 @@ public class RevocationData {
/**
* Returns <code>true</code> if this revocation data set holds OCSP
* responses.
*
*
* @return <code>true</code> if this revocation data set holds OCSP
* responses.
*/
@ -114,7 +111,7 @@ public class RevocationData {
/**
* Returns <code>true</code> if this revocation data set holds CRLs.
*
*
* @return <code>true</code> if this revocation data set holds CRLs.
*/
public boolean hasCRLs() {
@ -123,7 +120,7 @@ public class RevocationData {
/**
* Returns <code>true</code> if this revocation data is not empty.
*
*
* @return <code>true</code> if this revocation data is not empty.
*/
public boolean hasRevocationDataEntries() {

View File

@ -18,9 +18,9 @@
/* ====================================================================
This product contains an ASLv2 licensed version of the OOXML signer
package from the eID Applet project
http://code.google.com/p/eid-applet/source/browse/trunk/README.txt
http://code.google.com/p/eid-applet/source/browse/trunk/README.txt
Copyright (C) 2008-2014 FedICT.
================================================================= */
================================================================= */
package org.apache.poi.poifs.crypt.dsig.services;
@ -30,16 +30,13 @@ import java.util.List;
/**
* Interface for a service that retrieves revocation data about some given
* certificate chain.
*
* @author Frank Cornelis
*
*/
public interface RevocationDataService {
/**
* Gives back the revocation data corresponding with the given certificate
* chain.
*
*
* @param certificateChain the certificate chain
* @return the revocation data corresponding with the given certificate chain.
*/

View File

@ -18,23 +18,20 @@
/* ====================================================================
This product contains an ASLv2 licensed version of the OOXML signer
package from the eID Applet project
http://code.google.com/p/eid-applet/source/browse/trunk/README.txt
http://code.google.com/p/eid-applet/source/browse/trunk/README.txt
Copyright (C) 2008-2014 FedICT.
================================================================= */
================================================================= */
package org.apache.poi.poifs.crypt.dsig.services;
/**
* Interface for the signature policy service.
*
* @author Frank Cornelis
*
*/
public interface SignaturePolicyService {
/**
* Gives back the signature policy identifier URI.
*
*
* @return the signature policy identifier URI.
*/
String getSignaturePolicyIdentifier();
@ -42,7 +39,7 @@ public interface SignaturePolicyService {
/**
* Gives back the short description of the signature policy or
* <code>null</code> if a description is not available.
*
*
* @return the description, or <code>null</code>.
*/
String getSignaturePolicyDescription();
@ -51,14 +48,14 @@ public interface SignaturePolicyService {
* Gives back the download URL where the signature policy document can be
* found. Can be <code>null</code> in case such a download location does not
* exist.
*
*
* @return the download URL, or <code>null</code>.
*/
String getSignaturePolicyDownloadUrl();
/**
* Gives back the signature policy document.
*
*
* @return the bytes of the signature policy document.
*/
byte[] getSignaturePolicyDocument();

View File

@ -76,9 +76,6 @@ import static org.apache.logging.log4j.util.Unbox.box;
/**
* A TSP time-stamp service implementation.
*
* @author Frank Cornelis
*
*/
public class TSPTimeStampService implements TimeStampService {

View File

@ -28,8 +28,6 @@ import org.apache.poi.poifs.crypt.dsig.SignatureInfo;
/**
* Interface for a time-stamp service.
*
* @author Frank Cornelis
*/
public interface TimeStampService {

View File

@ -18,9 +18,9 @@
/* ====================================================================
This product contains an ASLv2 licensed version of the OOXML signer
package from the eID Applet project
http://code.google.com/p/eid-applet/source/browse/trunk/README.txt
http://code.google.com/p/eid-applet/source/browse/trunk/README.txt
Copyright (C) 2008-2014 FedICT.
================================================================= */
================================================================= */
package org.apache.poi.poifs.crypt.dsig.services;
@ -29,15 +29,12 @@ import java.util.List;
/**
* Interface for trust validator of a TSP.
*
* @author Frank Cornelis
*
*/
public interface TimeStampServiceValidator {
/**
* Validates the given certificate chain.
*
*
* @param certificateChain
* @param revocationData
* the optional data container that should be filled with

View File

@ -52,8 +52,6 @@ import org.w3c.dom.Element;
* Taken (with permission) from https://gist.github.com/msteiger/4509119,
* including the fixes that are discussed in the comments
*
* @author Martin Steiger
*
* @see <a href="https://stackoverflow.com/questions/14258206/">Gradient paints not working in Apache Batik's svggen</a>
* @see <a href="https://issues.apache.org/jira/browse/BATIK-1032">BATIK-1032</a>
*/

View File

@ -24,8 +24,6 @@ import org.apache.poi.xslf.usermodel.XSLFShape;
/**
* Used internally to navigate the PresentationML text style hierarchy and fetch properties
*
* @author Yegor Kozlov
*/
@Internal
public abstract class PropertyFetcher<T> {

View File

@ -21,8 +21,6 @@ package org.apache.poi.xslf.usermodel;
/**
* Date: 11/5/11
*
* @author Yegor Kozlov
*/
public enum SlideLayout {
/**

View File

@ -32,8 +32,6 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTShapeNonVisual;
/**
* Represents a shape with a preset geometry.
*
* @author Yegor Kozlov
*/
@Beta
public class XSLFAutoShape extends XSLFTextShape implements AutoShape<XSLFShape, XSLFTextParagraph> {

View File

@ -32,8 +32,6 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTConnectorNonVisual
/**
* Specifies a connection shape.
*
* @author Yegor Kozlov
*/
@Beta
public class XSLFConnectorShape extends XSLFSimpleShape

View File

@ -50,8 +50,6 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTShape;
/**
* Represents a group shape that consists of many shapes grouped together.
*
* @author Yegor Kozlov
*/
@Beta
public class XSLFGroupShape extends XSLFShape

View File

@ -42,8 +42,6 @@ import org.openxmlformats.schemas.presentationml.x2006.main.NotesMasterDocument;
* their attached text bodies. Then the notesStyles element specifies the
* formatting for the text within each of these shapes.
* </p>
*
* @author Yegor Kozlov
*/
@Beta
public class XSLFNotesMaster extends XSLFSheet

View File

@ -29,8 +29,6 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor;
/**
* Represents a shadow of a shape. For now supports only outer shadows.
*
* @author Yegor Kozlov
*/
public class XSLFShadow extends XSLFShape implements Shadow<XSLFShape,XSLFTextParagraph> {

View File

@ -73,7 +73,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTShape;
@Beta
public abstract class XSLFSheet extends POIXMLDocumentPart
implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> {
private static Logger LOG = LogManager.getLogger(XSLFSheet.class);
private static final Logger LOG = LogManager.getLogger(XSLFSheet.class);
private XSLFDrawing _drawing;
private List<XSLFShape> _shapes;
@ -345,7 +345,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> {
* it is unchanged.
*
* @param xShape shape to be removed from this sheet, if present
* @return <tt>true</tt> if this sheet contained the specified element
* @return {@code true} if this sheet contained the specified element
* @throws IllegalArgumentException if the type of the specified shape
* is incompatible with this sheet (optional)
*/
@ -461,7 +461,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> {
* Append content to this sheet.
*
* @param src the source sheet
* @return modified <code>this</code>.
* @return modified {@code this}.
*/
@SuppressWarnings("unused")
public XSLFSheet appendContent(XSLFSheet src){
@ -490,7 +490,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> {
/**
* @return theme (shared styles) associated with this theme.
* By default returns <code>null</code> which means that this sheet is theme-less.
* By default returns {@code null} which means that this sheet is theme-less.
* Sheets that support the notion of themes (slides, masters, layouts, etc.) should override this
* method and return the corresponding package part.
*/

View File

@ -29,9 +29,6 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STShapeType;
import org.openxmlformats.schemas.presentationml.x2006.main.CTShape;
import org.openxmlformats.schemas.presentationml.x2006.main.CTShapeNonVisual;
/**
* @author Yegor Kozlov
*/
@Beta
public class XSLFTextBox extends XSLFAutoShape implements TextBox<XSLFShape, XSLFTextParagraph> {

View File

@ -131,6 +131,7 @@ public class XSSFBReader extends XSSFReader {
return WORKSHEET_RELS;
}
@Override
Iterator<XSSFSheetRef> createSheetIteratorFromWB(PackagePart wb) throws IOException {
SheetRefLoader sheetRefLoader = new SheetRefLoader(wb.getInputStream());
sheetRefLoader.parse();

View File

@ -88,7 +88,7 @@ public class XSSFReader {
/**
* Creates a new XSSFReader, for the given package
*
* @param pkg an <code>OPCPackage</code> representing a spreasheet file
* @param pkg an {@code OPCPackage} representing a spreasheet file
* @param allowStrictOoxmlFiles whether to try to handle Strict OOXML format files
*/
public XSSFReader(OPCPackage pkg, boolean allowStrictOoxmlFiles) throws IOException, OpenXML4JException {
@ -226,7 +226,7 @@ public class XSSFReader {
XSSFSheetRef xssfSheetRef;
/**
* Iterator over CTSheet objects, returns sheets in <tt>logical</tt> order.
* Iterator over CTSheet objects, returns sheets in {@code logical} order.
* We can't rely on the Ooxml4J's relationship iterator because it returns objects in physical order,
* i.e. as they are stored in the underlying package
*/
@ -302,9 +302,9 @@ public class XSSFReader {
}
/**
* Returns <tt>true</tt> if the iteration has more elements.
* Returns {@code true} if the iteration has more elements.
*
* @return <tt>true</tt> if the iterator has more elements.
* @return {@code true} if the iterator has more elements.
*/
@Override
public boolean hasNext() {
@ -366,7 +366,7 @@ public class XSSFReader {
protected CommentsTable parseComments(PackagePart commentsPart) throws IOException {
return new CommentsTable(commentsPart);
}
/**
* Returns the shapes associated with this sheet,
* an empty list or null if there is an exception

View File

@ -32,8 +32,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CalcChainDocument;
/**
* The cells in a workbook can be calculated in different orders depending on various optimizations and
* dependencies. The calculation chain object specifies the order in which the cells in a workbook were last calculated.
*
* @author Yegor Kozlov
*/
public class CalculationChain extends POIXMLDocumentPart {
private CTCalcChain chain;
@ -50,7 +48,7 @@ public class CalculationChain extends POIXMLDocumentPart {
super(part);
readFrom(part.getInputStream());
}
public void readFrom(InputStream is) throws IOException {
try {
CalcChainDocument doc = CalcChainDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
@ -80,7 +78,7 @@ public class CalculationChain extends POIXMLDocumentPart {
/**
* Remove a formula reference from the calculation chain
*
*
* @param sheetId the sheet Id of a sheet the formula belongs to.
* @param ref A1 style reference to the cell containing the formula.
*/

View File

@ -37,21 +37,19 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSchema;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.MapInfoDocument;
/**
*
*
* This class implements the Custom XML Mapping Part (Open Office XML Part 1:
* chapter 12.3.6)
*
*
* An instance of this part type contains a schema for an XML file, and
* information on the behavior that is used when allowing this custom XML schema
* to be mapped into the spreadsheet.
*
* @author Roberto Manicardi
*/
public class MapInfo extends POIXMLDocumentPart {
private CTMapInfo mapInfo;
private Map<Integer, XSSFMap> maps ;
public MapInfo() {
@ -66,8 +64,8 @@ public class MapInfo extends POIXMLDocumentPart {
public MapInfo(PackagePart part) throws IOException {
super(part);
readFrom(part.getInputStream());
}
}
public void readFrom(InputStream is) throws IOException {
try {
MapInfoDocument doc = MapInfoDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
@ -82,7 +80,7 @@ public class MapInfo extends POIXMLDocumentPart {
throw new IOException(e.getLocalizedMessage());
}
}
/**
* Returns the parent XSSFWorkbook
*
@ -91,14 +89,14 @@ public class MapInfo extends POIXMLDocumentPart {
public XSSFWorkbook getWorkbook() {
return (XSSFWorkbook)getParent();
}
/**
*
*
* @return the internal data object
*/
public CTMapInfo getCTMapInfo(){
return mapInfo;
}
/**
@ -117,27 +115,27 @@ public class MapInfo extends POIXMLDocumentPart {
}
return xmlSchema;
}
public XSSFMap getXSSFMapById(int id){
return maps.get(id);
}
public XSSFMap getXSSFMapByName(String name){
XSSFMap matchedMap = null;
for(XSSFMap map :maps.values()){
if(map.getCtMap().getName()!=null && map.getCtMap().getName().equals(name)){
matchedMap = map;
}
}
}
return matchedMap;
}
/**
*
*
* @return all the mappings configured in this document
*/
public Collection<XSSFMap> getAllXSSFMaps(){

View File

@ -36,16 +36,13 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.SingleXmlCellsDocumen
/**
*
*
* This class implements the Single Cell Tables Part (Open Office XML Part 4:
* chapter 3.5.2)
*
*
* @author Roberto Manicardi
*/
public class SingleXmlCells extends POIXMLDocumentPart {
private CTSingleXmlCells singleXMLCells;
public SingleXmlCells() {
@ -70,7 +67,7 @@ public class SingleXmlCells extends POIXMLDocumentPart {
throw new IOException(e.getLocalizedMessage());
}
}
public XSSFSheet getXSSFSheet(){
return (XSSFSheet) getParent();
}
@ -88,21 +85,21 @@ public class SingleXmlCells extends POIXMLDocumentPart {
writeTo(out);
out.close();
}
public CTSingleXmlCells getCTSingleXMLCells(){
return singleXMLCells;
}
/**
*
*
* @return all the SimpleXmlCell contained in this SingleXmlCells element
*/
public List<XSSFSingleXmlCell> getAllSimpleXmlCell(){
List<XSSFSingleXmlCell> list = new Vector<>();
for(CTSingleXmlCell singleXmlCell: singleXMLCells.getSingleXmlCellArray()){
list.add(new XSSFSingleXmlCell(singleXmlCell,this));
}
}
return list;
}
}

View File

@ -30,8 +30,6 @@ import java.util.zip.*;
* Drop in replacement for `java.util.ZipOutputStream`.
*
* For more information see https://github.com/rzymek/opczip
*
* @author Krzysztof Rzymkowski
*/
class OpcOutputStream extends DeflaterOutputStream {

View File

@ -26,8 +26,6 @@ import static java.nio.charset.StandardCharsets.US_ASCII;
/**
* Excel compatible Zip64 implementation.
* For more information see https://github.com/rzymek/opczip
*
* @author Krzysztof Rzymkowski
*/
class Zip64Impl {
private static final long PK0102 = 0x02014b50L;

View File

@ -315,6 +315,7 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork
}
}
@Override
@NotImplemented
public int getExternalSheetIndex(String workbookName, String sheetName) {
throw new RuntimeException("not implemented yet");
@ -387,7 +388,7 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork
* This is meant to be used on documents whose structure is essentially static at the point formulas are evaluated.
*
* @param name the data table name (case-insensitive)
* @return The Data table in the workbook named <tt>name</tt>, or <tt>null</tt> if no table is named <tt>name</tt>.
* @return The Data table in the workbook named {@code name}, or {@code null} if no table is named {@code name}.
* @since 3.15 beta 2
*/
@Override
@ -419,15 +420,18 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork
_fpBook = fpBook;
}
@Override
public Ptg[] getNameDefinition() {
return FormulaParser.parse(_nameRecord.getRefersToFormula(), _fpBook, FormulaType.NAMEDRANGE, _nameRecord.getSheetIndex());
}
@Override
public String getNameText() {
return _nameRecord.getNameName();
}
@Override
public boolean hasFormula() {
// TODO - no idea if this is right
CTDefinedName ctn = _nameRecord.getCTName();
@ -435,13 +439,16 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork
return !ctn.getFunction() && strVal != null && strVal.length() > 0;
}
@Override
public boolean isFunctionName() {
return _nameRecord.isFunctionName();
}
@Override
public boolean isRange() {
return hasFormula(); // TODO - is this right?
}
@Override
public NamePtg createPtg() {
return new NamePtg(_index);
}

View File

@ -20,8 +20,6 @@ import org.apache.poi.ss.usermodel.AutoFilter;
/**
* Represents autofiltering for the specified worksheet.
*
* @author Yegor Kozlov
*/
public final class XSSFAutoFilter implements AutoFilter {
private XSSFSheet _sheet;

Some files were not shown because too many files have changed in this diff Show More