-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add location information to parsed objects and exceptions (#95)
* Store object locations when parsing and provide location of error in exceptions, where available * Add line number tracking to ASCII plist parsing * Add line information to ASCIIPropertyListParser exceptions * Add parse method overloads to store XML line information when parsing * Restructure unit tests * Remove old ant script
- Loading branch information
Showing
27 changed files
with
2,361 additions
and
1,347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.dd.plist; | ||
|
||
/** | ||
* Information about the location of an NSObject within an ASCII property list file. | ||
* @author Daniel Dreibrodt | ||
*/ | ||
public class ASCIILocationInformation extends LocationInformation { | ||
private final int offset; | ||
private final int lineNo; | ||
private final int column; | ||
|
||
ASCIILocationInformation(int offset, int lineNo, int column) { | ||
this.offset = offset; | ||
this.lineNo = lineNo; | ||
this.column = column; | ||
} | ||
|
||
/** | ||
* Gets the offset of the NSObject inside the file. | ||
* @return The offset of the NSObject. | ||
*/ | ||
public int getOffset() { | ||
return this.offset; | ||
} | ||
|
||
/** | ||
* Gets the line number. | ||
* @return The line number, starting at 1. | ||
*/ | ||
public int getLineNumber() { | ||
return this.lineNo; | ||
} | ||
|
||
/** | ||
* Gets the column number. | ||
* @return The column, starting at 1. | ||
*/ | ||
public int getColumnNumber() { | ||
return this.column; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Line: " + this.lineNo + ", Column: " + this.column + ", Offset: " + this.offset; | ||
} | ||
} |
Oops, something went wrong.