From 6025b6016517c6d898d8957d1d7e03ba71431912 Mon Sep 17 00:00:00 2001 From: tknall Date: Fri, 1 Dec 2006 12:20:24 +0000 Subject: Initial import of release 2.2. git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@4 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../parsing/results/ArrayParseResult.java | 34 ++++++++++ .../parsing/results/BooleanParseResult.java | 30 +++++++++ .../parsing/results/ContainerParseResult.java | 37 +++++++++++ .../parsing/results/DictionaryParseResult.java | 33 ++++++++++ .../parsing/results/EOFParseResult.java | 39 +++++++++++ .../parsing/results/FooterParseResult.java | 45 +++++++++++++ .../parsing/results/HeaderParseResult.java | 40 ++++++++++++ .../parsing/results/HexStringParseResult.java | 28 ++++++++ .../IndirectObjectReferenceParseResult.java | 36 ++++++++++ .../parsing/results/IntegerParseResult.java | 28 ++++++++ .../parsing/results/LiteralStringParseResult.java | 29 +++++++++ .../parsing/results/NameParseResult.java | 27 ++++++++ .../parsing/results/NullParseResult.java | 26 ++++++++ .../parsing/results/NumberParseResult.java | 33 ++++++++++ .../parsing/results/ObjectHeaderParseResult.java | 43 ++++++++++++ .../parsing/results/ObjectParseResult.java | 42 ++++++++++++ .../exactparser/parsing/results/ParseResult.java | 42 ++++++++++++ .../parsing/results/StartXRefParseResult.java | 28 ++++++++ .../parsing/results/StreamParseResult.java | 33 ++++++++++ .../parsing/results/TrailerParseResult.java | 76 ++++++++++++++++++++++ .../parsing/results/XRefLineParseResult.java | 32 +++++++++ .../parsing/results/XRefSectionParseResult.java | 58 +++++++++++++++++ .../parsing/results/XRefSubSectionParseResult.java | 51 +++++++++++++++ 23 files changed, 870 insertions(+) create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/ArrayParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/BooleanParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/ContainerParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/DictionaryParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/EOFParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/FooterParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/HeaderParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/HexStringParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/IndirectObjectReferenceParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/IntegerParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/LiteralStringParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/NameParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/NullParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/NumberParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/ObjectHeaderParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/ObjectParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/ParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/StartXRefParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/StreamParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/TrailerParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefLineParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefSectionParseResult.java create mode 100644 src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefSubSectionParseResult.java (limited to 'src/main/java/at/knowcenter/wag/exactparser/parsing/results') diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ArrayParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ArrayParseResult.java new file mode 100644 index 0000000..53d2838 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ArrayParseResult.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: ArrayParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +import java.util.List; + +/** + * The result of parsing a hex string. + * + * @see at.knowcenter.wag.exactparser.parsing.results.LiteralStringParseResult + * + * @author wprinz + */ +public class ArrayParseResult extends ContainerParseResult { + + public List elements = null; + + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/BooleanParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/BooleanParseResult.java new file mode 100644 index 0000000..5b6c31d --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/BooleanParseResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: BooleanParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * Parse result of parsing a boolean value. + * + * @author wprinz + */ +public class BooleanParseResult extends ParseResult +{ + + public boolean value = false; + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ContainerParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ContainerParseResult.java new file mode 100644 index 0000000..3ca8dc2 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ContainerParseResult.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: ContainerParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * Base class of container parse results. + * + *

+ * Containers are types that include some content. + * E.g. literal strings include string data as content, + * arrays include elements as content etc. + *

+ * + * @author wprinz + */ +public class ContainerParseResult extends ParseResult { + + public int content_start_index = -1; + public int content_end_index = -1; + + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/DictionaryParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/DictionaryParseResult.java new file mode 100644 index 0000000..b976bd2 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/DictionaryParseResult.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: DictionaryParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +import java.util.List; + +/** + * The result of parsing a dictionary. + * + * @author wprinz + */ +public class DictionaryParseResult extends ContainerParseResult +{ + + public List names = null; + + public List values = null; +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/EOFParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/EOFParseResult.java new file mode 100644 index 0000000..19d864d --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/EOFParseResult.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: EOFParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * The result of parsing the End Of File marker. + * + * @author wprinz + */ +public class EOFParseResult extends ParseResult +{ + + /** + * The index of the byte after the EOF marker. + * + *

+ * A newline is not necessary after the EOF marker, but if it is present it will be considered + * as part of it. + * So eof_end_index marks this newline. + * If eof_end_index == next_index, then no new line is present. + *

+ */ + public int eof_end_index = -1; +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/FooterParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/FooterParseResult.java new file mode 100644 index 0000000..d8eb2e1 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/FooterParseResult.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: FooterParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + + +/** + * The result of parsing a PDF footer block. + * + *

+ * A PDF footer block starts with the xref table followed by the trailer, the + * startxref and finally the EOF marker. Usually the footer should be at the end + * of the file. All object offsets in the footer's xref table should be before + * the footer itself. Nevertheless, there are PDF Writers (e.g. Microsoft Word) + * that put the footer at the beginning of the document so that all indirect + * objects are after the EOF marker. + *

+ * + * @author wprinz + */ +public class FooterParseResult extends ParseResult +{ + + public StartXRefParseResult sxpr = null; + + public EOFParseResult eofpr = null; + + public XRefSectionParseResult xpr = null; + + public TrailerParseResult tpr = null; +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/HeaderParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/HeaderParseResult.java new file mode 100644 index 0000000..893fa07 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/HeaderParseResult.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: HeaderParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * The result of parsing the PDF header. + * + *

+ * The header contains the PDF version and is usually followed by some binary + * characers. + *

+ * + * @author wprinz + */ +public class HeaderParseResult extends ParseResult +{ + public int major_index = -1; + public int minor_index = -1; + + public int major = -1; + public int minor = -1; + + public int binary_characters_index = -1; + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/HexStringParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/HexStringParseResult.java new file mode 100644 index 0000000..fdaaf66 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/HexStringParseResult.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: HexStringParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * The result of parsing a hex string. + * + * @see at.knowcenter.wag.exactparser.parsing.results.LiteralStringParseResult + * + * @author wprinz + */ +public class HexStringParseResult extends ContainerParseResult { +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/IndirectObjectReferenceParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/IndirectObjectReferenceParseResult.java new file mode 100644 index 0000000..d839004 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/IndirectObjectReferenceParseResult.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: IndirectObjectReferenceParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +import at.knowcenter.wag.exactparser.parsing.IndirectObjectReference; + +/** + * The ParseResult of parsing an indirect object reference. + * + * @author wprinz + */ +public class IndirectObjectReferenceParseResult extends ParseResult { + + public IndirectObjectReference ior; + + //@Override + public String toString() + { + return ior.toString() + " R"; + } +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/IntegerParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/IntegerParseResult.java new file mode 100644 index 0000000..5eec5e5 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/IntegerParseResult.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: IntegerParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * @author wprinz + */ +public class IntegerParseResult extends ParseResult +{ + + public int number; + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/LiteralStringParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/LiteralStringParseResult.java new file mode 100644 index 0000000..0c7872d --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/LiteralStringParseResult.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: LiteralStringParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * The result of parsing a simple string (ASCII string). + * + * @see at.knowcenter.wag.exactparser.parsing.results.HexStringParseResult + * + * @author wprinz + */ +public class LiteralStringParseResult extends ContainerParseResult { + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/NameParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/NameParseResult.java new file mode 100644 index 0000000..9a8aa39 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/NameParseResult.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: NameParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * @author wprinz + */ +public class NameParseResult extends ParseResult { + + public int name_start_index = -1; + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/NullParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/NullParseResult.java new file mode 100644 index 0000000..fd6e57d --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/NullParseResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: NullParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * The result of parsing a "null". + * + * @author wprinz + */ +public class NullParseResult extends ParseResult { +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/NumberParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/NumberParseResult.java new file mode 100644 index 0000000..a6882c1 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/NumberParseResult.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: NumberParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * The ParseResult of parsing an integer number. + * + * @author wprinz + */ +public class NumberParseResult extends ParseResult { + /** + * The (signed) integer number. + */ + public int number; + + // TODO: make better + public float floating; +} \ No newline at end of file diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ObjectHeaderParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ObjectHeaderParseResult.java new file mode 100644 index 0000000..5a2265a --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ObjectHeaderParseResult.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: ObjectHeaderParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * The ParseResult of a parsing an object header. + * + *

+ * Note that this information regards only the object header and not the + * contents of the object itself. (meaning: next points to the contents and not + * to the end of the whole object) + *

+ * + * @author Administrator + */ +public class ObjectHeaderParseResult extends ParseResult { + + /** + * The object's object number. + */ + public int object_number = -1; + + /** + * The object's generation number. + */ + public int generation_number = -1; + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ObjectParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ObjectParseResult.java new file mode 100644 index 0000000..4d9c224 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ObjectParseResult.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: ObjectParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + + +/** + * The ParseResult of parsing an indirect object. + * @author wprinz + */ +public class ObjectParseResult extends ParseResult { + + public int content_index = -1; + public int end_of_content_index = -1; + + public ObjectHeaderParseResult header = null; + +/* enum ObjectType + { + UNKNOWN_TO_PARSER, + OBJ_DICTIONARY + }; + + public ObjectType object_type = ObjectType.UNKNOWN_TO_PARSER; + */ + public ParseResult object = null; + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ParseResult.java new file mode 100644 index 0000000..d7ad4e9 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/ParseResult.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: ParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * Base class of all parse results. + * + * @author wprinz + */ +public class ParseResult { + + /** + * The start index, where the parser started its work and where the parsed + * entity begins. + */ + public int start_index = -1; + + /** + * The index of the next entity following the currently parsed entity. + * + *

+ * This is the index of the first byte not belonging to this entity anymore. + *

+ */ + public int next_index = -1; + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/StartXRefParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/StartXRefParseResult.java new file mode 100644 index 0000000..801e04b --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/StartXRefParseResult.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: StartXRefParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + + +/** + * The ParseResult of parsing a startxref entry. + * @author wprinz + */ +public class StartXRefParseResult extends ParseResult { + + public int xref_index; +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/StreamParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/StreamParseResult.java new file mode 100644 index 0000000..6682d55 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/StreamParseResult.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: StreamParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + + +/** + * The result of parsing a hex string. + * + * @see at.knowcenter.wag.exactparser.parsing.results.LiteralStringParseResult + * + * @author wprinz + */ +public class StreamParseResult extends ContainerParseResult { + + public DictionaryParseResult stream_dictionary = null; + + public int stream_start_index = -1; +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/TrailerParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/TrailerParseResult.java new file mode 100644 index 0000000..d958cdb --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/TrailerParseResult.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: TrailerParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * The ParseResult of parsing the trailer. + * + * @author wprinz + */ +public class TrailerParseResult extends ParseResult { + + public int contents_index = -1; + public int contents_end_index = -1; + + public DictionaryParseResult dpr = null; + + public IndirectObjectReferenceParseResult info; + + public IndirectObjectReferenceParseResult root; + + /** + * The content of the "/Size" entry. + */ + public int size; + + /** + * Tells, if this PDF footer has a predecessor (as specified by + * the /Prev entry). + */ + public boolean has_predecessor = false; + + /** + * The index of the predecessor. + * + *

+ * Only valid if has_predecessor is true. + *

+ *

+ * Use getPrev and setPrev to access this member variable. + *

+ * + * @see #getPrev() + * @see #setPrev(int) + */ + private int prev = -1; + + public int getPrev() { + assert has_predecessor; + return prev; + } + + public void setPrev(int prev) { + assert has_predecessor : "Set has_predecessor to true first."; + this.prev = prev; + } + + + + + +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefLineParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefLineParseResult.java new file mode 100644 index 0000000..e04e88d --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefLineParseResult.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: XRefLineParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +/** + * The ParseResult of parsing a single xref line. + * + * @author wprinz + */ +public class XRefLineParseResult extends ParseResult { + + public int object_offset; + + public int generation_number; + + public byte object_usage; +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefSectionParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefSectionParseResult.java new file mode 100644 index 0000000..8b2858c --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefSectionParseResult.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: XRefSectionParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +import java.util.ArrayList; +import java.util.List; + +/** + * The ParseResult of an xref parsing operation. + * + *

+ * This contains one whole xref table section. An xref section starts with the + * word xref and contains one or more xref sub-sections. + *

+ *

+ * Due to Incremental Updates, there may be more than one xref section in a + * document. All xref section together are called the xref table. Using this + * aggregated xref table, an application has the full access to all indirect + * objects in the document. + *

+ *

+ * In many PDF libraries and applications one xref section is also informally + * called xref table. + *

+ * + * @author wprinz + */ +public class XRefSectionParseResult extends ParseResult +{ + + public List xref_subsections = new ArrayList(); + + /** + * Appends another cross-reference (xref) sub-section to the xref table. + * + * @param xref_section + * The xref section to be appended. + */ + public void appendXRefSubSection(XRefSubSectionParseResult xref_section) + { + xref_subsections.add(xref_section); + } +} diff --git a/src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefSubSectionParseResult.java b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefSubSectionParseResult.java new file mode 100644 index 0000000..41982c4 --- /dev/null +++ b/src/main/java/at/knowcenter/wag/exactparser/parsing/results/XRefSubSectionParseResult.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2006 by Know-Center, Graz, Austria + * + * This software is the confidential and proprietary information of Know-Center, + * Graz, Austria. You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement you entered + * into with Know-Center. + * + * KNOW-CENTER MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF + * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + * NON-INFRINGEMENT. KNOW-CENTER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY + * LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS + * DERIVATIVES. + * + * $Id: XRefSubSectionParseResult.java,v 1.1 2006/08/25 17:00:59 wprinz Exp $ + */ +package at.knowcenter.wag.exactparser.parsing.results; + +import java.util.ArrayList; +import java.util.List; + +/** + * Contains an xref sub-section. + * + *

+ * An xref sub-section is an ordered list of xref lines. The object numbers of the + * corresponding objects are numbered incrementally. + *

+ *

+ * xref sections are important in Incremental Updates because they allow to + * specify explicitely which objects (object numbers) are contained in the xref. + *

+ * + * @author wprinz + */ +public class XRefSubSectionParseResult extends ParseResult { + + public int start_obj_number; + + public int num_objects; + + public List xref_lines = new ArrayList(); + + public void appendXRefLine(XRefLineParseResult xref_line) { + assert xref_lines.size() < num_objects; + + xref_lines.add(xref_line); + } + +} -- cgit v1.2.3