Skip to content

Commit a954483

Browse files
committed
Fix all JavaDoc warnings
1 parent cea7d4e commit a954483

9 files changed

+102
-16
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<groupId>com.googlecode.plist</groupId>
99
<artifactId>dd-plist</artifactId>
1010
<packaging>jar</packaging>
11-
<version>1.15</version>
11+
<version>1.16</version>
1212
<name>dd-plist</name>
1313
<url>http://plist.googlecode.com</url>
1414
<description>

src/main/java/com/dd/plist/Base64.java

+1
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,7 @@ else if (source[srcOffset + 3] == EQUALS_SIGN) {
11611161
* @param source The Base64 encoded data
11621162
* @return decoded data
11631163
* @since 2.3.1
1164+
* @throws java.io.IOException If bogus characters are contained in the input
11641165
*/
11651166
public static byte[] decode(byte[] source)
11661167
throws java.io.IOException {

src/main/java/com/dd/plist/BinaryPropertyListParser.java

+9-7
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323

2424
package com.dd.plist;
2525

26-
import java.io.File;
27-
import java.io.FileInputStream;
28-
import java.io.IOException;
29-
import java.io.InputStream;
26+
import java.io.*;
3027
import java.math.BigInteger;
3128

3229
/**
@@ -83,8 +80,9 @@ protected BinaryPropertyListParser() {
8380
* @param data The binary property list's data.
8481
* @return The root object of the property list. This is usually a NSDictionary but can also be a NSArray.
8582
* @throws PropertyListFormatException When the property list's format could not be parsed.
83+
* @throws java.io.UnsupportedEncodingException When a NSString object could not be decoded.
8684
*/
87-
public static NSObject parse(byte[] data) throws IOException, PropertyListFormatException {
85+
public static NSObject parse(byte[] data) throws PropertyListFormatException, UnsupportedEncodingException {
8886
BinaryPropertyListParser parser = new BinaryPropertyListParser();
8987
return parser.doParse(data);
9088
}
@@ -95,8 +93,9 @@ public static NSObject parse(byte[] data) throws IOException, PropertyListFormat
9593
* @param data The binary property list's data.
9694
* @return The root object of the property list. This is usually a NSDictionary but can also be a NSArray.
9795
* @throws PropertyListFormatException When the property list's format could not be parsed.
96+
* @throws java.io.UnsupportedEncodingException When a NSString object could not be decoded.
9897
*/
99-
private NSObject doParse(byte[] data) throws IOException, PropertyListFormatException {
98+
private NSObject doParse(byte[] data) throws PropertyListFormatException, UnsupportedEncodingException {
10099
bytes = data;
101100
String magic = new String(copyOfRange(bytes, 0, 8));
102101
if (!magic.startsWith("bplist")) {
@@ -149,6 +148,7 @@ private NSObject doParse(byte[] data) throws IOException, PropertyListFormatExce
149148
* @param is The input stream that points to the property list's data.
150149
* @return The root object of the property list. This is usually a NSDictionary but can also be a NSArray.
151150
* @throws PropertyListFormatException When the property list's format could not be parsed.
151+
* @throws java.io.IOException When a NSString object could not be decoded or an InputStream IO error occurs.
152152
*/
153153
public static NSObject parse(InputStream is) throws IOException, PropertyListFormatException {
154154
byte[] buf = PropertyListParser.readAll(is);
@@ -161,6 +161,7 @@ public static NSObject parse(InputStream is) throws IOException, PropertyListFor
161161
* @param f The binary property list file
162162
* @return The root object of the property list. This is usually a NSDictionary but can also be a NSArray.
163163
* @throws PropertyListFormatException When the property list's format could not be parsed.
164+
* @throws java.io.UnsupportedEncodingException When a NSString object could not be decoded or a file IO error occurs.
164165
*/
165166
public static NSObject parse(File f) throws IOException, PropertyListFormatException {
166167
return parse(new FileInputStream(f));
@@ -175,8 +176,9 @@ public static NSObject parse(File f) throws IOException, PropertyListFormatExcep
175176
* @param obj The object ID.
176177
* @return The parsed object.
177178
* @throws PropertyListFormatException When the property list's format could not be parsed.
179+
* @throws java.io.UnsupportedEncodingException When a NSString object could not be decoded.
178180
*/
179-
private NSObject parseObject(int obj) throws IOException, PropertyListFormatException {
181+
private NSObject parseObject(int obj) throws PropertyListFormatException, UnsupportedEncodingException {
180182
int offset = offsetTable[obj];
181183
byte type = bytes[offset];
182184
int objType = (type & 0xF0) >> 4; //First 4 bits

src/main/java/com/dd/plist/BinaryPropertyListWriter.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ private static int getMinimumRequiredVersion(NSObject root) {
9191
*
9292
* @param file the file to write to
9393
* @param root the source of the data to write to the file
94-
* @throws IOException
94+
* @throws IOException When an IO error occurs while writing to the file or the object structure contains
95+
* data that cannot be saved.
9596
*/
9697
public static void write(File file, NSObject root) throws IOException {
9798
OutputStream out = new FileOutputStream(file);
@@ -104,7 +105,8 @@ public static void write(File file, NSObject root) throws IOException {
104105
*
105106
* @param out the stream to write to
106107
* @param root the source of the data to write to the stream
107-
* @throws IOException
108+
* @throws IOException When an IO error occurs while writing to the stream or the object structure contains
109+
* data that cannot be saved.
108110
*/
109111
public static void write(OutputStream out, NSObject root) throws IOException {
110112
int minVersion = getMinimumRequiredVersion(root);
@@ -123,7 +125,8 @@ public static void write(OutputStream out, NSObject root) throws IOException {
123125
*
124126
* @param root The root object of the property list
125127
* @return The byte array containing the serialized property list
126-
* @throws IOException
128+
* @throws IOException When an IO error occurs while writing to the stream or the object structure contains
129+
* data that cannot be saved.
127130
*/
128131
public static byte[] writeToArray(NSObject root) throws IOException {
129132
ByteArrayOutputStream bout = new ByteArrayOutputStream();
@@ -147,7 +150,8 @@ public static byte[] writeToArray(NSObject root) throws IOException {
147150
* Creates a new binary property list writer
148151
*
149152
* @param outStr The output stream into which the binary property list will be written
150-
* @throws IOException If an error occured while writing to the stream
153+
* @throws IOException When an IO error occurs while writing to the stream or the object structure contains
154+
* data that cannot be saved.
151155
*/
152156
BinaryPropertyListWriter(OutputStream outStr) throws IOException {
153157
out = new BufferedOutputStream(outStr);

src/main/java/com/dd/plist/NSObject.java

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ void assignIDs(BinaryPropertyListWriter out) {
7777
* Generates the binary representation of the object.
7878
*
7979
* @param out The output stream to serialize the object to.
80+
* @throws java.io.IOException When an IO error occurs while writing to the stream or the object structure contains
81+
* data that cannot be saved.
8082
*/
8183
abstract void toBinary(BinaryPropertyListWriter out) throws IOException;
8284

src/main/java/com/dd/plist/NSSet.java

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public NSSet(NSObject... objects) {
7878
/**
7979
* Create a set and fill it with the given objects.
8080
*
81+
* @param ordered Indicates whether the created set should be ordered or unordered.
8182
* @param objects The objects to populate the set.
8283
* @see java.util.LinkedHashSet
8384
* @see java.util.TreeSet

src/main/java/com/dd/plist/NSString.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public class NSString extends NSObject implements Comparable<Object> {
4343
*
4444
* @param bytes The binary representation.
4545
* @param encoding The encoding of the binary representation, the name of a supported charset.
46-
* @throws UnsupportedEncodingException
47-
* @see java.lang.String
46+
* @throws UnsupportedEncodingException When the given encoding is not supported by the JRE.
47+
* @see java.lang.String#String(byte[], String)
4848
*/
4949
public NSString(byte[] bytes, String encoding) throws UnsupportedEncodingException {
5050
content = new String(bytes, encoding);

src/main/java/com/dd/plist/PropertyListParser.java

+51
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ private static int determineType(InputStream is) throws IOException {
133133
* a maximum count.
134134
*
135135
* @param in The InputStream pointing to the data that should be stored in the array.
136+
* @return An array containing all bytes that were read from the input stream.
137+
* @throws java.io.IOException When an IO error while reading from the input stream.
136138
*/
137139
protected static byte[] readAll(InputStream in) throws IOException {
138140
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -151,6 +153,12 @@ protected static byte[] readAll(InputStream in) throws IOException {
151153
*
152154
* @param filePath Path to the property list file.
153155
* @return The root object in the property list. This is usually a NSDictionary but can also be a NSArray.
156+
* @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
157+
* could not be created. This should not occur.
158+
* @throws java.io.IOException If any IO error occurs while reading the file.
159+
* @throws org.xml.sax.SAXException If any parse error occurs.
160+
* @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
161+
* @throws java.text.ParseException If a date string could not be parsed.
154162
*/
155163
public static NSObject parse(String filePath) throws ParserConfigurationException, ParseException, SAXException, PropertyListFormatException, IOException {
156164
return parse(new File(filePath));
@@ -161,6 +169,12 @@ public static NSObject parse(String filePath) throws ParserConfigurationExceptio
161169
*
162170
* @param f The property list file.
163171
* @return The root object in the property list. This is usually a NSDictionary but can also be a NSArray.
172+
* @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
173+
* could not be created. This should not occur.
174+
* @throws java.io.IOException If any IO error occurs while reading the file.
175+
* @throws org.xml.sax.SAXException If any parse error occurs.
176+
* @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
177+
* @throws java.text.ParseException If a date string could not be parsed.
164178
*/
165179
public static NSObject parse(File f) throws IOException, PropertyListFormatException, ParseException, ParserConfigurationException, SAXException {
166180
FileInputStream fis = new FileInputStream(f);
@@ -183,6 +197,12 @@ public static NSObject parse(File f) throws IOException, PropertyListFormatExcep
183197
*
184198
* @param bytes The property list data as a byte array.
185199
* @return The root object in the property list. This is usually a NSDictionary but can also be a NSArray.
200+
* @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
201+
* could not be created. This should not occur.
202+
* @throws java.io.IOException If any IO error occurs while reading the byte array.
203+
* @throws org.xml.sax.SAXException If any parse error occurs.
204+
* @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
205+
* @throws java.text.ParseException If a date string could not be parsed.
186206
*/
187207
public static NSObject parse(byte[] bytes) throws IOException, PropertyListFormatException, ParseException, ParserConfigurationException, SAXException {
188208
switch(determineType(bytes)) {
@@ -202,6 +222,12 @@ public static NSObject parse(byte[] bytes) throws IOException, PropertyListForma
202222
*
203223
* @param is The InputStream delivering the property list data.
204224
* @return The root object of the property list. This is usually a NSDictionary but can also be a NSArray.
225+
* @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
226+
* could not be created. This should not occur.
227+
* @throws java.io.IOException If any IO error occurs while reading the input stream.
228+
* @throws org.xml.sax.SAXException If any parse error occurs.
229+
* @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
230+
* @throws java.text.ParseException If a date string could not be parsed.
205231
*/
206232
public static NSObject parse(InputStream is) throws IOException, PropertyListFormatException, ParseException, ParserConfigurationException, SAXException {
207233
return parse(readAll(is));
@@ -242,6 +268,13 @@ public static void saveAsXML(NSObject root, OutputStream out) throws IOException
242268
*
243269
* @param in The source file.
244270
* @param out The target file.
271+
*
272+
* @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
273+
* could not be created. This should not occur.
274+
* @throws java.io.IOException If any IO error occurs while reading the input file or writing the output file.
275+
* @throws org.xml.sax.SAXException If any parse error occurs.
276+
* @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
277+
* @throws java.text.ParseException If a date string could not be parsed.
245278
*/
246279
public static void convertToXml(File in, File out) throws ParserConfigurationException, ParseException, SAXException, PropertyListFormatException, IOException {
247280
NSObject root = parse(in);
@@ -279,6 +312,12 @@ public static void saveAsBinary(NSObject root, OutputStream out) throws IOExcept
279312
*
280313
* @param in The source file.
281314
* @param out The target file.
315+
* @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
316+
* could not be created. This should not occur.
317+
* @throws java.io.IOException If any IO error occurs while reading the input file or writing the output file.
318+
* @throws org.xml.sax.SAXException If any parse error occurs.
319+
* @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
320+
* @throws java.text.ParseException If a date string could not be parsed.
282321
*/
283322
public static void convertToBinary(File in, File out) throws IOException, ParserConfigurationException, ParseException, SAXException, PropertyListFormatException {
284323
NSObject root = parse(in);
@@ -320,6 +359,12 @@ public static void saveAsASCII(NSArray root, File out) throws IOException {
320359
*
321360
* @param in The source file.
322361
* @param out The target file.
362+
* @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
363+
* could not be created. This should not occur.
364+
* @throws java.io.IOException If any IO error occurs while reading the input file or writing the output file.
365+
* @throws org.xml.sax.SAXException If any parse error occurs.
366+
* @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
367+
* @throws java.text.ParseException If a date string could not be parsed.
323368
*/
324369
public static void convertToASCII(File in, File out) throws ParserConfigurationException, ParseException, SAXException, PropertyListFormatException, IOException {
325370
NSObject root = parse(in);
@@ -374,6 +419,12 @@ public static void saveAsGnuStepASCII(NSArray root, File out) throws IOException
374419
*
375420
* @param in The source file.
376421
* @param out The target file.
422+
* @throws javax.xml.parsers.ParserConfigurationException If a document builder for parsing a XML property list
423+
* could not be created. This should not occur.
424+
* @throws java.io.IOException If any IO error occurs while reading the input file or writing the output file.
425+
* @throws org.xml.sax.SAXException If any parse error occurs.
426+
* @throws com.dd.plist.PropertyListFormatException If the given property list has an invalid format.
427+
* @throws java.text.ParseException If a date string could not be parsed.
377428
*/
378429
public static void convertToGnuStepASCII(File in, File out) throws ParserConfigurationException, ParseException, SAXException, PropertyListFormatException, IOException {
379430
NSObject root = parse(in);

0 commit comments

Comments
 (0)