[FOray-commit] SF.net SVN: foray:[12515] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2022-01-31 17:33:18
|
Revision: 12515
http://sourceforge.net/p/foray/code/12515
Author: victormote
Date: 2022-01-31 17:33:15 +0000 (Mon, 31 Jan 2022)
Log Message:
-----------
Add some missing javadoc.
Modified Paths:
--------------
trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml
trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockArea.java
trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/DocumentMetadata4a.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java
trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java
trunk/foray/foray-common/src/test/java/org/foray/common/ConfigurationTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/AbstractIntSequenceTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteArrayTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/data/IntSequenceIteratorTests.java
trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java
trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
trunk/foray/foray-font/src/test/java/org/foray/font/SubsetTests.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfObjectReference.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfRoot.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfDashPattern4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationNamed4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interchange/PdfDocumentInfo4a.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfHeader.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfTextString.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfArray.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfBoolean.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfDictionary.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfHexString.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfInteger.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfObject.java
trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfReal.java
Modified: trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml
===================================================================
--- trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-00-master/config/checkstyle/checkstyle-config.xml 2022-01-31 17:33:15 UTC (rev 12515)
@@ -115,7 +115,9 @@
<module name="JavadocType"/>
<!-- Make sure each Method has javadoc -->
- <!-- <module name="MissingJavadocMethod"/> -->
+ <module name="MissingJavadocMethod">
+ <property name="severity" value="ignore"/>
+ </module>
<!-- Make sure Method javadoc is well-formed. -->
<module name="JavadocMethod"/>
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockArea.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockArea.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/BlockArea.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -69,6 +69,7 @@
return false;
}
+ @Override
public abstract Link<Block> getFoLink();
@Override
Modified: trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/DocumentMetadata4a.java
===================================================================
--- trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/DocumentMetadata4a.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-areatree/src/main/java/org/foray/area/metadata/DocumentMetadata4a.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -50,6 +50,10 @@
/** The parent area tree. */
private AreaTree4a parent;
+ /**
+ * Constructor.
+ * @param parent The parent node.
+ */
public DocumentMetadata4a(final AreaTree4a parent) {
this.parent = parent;
}
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteArray.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -217,9 +217,9 @@
}
// @Override
- public ByteArray toByteArray() {
- return this;
- }
+// public ByteArray toByteArray() {
+// return this;
+// }
@Override
public boolean isNativeCharSequence() {
Modified: trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java
===================================================================
--- trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-common/src/main/java/org/foray/common/sequence/ByteSequenceChars.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -99,12 +99,6 @@
throw new UnsupportedOperationException();
}
-// @Override
- public ByteArray toByteArray() {
- /* TODO: Implement this. */
- throw new UnsupportedOperationException();
- }
-
@Override
public String toString() {
return this.sequence.toString();
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/ConfigurationTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/ConfigurationTests.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/ConfigurationTests.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -41,6 +41,11 @@
*/
public class ConfigurationTests {
+ /**
+ * Test of {@link Configuration#parseURLDirectory(URL, String, String)}.
+ * @throws ConfigurationException Not expected here.
+ * @throws MalformedURLException Not expected here.
+ */
@Test
public void parseUrlDirectoryTest001() throws ConfigurationException, MalformedURLException {
final URL baseUrl = new File("c:/bogus/bogus2/bogus3.txt").toURI().toURL();
@@ -49,6 +54,11 @@
Assert.assertEquals("file:/c:/bogus/fonts/", resolvedUrl.toExternalForm());
}
+ /**
+ * Test of {@link Configuration#parseURLDirectory(URL, String, String)}.
+ * @throws ConfigurationException Not expected here.
+ * @throws MalformedURLException Not expected here.
+ */
@Test
public void parseUrlDirectoryTest002() throws ConfigurationException, MalformedURLException {
final URL baseUrl = new File("c:/bogus/bogus2/bogus3.txt").toURI().toURL();
@@ -57,6 +67,11 @@
Assert.assertEquals("file:/c:/bogus/bogus2/", resolvedUrl.toExternalForm());
}
+ /**
+ * Test of {@link Configuration#parseURLDirectory(URL, String, String)}.
+ * @throws ConfigurationException Not expected here.
+ * @throws MalformedURLException Not expected here.
+ */
@Test
public void parseUrlDirectoryTest003() throws ConfigurationException, MalformedURLException {
final URL baseUrl = new File("c:/bogus/bogus2/bogus3.txt").toURI().toURL();
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/data/AbstractIntSequenceTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/data/AbstractIntSequenceTests.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/data/AbstractIntSequenceTests.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -44,6 +44,9 @@
/** Array builder available to all tests. */
private IntArrayBuilder builder;
+ /**
+ * Test setup.
+ */
@Before
public void before() {
final IntArrayBuilder builder = new IntArrayBuilder();
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteArrayTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteArrayTests.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteArrayTests.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -38,6 +38,9 @@
*/
public class ByteArrayTests {
+ /**
+ * Test of {@link ByteArray#fromHexCharSequence(CharSequence)}.
+ */
@Test
public void fromHexCharSequenceTests() {
final String input = "4397CDCC3F8F94FD6C77A64F83E95278";
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/data/ByteSequenceTokenizerTests.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -89,6 +89,10 @@
private static final ByteSequenceTokenizerConfig CONFIG_WITH_BALANCING =
new ByteSequenceTokenizerConfig(CLOSING_BALANCED_DELIMITERS, null, null, OPENING_BALANCED_DELIMITERS);
+ /**
+ * Test of {@link ByteSequenceTokenizer#ByteSequenceTokenizer(org.axsl.utility.sequence.ByteSequencePlus,
+ * ByteSequenceTokenizerConfig)}, where the byte array has no content.
+ */
@Test
public void testEmptyInput() {
final ByteArray ba = new ByteArray();
@@ -96,6 +100,10 @@
Assert.assertFalse(out.hasMoreTokens());
}
+ /**
+ * Test of {@link ByteSequenceTokenizer#ByteSequenceTokenizer(org.axsl.utility.sequence.ByteSequencePlus,
+ * ByteSequenceTokenizerConfig)}, where the byte array has normal content.
+ */
@Test
public void testNormalSentence() {
final ByteArray ba = new ByteArray("This is a normal sentence.");
@@ -125,6 +133,10 @@
Assert.assertEquals("sentence.", actual.get(4).toString());
}
+ /**
+ * Test of {@link ByteSequenceTokenizer#ByteSequenceTokenizer(org.axsl.utility.sequence.ByteSequencePlus,
+ * ByteSequenceTokenizerConfig)}, where the byte array is a normal sentence with leading whitespace.
+ */
@Test
public void testNormalSentenceLeadingWhitespace() {
/* Note the space at the beginning of the test array. */
@@ -139,6 +151,10 @@
Assert.assertEquals("sentence.", actual.get(4).toString());
}
+ /**
+ * Test of {@link ByteSequenceTokenizer#ByteSequenceTokenizer(org.axsl.utility.sequence.ByteSequencePlus,
+ * ByteSequenceTokenizerConfig)}, where the byte array is a normal sentence with trailing whitespace.
+ */
@Test
public void testNormalSentenceTrailingWhitespace() {
/* Note the space at the end of the test array. */
@@ -153,6 +169,10 @@
Assert.assertEquals("sentence.", actual.get(4).toString());
}
+ /**
+ * Test of {@link ByteSequenceTokenizer#ByteSequenceTokenizer(org.axsl.utility.sequence.ByteSequencePlus,
+ * ByteSequenceTokenizerConfig)}, where the byte array is a normal sentence with embedded tokens.
+ */
@Test
public void testNormalSentenceEmbeddedTokens() {
final ByteArray ba = new ByteArray("Thi]s{ }is []a normal}{ sentence.");
@@ -174,6 +194,10 @@
Assert.assertEquals("sentence.", actual.get(12).toString());
}
+ /**
+ * Test of {@link ByteSequenceTokenizer#ByteSequenceTokenizer(org.axsl.utility.sequence.ByteSequencePlus,
+ * ByteSequenceTokenizerConfig)}, where the byte array is a normal sentence with leading tokens.
+ */
@Test
public void testNormalSentenceLeadingTokens() {
final ByteArray ba = new ByteArray("][This is a normal sentence.");
@@ -189,6 +213,10 @@
Assert.assertEquals("sentence.", actual.get(6).toString());
}
+ /**
+ * Test of {@link ByteSequenceTokenizer#ByteSequenceTokenizer(org.axsl.utility.sequence.ByteSequencePlus,
+ * ByteSequenceTokenizerConfig)}, where the byte array is a normal sentence with trailing tokens.
+ */
@Test
public void testNormalSentenceTrailingTokens() {
final ByteArray ba = new ByteArray("This is a normal sentence.][");
@@ -204,6 +232,10 @@
Assert.assertEquals("[", actual.get(6).toString());
}
+ /**
+ * Test of {@link ByteSequenceTokenizer#ByteSequenceTokenizer(org.axsl.utility.sequence.ByteSequencePlus,
+ * ByteSequenceTokenizerConfig)}, where the byte array is a normal sentence with escape characters.
+ */
@Test
public void testEscape() {
final ByteArray ba = new ByteArray("\\[This \\[is\\] a no\\]rmal sentence.\\]");
@@ -217,6 +249,10 @@
Assert.assertEquals("sentence.\\]", actual.get(4).toString());
}
+ /**
+ * Test of {@link ByteSequenceTokenizer#ByteSequenceTokenizer(org.axsl.utility.sequence.ByteSequencePlus,
+ * ByteSequenceTokenizerConfig)}, where the byte array is a normal sentence with escaped escape characters.
+ */
@Test
public void testEscapeOfEscape() {
final ByteArray ba = new ByteArray("\\\\[This is a normal sentence.\\\\]");
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/data/IntSequenceIteratorTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/data/IntSequenceIteratorTests.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/data/IntSequenceIteratorTests.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -44,6 +44,9 @@
/** An array useful for testing the iterator. */
private IntArray array1 = new IntArray(5, -5, 100, -100, Integer.MAX_VALUE, Integer.MIN_VALUE);
+ /**
+ * Test of {@link IntSequenceIterator#IntSequenceIterator(org.axsl.utility.sequence.IntSequence, false)}.
+ */
@Test
public void testForwardIterator() {
final IntSequenceIterator out = new IntSequenceIterator(array1);
@@ -69,6 +72,9 @@
}
}
+ /**
+ * Test of {@link IntSequenceIterator#IntSequenceIterator(org.axsl.utility.sequence.IntSequence, false)}.
+ */
@Test
public void testReverseIterator() {
final IntSequenceIterator out = new IntSequenceIterator(array1, true);
Modified: trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java
===================================================================
--- trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-common/src/test/java/org/foray/common/primitive/ByteUtilsTests.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -55,6 +55,9 @@
}
}
+ /**
+ * Test of {@link ByteUtils#fromHexChars(CharSequence, int)}.
+ */
@Test
public void fromHexCharsTests() {
final String testString = "23FA7E";
@@ -100,6 +103,9 @@
Assert.assertEquals('0', ByteUtils.toHexCharHigh((byte) 0x03));
}
+ /**
+ * Tests of {@link ByteUtils#toHexCharLow(byte)}.
+ */
@Test
public void toHexCharLowTests() {
Assert.assertEquals('9', ByteUtils.toHexCharLow((byte) 0xF9));
Modified: trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java
===================================================================
--- trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-font/src/main/java/org/foray/font/FontUse4a.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -821,6 +821,7 @@
}
}
+ @Override
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append("[");
Modified: trunk/foray/foray-font/src/test/java/org/foray/font/SubsetTests.java
===================================================================
--- trunk/foray/foray-font/src/test/java/org/foray/font/SubsetTests.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-font/src/test/java/org/foray/font/SubsetTests.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -41,6 +41,9 @@
*/
public class SubsetTests {
+ /**
+ * Test of {@link Subset#encodeSubsetIndex(int)}.
+ */
@Test
public void test01() {
/* The mock encoding just returns the code point to be encoded, i.e. the glyph index is the same as the code
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/FoObj.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -2801,6 +2801,11 @@
return getPropertyList().traitStress(this, context);
}
+ /**
+ * Returns the raw, unresolved "script" property.
+ * @param context An object that knows how to resolve FO context issues.
+ * @return The raw, unresolved "script" property.
+ */
public String traitScriptRaw(final FoContext context) {
return getPropertyList().traitScript(this, context);
}
@@ -3690,6 +3695,7 @@
return WritingSystem4a.find(language, script, country);
}
+ @Override
public Orthography getOrthography() {
final OrthographyServer server = getOrthographyServer();
final WritingSystem writingSystem = getWritingSystem();
Modified: trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java
===================================================================
--- trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-fotree/src/main/java/org/foray/fotree/fo/obj/FoRefinedText4a.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -48,7 +48,7 @@
/** The text-transform. */
private TextTransform textTransform;
- /** The codepoint immediate before {@link #wrapped}. */
+ /** The codepoint immediately before {@link #wrapped}. */
private int codepointBefore;
/** The sorted list of indexes that are deleted. */
@@ -60,6 +60,15 @@
/** The new values for indexes that are changed. This is parallel with {@link #changed}. */
private CharSequence deltas;
+ /**
+ * Constructor.
+ * @param wrapped The wrapped raw text.
+ * @param linefeedTreatment The linefeed-treatment.
+ * @param textTransform The text-transform.
+ * @param whiteSpaceCollapse The white-space-collapse.
+ * @param codepointBefore The codepoint immediately before {@link #wrapped}.
+ * @param codepointAfter The codepoint immediately after {@link #wrapped}.
+ */
public FoRefinedText4a(final CharSequence wrapped, final LinefeedTreatment linefeedTreatment,
final TextTransform textTransform, final boolean whiteSpaceCollapse, final int codepointBefore,
final int codepointAfter) {
@@ -156,6 +165,7 @@
return builder;
}
+ @Override
public String toString() {
final StringBuilder builder = new StringBuilder();
for (int index = 0; index < length(); index ++) {
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfObjectReference.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfObjectReference.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/PdfObjectReference.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -51,11 +51,22 @@
/** The object's generation (0 in new documents). */
private int generation = 0;
+ /**
+ * Constructor.
+ * @param objectNumber The object number for this reference.
+ * @param generation The generation number for this reference.
+ */
public PdfObjectReference(final int objectNumber, final int generation) {
this.number = objectNumber;
this.generation = generation;
}
+ /**
+ * Constructor.
+ * @param objectNumber The object number for this reference.
+ * @param generation The generation number for this reference.
+ * @throws PdfException If either {@code objectNumber} or {@code generation} cannot be cast to {@link PdfInteger}.
+ */
public PdfObjectReference(final PdfObject objectNumber, final PdfObject generation) throws PdfException {
if (! (objectNumber instanceof PdfInteger)) {
throw new PdfException("Object Id value must be an integer, actual = " + objectNumber.toString());
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfDocument4a.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -729,6 +729,10 @@
throw new UnsupportedOperationException();
}
+ /**
+ * Returns the list of registered indirect objects.
+ * @return The list of registered indirect objects.
+ */
public List<PdfObject> getIndirectObjects() {
return this.indirectObjects;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfRoot.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfRoot.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/document/PdfRoot.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -214,6 +214,10 @@
return "Catalog";
}
+ /**
+ * Returns the pages.
+ * @return The pages.
+ */
public PdfPages getPages() {
return this.pages;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/encrypt/PdfEncryption4a.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -292,6 +292,9 @@
return encryptWithKey(data, key);
}
+ /**
+ * Initializes this encryption.
+ */
public void init() throws PdfException {
// Generate the owner value
final byte[] oValue;
@@ -368,8 +371,7 @@
public byte[] encryptData(final byte [] data, final int number,
final int generation) {
if (this.encryptionKey == null) {
- throw new IllegalStateException("PDF Encryption has not been "
- + "initialized");
+ throw new IllegalStateException("PDF Encryption has not been initialized");
}
final byte[] hash = new byte[this.encryptionKey.length
@@ -403,8 +405,7 @@
@Override
public ByteSequencePlus serialize(final PdfDocument4a doc) {
if (this.dictionary == null) {
- throw new IllegalStateException("PDF Encryption has not been "
- + "initialized");
+ throw new IllegalStateException("PDF Encryption has not been initialized");
}
return new ByteArray(this.dictionary);
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfDashPattern4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfDashPattern4a.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/graphics/PdfDashPattern4a.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -50,6 +50,11 @@
/** The dash phase. */
private float dashPhase;
+ /**
+ * Constructor.
+ * @param dashArray The dash array for this pattern.
+ * @param dashPhase The dash phase for this pattern.
+ */
public PdfDashPattern4a(final float[] dashArray, final float dashPhase) {
this.dashArray = new float[dashArray.length];
System.arraycopy(dashArray, 0, this.dashArray, 0, dashArray.length);
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationNamed4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationNamed4a.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interact/PdfDestinationNamed4a.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -47,6 +47,11 @@
/** The explicit destination to which this named destination is attached. */
private PdfDestinationExplicit4a explicitDestination;
+ /**
+ * Constructor.
+ * @param name The name of this destination.
+ * @param explicitDestination The explicit destination to which this named destination points.
+ */
public PdfDestinationNamed4a(final String name, final PdfDestinationExplicit4a explicitDestination) {
this.name = new PdfTextString(name);
this.explicitDestination = explicitDestination;
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interchange/PdfDocumentInfo4a.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interchange/PdfDocumentInfo4a.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/interchange/PdfDocumentInfo4a.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -197,6 +197,7 @@
return PdfDocumentTrapped.fromName(getString(PRODUCER_KEY));
}
+ @Override
public List<String> getOutputOrder() {
return OUTPUT_ORDER;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfHeader.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfHeader.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/serial/PdfHeader.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -56,11 +56,20 @@
* document may contain binary data. */
private ByteArray binaryComment;
+ /**
+ * Constructor.
+ * @param pdfVersion The PDF version for this header.
+ */
public PdfHeader(final PdfVersion pdfVersion) {
this.pdfVersion = pdfVersion;
this.binaryComment = DEFAULT_BINARY_COMMENT;
}
+
+ /**
+ * Returns the serialized value of this header.
+ * @return The serialized value.
+ */
public ByteArrayBuilder serialize() {
final ByteArrayBuilder builder = new ByteArrayBuilder();
// The PDF identifier comment.
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfTextString.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfTextString.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/structure/PdfTextString.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -204,6 +204,10 @@
return this.theSequence.length();
}
+ /**
+ * Returns the wrapped bytes.
+ * @return The wrapped bytes.
+ */
public ByteSequence getValue() {
return this.theSequence;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfArray.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfArray.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfArray.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -51,20 +51,36 @@
/** The contents of the array. */
private List<PdfObject> arrayContents = new ArrayList<PdfObject>();
+ /**
+ * Adds a {@link PdfObject} to this array.
+ * @param newElement The element to be added to this array.
+ */
public void addElement(final PdfObject newElement) {
this.arrayContents.add(newElement);
}
+ /**
+ * Converts a {@link Integer#TYPE} to a {@link PdfInteger}, and adds it to this array.
+ * @param anInteger The element to be added to this array.
+ */
public void addElement(final int anInteger) {
final PdfInteger newElement = new PdfInteger(anInteger);
addElement(newElement);
}
+ /**
+ * Converts a {@link BigDecimal} to a {@link PdfReal}, and adds it to this array.
+ * @param aReal The element to be added to this array.
+ */
public void addElement(final BigDecimal aReal) {
final PdfReal newElement = new PdfReal(aReal);
addElement(newElement);
}
+ /**
+ * Ensures that this array has a specified minimum size, adding null elements as needed.
+ * @param minimumSize The minimum size for this array.
+ */
public void ensureMinimumSize(final int minimumSize) {
while (this.arrayContents.size() < minimumSize) {
addElement((PdfObject) null);
@@ -105,10 +121,21 @@
this.arrayContents.set(index, object);
}
+ /**
+ * Returns the object at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ */
public PdfObject get(final int index) {
return this.arrayContents.get(index);
}
+ /**
+ * Returns the {@link PdfTextString} at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ * @throws IllegalArgumentException If the object at {@code index} is not an instance of {@link PdfTextString}.
+ */
public PdfTextString getPdfTextString(final int index) {
final PdfObject value = get(index);
if (value == null) {
@@ -126,6 +153,12 @@
return value == null ? null : value.toString();
}
+ /**
+ * Returns the {@link PdfHexString} at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ * @throws IllegalArgumentException If the object at {@code index} is not an instance of {@link PdfHexString}.
+ */
public PdfHexString getPdfHexString(final int index) {
final PdfObject value = get(index);
if (value == null) {
@@ -138,6 +171,12 @@
"Element for key \"{0}\" is of type {1}", index, value.getClass().getName()));
}
+ /**
+ * Returns the {@link PdfInteger} at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ * @throws IllegalArgumentException If the object at {@code index} is not an instance of {@link PdfInteger}.
+ */
public PdfInteger getPdfInteger(final int index) {
final PdfObject value = get(index);
if (value == null) {
@@ -155,6 +194,12 @@
return value == null ? null : value.getValue();
}
+ /**
+ * Returns the {@link PdfReal} at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ * @throws IllegalArgumentException If the object at {@code index} is not an instance of {@link PdfReal}.
+ */
public PdfReal getPdfReal(final int index) {
final PdfObject value = get(index);
if (value == null) {
@@ -172,6 +217,12 @@
return value == null ? null : value.getValue();
}
+ /**
+ * Returns the {@link PdfDate} at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ * @throws IllegalArgumentException If the object at {@code index} is not an instance of {@link PdfDate}.
+ */
public PdfDate getPdfDate(final int index) {
final PdfObject value = get(index);
if (value == null) {
@@ -189,6 +240,12 @@
return value == null ? null : value.getValue();
}
+ /**
+ * Returns the {@link PdfDictionary} at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ * @throws IllegalArgumentException If the object at {@code index} is not an instance of {@link PdfDictionary}.
+ */
public PdfDictionary getPdfDictionary(final int index) {
final PdfObject value = get(index);
if (value == null) {
@@ -201,6 +258,12 @@
"Element for key \"{0}\" is of type {1}", index, value.getClass().getName()));
}
+ /**
+ * Returns the {@link PdfName} at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ * @throws IllegalArgumentException If the object at {@code index} is not an instance of {@link PdfName}.
+ */
public PdfName getPdfName(final int index) {
final PdfObject value = get(index);
if (value == null) {
@@ -213,6 +276,12 @@
"Element for key \"{0}\" is of type {1}", index, value.getClass().getName()));
}
+ /**
+ * Returns the {@link PdfObjectReference} at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ * @throws IllegalArgumentException If the object at {@code index} is not an instance of {@link PdfObjectReference}.
+ */
public PdfObjectReference getPdfObjectReference(final int index) {
final PdfObject value = get(index);
if (value == null) {
@@ -225,6 +294,12 @@
"Element for key \"{0}\" is of type {1}", index, value.getClass().getName()));
}
+ /**
+ * Returns the {@link PdfArray} at a given index.
+ * @param index The index for which the element should be returned.
+ * @return The object at index {@code index}.
+ * @throws IllegalArgumentException If the object at {@code index} is not an instance of {@link PdfArray}.
+ */
public PdfArray getPdfArray(final int index) {
final PdfObject value = get(index);
if (value == null) {
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfBoolean.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfBoolean.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfBoolean.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -82,10 +82,18 @@
return null;
}
+ /**
+ * Returns the wrapped value.
+ * @return The wrapped value.
+ */
public boolean getValue() {
return this.value;
}
+ /**
+ * Returns the string representation of this.
+ * @return The string representation of this, either "true" or "false".
+ */
public ByteArray getTextValue() {
return this.textValue;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfDictionary.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfDictionary.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfDictionary.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -200,6 +200,12 @@
return this.entries.get(key);
}
+ /**
+ * Returns the {@link PdfTextString} for a given key.
+ * @param key The key for which the element should be returned.
+ * @return The value for key {@code key}, or null if {@code key} is not found in this dictionary.
+ * @throws IllegalArgumentException If the object at {@code key} is not an instance of {@link PdfTextString}.
+ */
public PdfTextString getPdfTextString(final String key) {
final PdfObject value = get(key);
if (value == null) {
@@ -217,6 +223,12 @@
return value == null ? null : value.toString();
}
+ /**
+ * Returns the {@link PdfHexString} for a given key.
+ * @param key The key for which the element should be returned.
+ * @return The value for key {@code key}, or null if {@code key} is not found in this dictionary.
+ * @throws IllegalArgumentException If the object at {@code key} is not an instance of {@link PdfHexString}.
+ */
public PdfHexString getPdfHexString(final String key) {
final PdfObject value = get(key);
if (value == null) {
@@ -229,6 +241,12 @@
"Element for key \"{0}\" is of type {1}", key, value.getClass().getName()));
}
+ /**
+ * Returns the {@link PdfInteger} for a given key.
+ * @param key The key for which the element should be returned.
+ * @return The value for key {@code key}, or null if {@code key} is not found in this dictionary.
+ * @throws IllegalArgumentException If the object at {@code key} is not an instance of {@link PdfInteger}.
+ */
public PdfInteger getPdfInteger(final String key) {
final PdfObject value = get(key);
if (value == null) {
@@ -246,6 +264,12 @@
return value == null ? null : value.getValue();
}
+ /**
+ * Returns the {@link PdfReal} for a given key.
+ * @param key The key for which the element should be returned.
+ * @return The value for key {@code key}, or null if {@code key} is not found in this dictionary.
+ * @throws IllegalArgumentException If the object at {@code key} is not an instance of {@link PdfReal}.
+ */
public PdfReal getPdfReal(final String key) {
final PdfObject value = get(key);
if (value == null) {
@@ -263,6 +287,12 @@
return value == null ? null : value.getValue();
}
+ /**
+ * Returns the {@link PdfDate} for a given key.
+ * @param key The key for which the element should be returned.
+ * @return The value for key {@code key}, or null if {@code key} is not found in this dictionary.
+ * @throws IllegalArgumentException If the object at {@code key} is not an instance of {@link PdfDate}.
+ */
public PdfDate getPdfDate(final String key) {
final PdfObject value = get(key);
if (value == null) {
@@ -280,6 +310,12 @@
return value == null ? null : value.getValue();
}
+ /**
+ * Returns the {@link PdfDictionary} for a given key.
+ * @param key The key for which the element should be returned.
+ * @return The value for key {@code key}, or null if {@code key} is not found in this dictionary.
+ * @throws IllegalArgumentException If the object at {@code key} is not an instance of {@link PdfDictionary}.
+ */
public PdfDictionary getPdfDictionary(final String key) {
final PdfObject value = get(key);
if (value == null) {
@@ -292,6 +328,12 @@
"Element for key \"{0}\" is of type {1}", key, value.getClass().getName()));
}
+ /**
+ * Returns the {@link PdfName} for a given key.
+ * @param key The key for which the element should be returned.
+ * @return The value for key {@code key}, or null if {@code key} is not found in this dictionary.
+ * @throws IllegalArgumentException If the object at {@code key} is not an instance of {@link PdfName}.
+ */
public PdfName getPdfName(final String key) {
final PdfObject value = get(key);
if (value == null) {
@@ -304,6 +346,12 @@
"Element for key \"{0}\" is of type {1}", key, value.getClass().getName()));
}
+ /**
+ * Returns the {@link PdfObjectReference} for a given key.
+ * @param key The key for which the element should be returned.
+ * @return The value for key {@code key}, or null if {@code key} is not found in this dictionary.
+ * @throws IllegalArgumentException If the object at {@code key} is not an instance of {@link PdfObjectReference}.
+ */
public PdfObjectReference getPdfObjectReference(final String key) {
final PdfObject value = get(key);
if (value == null) {
@@ -316,6 +364,12 @@
"Element for key \"{0}\" is of type {1}", key, value.getClass().getName()));
}
+ /**
+ * Returns the {@link PdfArray} for a given key.
+ * @param key The key for which the element should be returned.
+ * @return The value for key {@code key}, or null if {@code key} is not found in this dictionary.
+ * @throws IllegalArgumentException If the object at {@code key} is not an instance of {@link PdfArray}.
+ */
public PdfArray getPdfArray(final String key) {
final PdfObject value = get(key);
if (value == null) {
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfHexString.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfHexString.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfHexString.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -44,6 +44,10 @@
/** The parsed hex string bytes. */
private ByteArray value;
+ /**
+ * Constructor.
+ * @param value The bytes to be encapsulated.
+ */
public PdfHexString(final ByteArray value) {
this.value = value;
}
@@ -57,6 +61,10 @@
return new ByteArray(builder);
}
+ /**
+ * Returns the encapsulated bytes.
+ * @return The encapsulated bytes.
+ */
public ByteArray getValue() {
return this.value;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfInteger.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfInteger.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfInteger.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -42,10 +42,18 @@
/** The integer value. */
private int value;
+ /**
+ * Constructor.
+ * @param value The integer to be encapsulated.
+ */
public PdfInteger(final int value) {
this.value = value;
}
+ /**
+ * Returns the encapsulated integer.
+ * @return The encapsulated integer.
+ */
public int getValue() {
return this.value;
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfObject.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfObject.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfObject.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -84,7 +84,13 @@
return pdf.length();
}
+ /**
+ * Sets the indirect object reference for this object, marking it as an indirect object.
+ * @param reference The indirect object reference for this object.
+ * @throws IllegalStateException If this object already has an indirect object reference.
+ */
public void registerIndirectReference(final PdfObjectReference reference) {
+ /* TODO: Try to restrict the use of this method to only {@link PdfDocument4a}. */
if (this.reference != null) {
throw new IllegalStateException("Indirect reference already set.");
}
Modified: trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfReal.java
===================================================================
--- trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfReal.java 2022-01-31 15:43:41 UTC (rev 12514)
+++ trunk/foray/foray-pdf/src/main/java/org/foray/pdf/type/PdfReal.java 2022-01-31 17:33:15 UTC (rev 12515)
@@ -46,6 +46,10 @@
/** The numeric value. */
private BigDecimal value;
+ /**
+ * Constructor.
+ * @param value The real number to be encapsulated.
+ */
public PdfReal(final BigDecimal value) {
this.value = value;
}
@@ -55,6 +59,10 @@
return new ByteArray(this.value.toPlainString());
}
+ /**
+ * Returns the encapsulated real number.
+ * @return The encapsulated real number.
+ */
public BigDecimal getValue() {
return this.value;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|