You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2016/12/30 09:23:26 UTC
svn commit: r1776531 [3/4] - in /sis/branches/JDK8:
application/sis-console/src/main/java/org/apache/sis/console/
core/sis-feature/src/main/java/org/apache/sis/feature/
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/
core/sis-metadata...
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -116,16 +116,6 @@ public final class Errors extends Indexe
public static final short CanNotParseFile_2 = 9;
/**
- * Can not parse line {2} of \u201c{1}\u201d as part of a file in the {0} format.
- */
- public static final short CanNotParseFile_3 = 168;
-
- /**
- * Can not parse line {2} (after column {3}) of \u201c{1}\u201d as part of a file in the {0} format.
- */
- public static final short CanNotParseFile_4 = 169;
-
- /**
* Can not read property \u201c{1}\u201d in file \u201c{0}\u201d.
*/
public static final short CanNotReadPropertyInFile_2 = 10;
@@ -158,32 +148,22 @@ public final class Errors extends Indexe
/**
* Can not write \u201c{1}\u201d as a file in the {0} format.
*/
- public static final short CanNotWriteFile_2 = 171;
+ public static final short CanNotWriteFile_2 = 16;
/**
* Circular reference.
*/
- public static final short CircularReference = 16;
+ public static final short CircularReference = 17;
/**
* Class \u2018{0}\u2019 is not final.
*/
- public static final short ClassNotFinal_1 = 17;
+ public static final short ClassNotFinal_1 = 18;
/**
* Can not clone an object of type \u2018{0}\u2019.
*/
- public static final short CloneNotSupported_1 = 18;
-
- /**
- * This {0} reader is closed.
- */
- public static final short ClosedReader_1 = 19;
-
- /**
- * This {0} writer is closed.
- */
- public static final short ClosedWriter_1 = 166;
+ public static final short CloneNotSupported_1 = 19;
/**
* Database error while creating a \u2018{0}\u2019 object for the \u201c{1}\u201d identifier.
@@ -353,70 +333,60 @@ public final class Errors extends Indexe
public static final short IllegalIdentifierForCodespace_2 = 52;
/**
- * The {0} reader does not accept inputs of type \u2018{1}\u2019.
- */
- public static final short IllegalInputTypeForReader_2 = 53;
-
- /**
* The \u201c{0}\u201d language is not recognized.
*/
- public static final short IllegalLanguageCode_1 = 54;
+ public static final short IllegalLanguageCode_1 = 53;
/**
* Member \u201c{0}\u201d can not be associated to type \u201c{1}\u201d.
*/
- public static final short IllegalMemberType_2 = 55;
+ public static final short IllegalMemberType_2 = 54;
/**
* Option \u2018{0}\u2019 can not take the \u201c{1}\u201d value.
*/
- public static final short IllegalOptionValue_2 = 56;
+ public static final short IllegalOptionValue_2 = 55;
/**
* The [{0} \u2026 {1}] range of ordinate values is not valid for the \u201c{2}\u201d axis.
*/
- public static final short IllegalOrdinateRange_3 = 57;
-
- /**
- * The {0} writer does not accept outputs of type \u2018{1}\u2019.
- */
- public static final short IllegalOutputTypeForWriter_2 = 165;
+ public static final short IllegalOrdinateRange_3 = 56;
/**
* Property \u201c{0}\u201d does not accept instances of \u2018{1}\u2019.
*/
- public static final short IllegalPropertyValueClass_2 = 58;
+ public static final short IllegalPropertyValueClass_2 = 57;
/**
* Expected an instance of \u2018{1}\u2019 for the \u201c{0}\u201d property, but got an instance of \u2018{2}\u2019.
*/
- public static final short IllegalPropertyValueClass_3 = 59;
+ public static final short IllegalPropertyValueClass_3 = 58;
/**
* Range [{0} \u2026 {1}] is not valid.
*/
- public static final short IllegalRange_2 = 60;
+ public static final short IllegalRange_2 = 59;
/**
* Value {1} for \u201c{0}\u201d is not a valid Unicode code point.
*/
- public static final short IllegalUnicodeCodePoint_2 = 61;
+ public static final short IllegalUnicodeCodePoint_2 = 60;
/**
* Can not use the \u201c{1}\u201d format with \u201c{0}\u201d.
*/
- public static final short IncompatibleFormat_2 = 62;
+ public static final short IncompatibleFormat_2 = 61;
/**
* Property \u201c{0}\u201d has an incompatible value.
*/
- public static final short IncompatiblePropertyValue_1 = 63;
+ public static final short IncompatiblePropertyValue_1 = 62;
/**
* The \u201c{0}\u201d unit of measurement has dimension of \u2018{1}\u2019 ({2}). It is incompatible with
* dimension of \u2018{3}\u2019 ({4}).
*/
- public static final short IncompatibleUnitDimension_5 = 163;
+ public static final short IncompatibleUnitDimension_5 = 63;
/**
* Unit \u201c{0}\u201d is incompatible with current value.
@@ -527,408 +497,408 @@ public final class Errors extends Indexe
/**
* JAXB context has not been specified.
*/
- public static final short MissingJAXBContext = 170;
+ public static final short MissingJAXBContext = 85;
/**
* This operation requires the \u201c{0}\u201d module.
*/
- public static final short MissingRequiredModule_1 = 85;
+ public static final short MissingRequiredModule_1 = 86;
/**
* Missing value for \u201c{0}\u201d option.
*/
- public static final short MissingValueForOption_1 = 86;
+ public static final short MissingValueForOption_1 = 87;
/**
* Missing value for \u201c{0}\u201d property.
*/
- public static final short MissingValueForProperty_1 = 87;
+ public static final short MissingValueForProperty_1 = 88;
/**
* Missing value in the \u201c{0}\u201d column.
*/
- public static final short MissingValueInColumn_1 = 88;
+ public static final short MissingValueInColumn_1 = 89;
/**
* Options \u201c{0}\u201d and \u201c{1}\u201d are mutually exclusive.
*/
- public static final short MutuallyExclusiveOptions_2 = 89;
+ public static final short MutuallyExclusiveOptions_2 = 90;
/**
* Argument \u2018{0}\u2019 shall not be negative. The given value was {1}.
*/
- public static final short NegativeArgument_2 = 90;
+ public static final short NegativeArgument_2 = 91;
/**
* Can not create a \u201c{0}\u201d array of negative length.
*/
- public static final short NegativeArrayLength_1 = 91;
+ public static final short NegativeArrayLength_1 = 92;
/**
* Nested \u201c{0}\u201d elements are not allowed.
*/
- public static final short NestedElementNotAllowed_1 = 167;
+ public static final short NestedElementNotAllowed_1 = 93;
/**
* No value is associated to \u201c{0}\u201d.
*/
- public static final short NoSuchValue_1 = 92;
+ public static final short NoSuchValue_1 = 94;
/**
* Node \u201c{0}\u201d can not be a child of itself.
*/
- public static final short NodeChildOfItself_1 = 93;
+ public static final short NodeChildOfItself_1 = 95;
/**
* Node \u201c{0}\u201d already has another parent.
*/
- public static final short NodeHasAnotherParent_1 = 94;
+ public static final short NodeHasAnotherParent_1 = 96;
/**
* Node \u201c{0}\u201d has no parent.
*/
- public static final short NodeHasNoParent_1 = 95;
+ public static final short NodeHasNoParent_1 = 97;
/**
* Node \u201c{0}\u201d is a leaf.
*/
- public static final short NodeIsLeaf_1 = 96;
+ public static final short NodeIsLeaf_1 = 98;
/**
* \u201c{0}\u201d is not an angular unit.
*/
- public static final short NonAngularUnit_1 = 97;
+ public static final short NonAngularUnit_1 = 99;
/**
* Missing a \u2018{1}\u2019 parenthesis in \u201c{0}\u201d.
*/
- public static final short NonEquilibratedParenthesis_2 = 98;
+ public static final short NonEquilibratedParenthesis_2 = 100;
/**
* Conversion is not invertible.
*/
- public static final short NonInvertibleConversion = 99;
+ public static final short NonInvertibleConversion = 101;
/**
* \u201c{0}\u201d is not a linear unit.
*/
- public static final short NonLinearUnit_1 = 100;
+ public static final short NonLinearUnit_1 = 102;
/**
* The scale of measurement for \u201c{0}\u201d unit is not a ratio scale.
*/
- public static final short NonRatioUnit_1 = 162;
+ public static final short NonRatioUnit_1 = 103;
/**
* \u201c{0}\u201d is not a scale unit.
*/
- public static final short NonScaleUnit_1 = 101;
+ public static final short NonScaleUnit_1 = 104;
/**
* \u201c{0}\u201d is not a fundamental or derived unit.
*/
- public static final short NonSystemUnit_1 = 161;
+ public static final short NonSystemUnit_1 = 105;
/**
* \u201c{0}\u201d is not a time unit.
*/
- public static final short NonTemporalUnit_1 = 102;
+ public static final short NonTemporalUnit_1 = 106;
/**
* No element for the \u201c{0}\u201d identifier, or the identifier is a forward reference.
*/
- public static final short NotABackwardReference_1 = 103;
+ public static final short NotABackwardReference_1 = 107;
/**
* \u201c{0}\u201d is not a key-value pair.
*/
- public static final short NotAKeyValuePair_1 = 104;
+ public static final short NotAKeyValuePair_1 = 108;
/**
* Argument \u2018{0}\u2019 shall not be NaN (Not-a-Number).
*/
- public static final short NotANumber_1 = 105;
+ public static final short NotANumber_1 = 109;
/**
* Class \u2018{0}\u2019 is not a primitive type wrapper.
*/
- public static final short NotAPrimitiveWrapper_1 = 106;
+ public static final short NotAPrimitiveWrapper_1 = 110;
/**
* Text \u201c{0}\u201d is not a Unicode identifier.
*/
- public static final short NotAUnicodeIdentifier_1 = 107;
+ public static final short NotAUnicodeIdentifier_1 = 111;
/**
* Argument \u2018{0}\u2019 shall not be null.
*/
- public static final short NullArgument_1 = 108;
+ public static final short NullArgument_1 = 112;
/**
* \u2018{0}\u2019 collection does not accept null elements.
*/
- public static final short NullCollectionElement_1 = 109;
+ public static final short NullCollectionElement_1 = 113;
/**
* Null key is not allowed in this dictionary.
*/
- public static final short NullMapKey = 110;
+ public static final short NullMapKey = 114;
/**
* Null values are not allowed in this dictionary.
*/
- public static final short NullMapValue = 111;
+ public static final short NullMapValue = 115;
/**
* Unexpected null value in record \u201c{2}\u201d for the column \u201c{1}\u201d in table \u201c{0}\u201d.
*/
- public static final short NullValueInTable_3 = 112;
+ public static final short NullValueInTable_3 = 116;
/**
* Array length is {0}, while we expected an even length.
*/
- public static final short OddArrayLength_1 = 113;
+ public static final short OddArrayLength_1 = 117;
/**
* Coordinate is outside the domain of validity.
*/
- public static final short OutsideDomainOfValidity = 114;
+ public static final short OutsideDomainOfValidity = 118;
/**
* No property named \u201c{1}\u201d has been found in \u201c{0}\u201d.
*/
- public static final short PropertyNotFound_2 = 115;
+ public static final short PropertyNotFound_2 = 119;
/**
* Record \u201c{1}\u201d is already defined in schema \u201c{0}\u201d.
*/
- public static final short RecordAlreadyDefined_2 = 116;
+ public static final short RecordAlreadyDefined_2 = 120;
/**
* No record found in \u201c{0}\u201d table for \u201c{1}\u201d key.
*/
- public static final short RecordNotFound_2 = 164;
+ public static final short RecordNotFound_2 = 121;
/**
* Recursive call while creating an object for the \u201c{0}\u201d key.
*/
- public static final short RecursiveCreateCallForKey_1 = 117;
+ public static final short RecursiveCreateCallForKey_1 = 122;
/**
* A decimal separator is required.
*/
- public static final short RequireDecimalSeparator = 118;
+ public static final short RequireDecimalSeparator = 123;
/**
* Thread \u201c{0}\u201d seems stalled.
*/
- public static final short StalledThread_1 = 119;
+ public static final short StalledThread_1 = 124;
/**
* Table \u201c{0}\u201d has not been found.
*/
- public static final short TableNotFound_1 = 120;
+ public static final short TableNotFound_1 = 125;
/**
* Expected at least {0} argument{0,choice,1#|2#s}, but got {1}.
*/
- public static final short TooFewArguments_2 = 121;
+ public static final short TooFewArguments_2 = 126;
/**
* Too few occurrences of \u201c{1}\u201d. Expected at least {0} of them.
*/
- public static final short TooFewOccurrences_2 = 122;
+ public static final short TooFewOccurrences_2 = 127;
/**
* Expected at most {0} argument{0,choice,1#|2#s}, but got {1}.
*/
- public static final short TooManyArguments_2 = 123;
+ public static final short TooManyArguments_2 = 128;
/**
* Too many occurrences of \u201c{1}\u201d. The maximum is {0}.
*/
- public static final short TooManyOccurrences_2 = 124;
+ public static final short TooManyOccurrences_2 = 129;
/**
* Tree depth exceeds the maximum.
*/
- public static final short TreeDepthExceedsMaximum = 125;
+ public static final short TreeDepthExceedsMaximum = 130;
/**
* Ordering between \u201c{0}\u201d and \u201c{1}\u201d elements is undefined.
*/
- public static final short UndefinedOrderingForElements_2 = 126;
+ public static final short UndefinedOrderingForElements_2 = 131;
/**
* Expected an array of length {0}, but got {1}.
*/
- public static final short UnexpectedArrayLength_2 = 127;
+ public static final short UnexpectedArrayLength_2 = 132;
/**
* Unexpected change in \u2018{0}\u2019.
*/
- public static final short UnexpectedChange_1 = 128;
+ public static final short UnexpectedChange_1 = 133;
/**
* The \u201c{1}\u201d characters after \u201c{0}\u201d were unexpected.
*/
- public static final short UnexpectedCharactersAfter_2 = 129;
+ public static final short UnexpectedCharactersAfter_2 = 134;
/**
* Text for \u2018{0}\u2019 was expected to {1,choice,0#begin|1#end} with \u201c{2}\u201d, but found \u201c{3}\u201d.
*/
- public static final short UnexpectedCharactersAtBound_4 = 130;
+ public static final short UnexpectedCharactersAtBound_4 = 135;
/**
* Unexpected end of file while reading \u201c{0}\u201d.
*/
- public static final short UnexpectedEndOfFile_1 = 131;
+ public static final short UnexpectedEndOfFile_1 = 136;
/**
* More characters were expected at the end of \u201c{0}\u201d.
*/
- public static final short UnexpectedEndOfString_1 = 132;
+ public static final short UnexpectedEndOfString_1 = 137;
/**
* File \u201c{1}\u201d seems to be encoded in an other format than {0}.
*/
- public static final short UnexpectedFileFormat_2 = 133;
+ public static final short UnexpectedFileFormat_2 = 138;
/**
* Parameter \u201c{0}\u201d was not expected.
*/
- public static final short UnexpectedParameter_1 = 134;
+ public static final short UnexpectedParameter_1 = 139;
/**
* Property \u201c{1}\u201d was not expected in \u201c{0}\u201d.
*/
- public static final short UnexpectedProperty_2 = 135;
+ public static final short UnexpectedProperty_2 = 140;
/**
* Unexpected scale factor {1} for unit of measurement \u201c{0}\u201d.
*/
- public static final short UnexpectedScaleFactorForUnit_2 = 136;
+ public static final short UnexpectedScaleFactorForUnit_2 = 141;
/**
* Expected \u201c{0}\u201d to reference an instance of \u2018{1}\u2019, but found an instance of \u2018{2}\u2019.
*/
- public static final short UnexpectedTypeForReference_3 = 137;
+ public static final short UnexpectedTypeForReference_3 = 142;
/**
* Unexpected value \u201c{1}\u201d in \u201c{0}\u201d element.
*/
- public static final short UnexpectedValueInElement_2 = 138;
+ public static final short UnexpectedValueInElement_2 = 143;
/**
* Command \u201c{0}\u201d is not recognized.
*/
- public static final short UnknownCommand_1 = 139;
+ public static final short UnknownCommand_1 = 144;
/**
* \u201c{1}\u201d is not a known or supported value for the \u2018{0}\u2019 enumeration.
*/
- public static final short UnknownEnumValue_2 = 140;
+ public static final short UnknownEnumValue_2 = 145;
/**
* Keyword \u201c{0}\u201d is unknown.
*/
- public static final short UnknownKeyword_1 = 141;
+ public static final short UnknownKeyword_1 = 146;
/**
* Option \u201c{0}\u201d is not recognized.
*/
- public static final short UnknownOption_1 = 142;
+ public static final short UnknownOption_1 = 147;
/**
* Type \u2018{0}\u2019 is unknown in this context.
*/
- public static final short UnknownType_1 = 143;
+ public static final short UnknownType_1 = 148;
/**
* Unit \u201c{0}\u201d is not recognized.
*/
- public static final short UnknownUnit_1 = 144;
+ public static final short UnknownUnit_1 = 149;
/**
* The cell at column \u201c{1}\u201d of row \u201c{0}\u201d is unmodifiable.
*/
- public static final short UnmodifiableCellValue_2 = 145;
+ public static final short UnmodifiableCellValue_2 = 150;
/**
* This metadata is not modifiable.
*/
- public static final short UnmodifiableMetadata = 146;
+ public static final short UnmodifiableMetadata = 151;
/**
* This instance of \u2018{0}\u2019 is not modifiable.
*/
- public static final short UnmodifiableObject_1 = 147;
+ public static final short UnmodifiableObject_1 = 152;
/**
* Text \u201c{1}\u201d can not be parsed as an object of type \u2018{0}\u2019.
*/
- public static final short UnparsableStringForClass_2 = 148;
+ public static final short UnparsableStringForClass_2 = 153;
/**
* Text \u201c{1}\u201d can not be parsed as an object of type \u2018{0}\u2019, because of the \u201c{2}\u201d characters.
*/
- public static final short UnparsableStringForClass_3 = 149;
+ public static final short UnparsableStringForClass_3 = 154;
/**
* Can not parse \u201c{1}\u201d in element \u201c{0}\u201d.
*/
- public static final short UnparsableStringInElement_2 = 150;
+ public static final short UnparsableStringInElement_2 = 155;
/**
* Coordinate reference system has not been specified.
*/
- public static final short UnspecifiedCRS = 151;
+ public static final short UnspecifiedCRS = 156;
/**
* No format is specified for objects of class \u2018{0}\u2019.
*/
- public static final short UnspecifiedFormatForClass_1 = 152;
+ public static final short UnspecifiedFormatForClass_1 = 157;
/**
* Version {1} of {0} format is not supported.
*/
- public static final short UnsupportedFormatVersion_2 = 153;
+ public static final short UnsupportedFormatVersion_2 = 158;
/**
* Can not handle this instance of \u2018{0}\u2019 because arbitrary implementations are not yet
* supported.
*/
- public static final short UnsupportedImplementation_1 = 154;
+ public static final short UnsupportedImplementation_1 = 159;
/**
* The \u201c{0}\u201d interpolation is unsupported.
*/
- public static final short UnsupportedInterpolation_1 = 155;
+ public static final short UnsupportedInterpolation_1 = 160;
/**
* The \u2018{0}\u2019 operation is unsupported.
*/
- public static final short UnsupportedOperation_1 = 156;
+ public static final short UnsupportedOperation_1 = 161;
/**
* The \u2018{0}\u2019 type is unsupported.
*/
- public static final short UnsupportedType_1 = 157;
+ public static final short UnsupportedType_1 = 162;
/**
* A value is already defined for \u201c{0}\u201d.
*/
- public static final short ValueAlreadyDefined_1 = 158;
+ public static final short ValueAlreadyDefined_1 = 163;
/**
* Value \u2018{0}\u2019 = {1} is invalid. Expected a number greater than 0.
*/
- public static final short ValueNotGreaterThanZero_2 = 159;
+ public static final short ValueNotGreaterThanZero_2 = 164;
/**
* Value \u2018{0}\u2019 = {3} is invalid. Expected a value in the [{1} \u2026 {2}] range.
*/
- public static final short ValueOutOfRange_4 = 160;
+ public static final short ValueOutOfRange_4 = 165;
}
/**
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Fri Dec 30 09:23:24 2016
@@ -34,8 +34,6 @@ CanNotConvertValue_2 = Can
CanNotCompute_1 = Can not compute \u201c{0}\u201d.
CanNotOpen_1 = Can not open \u201c{0}\u201d.
CanNotParseFile_2 = Can not parse \u201c{1}\u201d as a file in the {0} format.
-CanNotParseFile_3 = Can not parse line {2} of \u201c{1}\u201d as part of a file in the {0} format.
-CanNotParseFile_4 = Can not parse line {2} (after column {3}) of \u201c{1}\u201d as part of a file in the {0} format.
CanNotRead_1 = Can not read \u201c{0}\u201d.
CanNotReadPropertyInFile_2 = Can not read property \u201c{1}\u201d in file \u201c{0}\u201d.
CanNotRepresentInFormat_2 = Can not represent \u201c{1}\u201d in a strictly standard-compliant {0} format.
@@ -46,8 +44,6 @@ CanNotWriteFile_2 = Can
CircularReference = Circular reference.
ClassNotFinal_1 = Class \u2018{0}\u2019 is not final.
CloneNotSupported_1 = Can not clone an object of type \u2018{0}\u2019.
-ClosedReader_1 = This {0} reader is closed.
-ClosedWriter_1 = This {0} writer is closed.
DatabaseError_2 = Database error while creating a \u2018{0}\u2019 object for the \u201c{1}\u201d identifier.
DeadThread_1 = Thread \u201c{0}\u201d is dead.
DisposedInstanceOf_1 = This instance of \u2018{0}\u2019 has been disposed.
@@ -81,8 +77,6 @@ IllegalCoordinateSystem_1 = Coor
IllegalCRSType_1 = Coordinate reference system can not be of type \u2018{0}\u2019.
IllegalFormatPatternForClass_2 = The \u201c{1}\u201d pattern can not be applied to formating of objects of type \u2018{0}\u2019.
IllegalIdentifierForCodespace_2 = \u201c{1}\u201d is not a valid identifier for the \u201c{0}\u201d code space.
-IllegalInputTypeForReader_2 = The {0} reader does not accept inputs of type \u2018{1}\u2019.
-IllegalOutputTypeForWriter_2 = The {0} writer does not accept outputs of type \u2018{1}\u2019.
IllegalLanguageCode_1 = The \u201c{0}\u201d language is not recognized.
IllegalMemberType_2 = Member \u201c{0}\u201d can not be associated to type \u201c{1}\u201d.
IllegalOptionValue_2 = Option \u2018{0}\u2019 can not take the \u201c{1}\u201d value.
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Fri Dec 30 09:23:24 2016
@@ -31,8 +31,6 @@ CanNotConvertValue_2 = La v
CanNotCompute_1 = Ne peut pas calculer \u00ab\u202f{0}\u202f\u00bb.
CanNotOpen_1 = Ne peut pas ouvrir \u00ab\u202f{0}\u202f\u00bb.
CanNotParseFile_2 = Ne peut pas lire \u00ab\u202f{1}\u202f\u00bb comme un fichier au format {0}.
-CanNotParseFile_3 = Ne peut pas lire la ligne {2} de \u00ab\u202f{1}\u202f\u00bb comme une partie d\u2019un fichier au format {0}.
-CanNotParseFile_4 = Ne peut pas lire la ligne {2} (apr\u00e8s la colonne {3}) de \u00ab\u202f{1}\u202f\u00bb comme une partie d\u2019un fichier au format {0}.
CanNotRead_1 = Ne peut pas lire \u00ab\u202f{0}\u202f\u00bb.
CanNotReadPropertyInFile_2 = Ne peut pas lire la propri\u00e9t\u00e9 \u00ab\u202f{1}\u202f\u00bb dans le fichier \u00ab\u202f{0}\u202f\u00bb.
CanNotRepresentInFormat_2 = Ne peut pas repr\u00e9senter \u00ab\u202f{1}\u202f\u00bb dans un format {0} strictement conforme.
@@ -43,8 +41,6 @@ CanNotWriteFile_2 = Ne p
CircularReference = R\u00e9f\u00e9rence circulaire.
ClassNotFinal_1 = La classe \u2018{0}\u2019 n\u2019est pas finale.
CloneNotSupported_1 = Un objet de type \u2018{0}\u2019 ne peut pas \u00eatre clon\u00e9.
-ClosedReader_1 = Ce lecteur {0} est ferm\u00e9.
-ClosedWriter_1 = Cet encodeur {0} est ferm\u00e9.
DatabaseError_2 = Erreur de base de donn\u00e9es lors de la cr\u00e9ation d\u2019un objet \u2018{0}\u2019 pour l\u2019identifiant \u00ab\u202f{1}\u202f\u00bb.
DeadThread_1 = La t\u00e2che \u00ab\u202f{0}\u202f\u00bb est morte.
DisposedInstanceOf_1 = Cette instance de \u2018{0}\u2019 a \u00e9t\u00e9 dispos\u00e9e.
@@ -78,8 +74,6 @@ IllegalCoordinateSystem_1 = Le s
IllegalCRSType_1 = Le syst\u00e8me de r\u00e9f\u00e9rence des coordonn\u00e9es ne peut pas \u00eatre de type \u2018{0}\u2019.
IllegalFormatPatternForClass_2 = Le mod\u00e8le \u00ab\u202f{1}\u202f\u00bb ne peut pas \u00eatre appliqu\u00e9 au formatage d\u2019objets de type \u2018{0}\u2019.
IllegalIdentifierForCodespace_2 = \u00ab\u202f{1}\u202f\u00bb n\u2019est pas un identifiant valide pour l\u2019espace de codes \u00ab\u202f{0}\u202f\u00bb.
-IllegalInputTypeForReader_2 = Le lecteur {0} n\u2019accepte pas des entr\u00e9s de type \u2018{1}\u2019.
-IllegalOutputTypeForWriter_2 = Le l\u2019encodeur {0} n\u2019accepte pas des sorties de type \u2018{1}\u2019.
IllegalLanguageCode_1 = Le code de langue \u00ab\u202f{0}\u202f\u00bb n\u2019est pas reconnu.
IllegalMemberType_2 = Le membre \u00ab\u202f{0}\u202f\u00bb ne peut pas \u00eatre associ\u00e9 au type \u00ab\u202f{1}\u202f\u00bb.
IllegalOptionValue_2 = L\u2019option \u2018{0}\u2019 n\u2019accepte pas la valeur \u00ab\u202f{1}\u202f\u00bb.
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -283,7 +283,7 @@ public class IndexedResourceBundle exten
* into an error record. Note that the message must be logged outside
* the synchronized block, otherwise there is dead locks!
*/
- final Locale locale = getLocale(); // Sometime null with IBM's JDK.
+ final Locale locale = getLocale(); // Sometime null with IBM's JDK.
final String baseName = getClass().getCanonicalName();
final String methodName = (key != null) ? "getObject" : "getKeys";
final LogRecord record = new LogRecord(Level.FINER, "Loaded resources for {0} from bundle \"{1}\".");
@@ -301,11 +301,11 @@ public class IndexedResourceBundle exten
}
} catch (IOException exception) {
record.setLevel (Level.WARNING);
- record.setMessage(exception.getMessage()); // For administrator, use system locale.
+ record.setMessage(exception.getMessage()); // For administrator, use system locale.
record.setThrown (exception);
Logging.log(IndexedResourceBundle.class, methodName, record);
final MissingResourceException error = new MissingResourceException(
- Exceptions.getLocalizedMessage(exception, locale), // For users, use requested locale.
+ Exceptions.getLocalizedMessage(exception, locale), // For users, use requested locale.
baseName, key);
error.initCause(exception);
throw error;
@@ -359,7 +359,7 @@ public class IndexedResourceBundle exten
} catch (ReflectiveOperationException e) {
e.addSuppressed(exception);
Logging.recoverableException(Logging.getLogger(Loggers.LOCALIZATION), getClass(), "handleGetObject", e);
- return null; // This is okay as of 'handleGetObject' contract.
+ return null; // This is okay as of 'handleGetObject' contract.
}
}
return (keyID >= 0 && keyID < values.length) ? values[keyID] : null;
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Loader.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -23,7 +23,6 @@ import java.util.Collections;
import java.util.ResourceBundle;
import java.lang.reflect.InvocationTargetException;
import java.io.IOException;
-import org.apache.sis.util.Exceptions;
/**
@@ -61,8 +60,8 @@ final class Loader extends ResourceBundl
* Returns the formats supported by this loader.
* The only supported format is {@code "apache-sis.utf"}.
*
- * @param baseName Ignored.
- * @return The supported formats.
+ * @param baseName ignored.
+ * @return the supported formats.
*/
@Override
public List<String> getFormats(String baseName) {
@@ -82,12 +81,12 @@ final class Loader extends ResourceBundl
/**
* Instantiates a new resource bundle.
*
- * @param baseName The fully qualified name of the base resource bundle.
- * @param locale The locale for which the resource bundle should be instantiated.
- * @param format Ignored since this loader supports only one format.
- * @param loader The class loader to use.
- * @param reload Ignored since this loader do not supports resource expiration.
- * @return The resource bundle instance, or null if none could be found.
+ * @param baseName the fully qualified name of the base resource bundle.
+ * @param locale the locale for which the resource bundle should be instantiated.
+ * @param format ignored since this loader supports only one format.
+ * @param loader the class loader to use.
+ * @param reload ignored since this loader does not support resource expiration.
+ * @return the resource bundle instance, or null if none could be found.
*/
@Override
public ResourceBundle newBundle(final String baseName, final Locale locale,
@@ -117,7 +116,7 @@ final class Loader extends ResourceBundl
try {
return (ResourceBundle) classe.getDeclaredConstructor(URL.class).newInstance(resources);
} catch (NoSuchMethodException | InvocationTargetException e) {
- InstantiationException exception = new InstantiationException(Exceptions.getLocalizedMessage(e, locale));
+ InstantiationException exception = new InstantiationException(e.toString());
exception.initCause(e);
throw exception;
}
Modified: sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -27,8 +27,6 @@ import org.apache.sis.storage.DataStoreE
import org.apache.sis.storage.DataStoreReferencingException;
import org.apache.sis.storage.UnsupportedStorageException;
import org.apache.sis.storage.StorageConnector;
-import org.apache.sis.util.resources.Errors;
-import org.apache.sis.util.Classes;
import org.apache.sis.util.Debug;
@@ -96,8 +94,7 @@ public class LandsatStore extends DataSt
source = connector.getStorageAs(Reader.class);
connector.closeAllExcept(source);
if (source == null) {
- throw new UnsupportedStorageException(errors().getString(Errors.Keys.IllegalInputTypeForReader_2,
- "Landsat", Classes.getClass(connector.getStorage())));
+ throw new UnsupportedStorageException(super.getLocale(), true, "Landsat", connector.getStorage());
}
}
@@ -137,14 +134,6 @@ public class LandsatStore extends DataSt
}
/**
- * Returns the error resources in the current locale.
- */
- private Errors errors() {
- // Must use "super" because LandsatStore construction may not be finished.
- return Errors.getResources(super.getLocale());
- }
-
- /**
* Returns a string representation of this Landsat store for debugging purpose.
* The content of the string returned by this method may change in any future SIS version.
*
Modified: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -35,7 +35,6 @@ import org.apache.sis.internal.storage.M
import org.apache.sis.metadata.sql.MetadataStoreException;
import org.apache.sis.storage.DataStoreClosedException;
import org.apache.sis.util.resources.Errors;
-import org.apache.sis.util.Classes;
/**
@@ -81,8 +80,7 @@ public class GeoTiffStore extends DataSt
this.encoding = (encoding != null) ? encoding : StandardCharsets.US_ASCII;
final ChannelDataInput input = connector.getStorageAs(ChannelDataInput.class);
if (input == null) {
- throw new UnsupportedStorageException(errors().getString(Errors.Keys.IllegalInputTypeForReader_2,
- "TIFF", Classes.getClass(connector.getStorage())));
+ throw new UnsupportedStorageException(super.getLocale(), false, "TIFF", connector.getStorage());
}
connector.closeAllExcept(input);
try {
@@ -123,7 +121,7 @@ public class GeoTiffStore extends DataSt
} catch (IOException e) {
throw new DataStoreException(errors().getString(Errors.Keys.CanNotRead_1, reader.input.filename), e);
} catch (FactoryException | ArithmeticException e) {
- throw new DataStoreContentException(reader.canNotDecode(), e);
+ throw new DataStoreContentException(getLocale(), "TIFF", reader.input.filename, null).initCause(e);
}
}
return metadata;
@@ -135,7 +133,7 @@ public class GeoTiffStore extends DataSt
private Reader reader() throws DataStoreException {
final Reader r = reader;
if (r == null) {
- throw new DataStoreClosedException(errors().getString(Errors.Keys.ClosedReader_1, "GeoTIFF"));
+ throw new DataStoreClosedException(getLocale(), false, "GeoTIFF");
}
return r;
}
@@ -160,8 +158,7 @@ public class GeoTiffStore extends DataSt
* Returns the error resources in the current locale.
*/
final Errors errors() {
- // Must use "super" because GeoTiffStore construction may not be finished.
- return Errors.getResources(super.getLocale());
+ return Errors.getResources(getLocale());
}
/**
Modified: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -194,13 +194,6 @@ final class Reader extends GeoTIFF {
}
/**
- * Returns a default message for parsing error.
- */
- final String canNotDecode() {
- return errors().getString(Errors.Keys.CanNotParseFile_2, "TIFF", input.filename);
- }
-
- /**
* Reads the {@code int} or {@code long} value (depending if the file is
* a standard of big TIFF) at the current {@linkplain #input} position.
*
@@ -214,7 +207,7 @@ final class Reader extends GeoTIFF {
if (pointer >= 0) {
return pointer;
}
- throw new DataStoreContentException(canNotDecode());
+ throw new DataStoreContentException(owner.getLocale(), "TIFF", input.filename, null);
}
/**
@@ -231,7 +224,7 @@ final class Reader extends GeoTIFF {
if (entry >= 0) {
return entry;
}
- throw new DataStoreContentException(canNotDecode());
+ throw new DataStoreContentException(owner.getLocale(), "TIFF", input.filename, null);
}
/**
Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -253,7 +253,7 @@ public final class ChannelDecoder extend
VariableInfo[] variables = null;
Map<String,Object> attributes = null;
for (int i=0; i<3; i++) {
- final long tn = input.readLong(); // Combination of tag and nelems
+ final long tn = input.readLong(); // Combination of tag and nelems
if (tn != 0) {
final int tag = (int) (tn >>> Integer.SIZE);
final int nelems = (int) tn;
@@ -266,7 +266,7 @@ public final class ChannelDecoder extend
default: throw malformedHeader();
}
} catch (InvalidParameterCardinalityException e) {
- throw new DataStoreContentException(e.getLocalizedMessage());
+ throw new DataStoreContentException(e.getLocalizedMessage(), e);
}
}
}
@@ -316,7 +316,7 @@ public final class ChannelDecoder extend
* that the file should be a NetCDF one, but we found some inconsistency or unknown tags.
*/
private DataStoreException malformedHeader() {
- return new DataStoreContentException(errors().getString(Errors.Keys.CanNotParseFile_2, "NetCDF", getFilename()));
+ return new DataStoreContentException(listeners.getLocale(), "NetCDF", getFilename(), null);
}
/**
@@ -541,9 +541,7 @@ public final class ChannelDecoder extend
varDims[i] = allDimensions[input.readInt()];
}
} catch (IndexOutOfBoundsException cause) {
- final DataStoreException e = malformedHeader();
- e.initCause(cause);
- throw e;
+ throw malformedHeader().initCause(cause);
}
/*
* Following block is almost a copy-and-paste of similar block in the contructor,
Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -19,8 +19,6 @@ package org.apache.sis.storage.netcdf;
import java.io.IOException;
import org.opengis.metadata.Metadata;
import org.apache.sis.util.Debug;
-import org.apache.sis.util.Classes;
-import org.apache.sis.util.resources.Errors;
import org.apache.sis.storage.DataStore;
import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.UnsupportedStorageException;
@@ -89,8 +87,7 @@ public class NetcdfStore extends DataSto
throw new DataStoreException(e);
}
if (decoder == null) {
- throw new UnsupportedStorageException(errors().getString(Errors.Keys.IllegalInputTypeForReader_2,
- "NetCDF", Classes.getClass(connector.getStorage())));
+ throw new UnsupportedStorageException(super.getLocale(), false, "NetCDF", connector.getStorage());
}
}
@@ -151,14 +148,6 @@ public class NetcdfStore extends DataSto
}
/**
- * Returns the error resources in the current locale.
- */
- private Errors errors() {
- // Must use "super" because NetcdfStore construction may not be finished.
- return Errors.getResources(super.getLocale());
- }
-
- /**
* Returns a string representation of this NetCDF store for debugging purpose.
* The content of the string returned by this method may change in any future SIS version.
*
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -27,7 +27,6 @@ import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.LineNumberReader;
-import java.io.Reader;
import java.net.URI;
import java.net.URL;
import java.net.URLDecoder;
@@ -43,6 +42,8 @@ import java.nio.file.StandardOpenOption;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.charset.StandardCharsets;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamReader;
import org.apache.sis.util.logging.Logging;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.Exceptions;
@@ -557,21 +558,42 @@ public final class IOUtilities extends S
}
/**
- * Returns an error message a file that can not be parsed because of an error at the given location.
+ * Returns the {@link Resources.Keys} value together with the parameters given by {@code errorMessageParameters(\u2026)}.
+ *
+ * @param parameters the result of {@code errorMessageParameters(\u2026)} method call.
+ * @return the {@link Resources.Keys} value to use for formatting the error message.
+ *
+ * @since 0.8
+ */
+ public static short errorMessageKey(final Object[] parameters) {
+ return (parameters.length == 2) ? Resources.Keys.CanNotReadFile_2 :
+ (parameters.length == 3) ? Resources.Keys.CanNotReadFile_3 :
+ Resources.Keys.CanNotReadFile_4;
+ }
+
+ /**
+ * Returns the parameters for an error message saying that an error occurred while processing a file.
+ * This method uses the information provided by methods like {@link LineNumberReader#getLineNumber()}
+ * or {@link XMLStreamReader#getLocation()} if the given {@code store} is one of the supported types.
*
- * @param errors the resource bundle to use for creating the message.
* @param format abbreviation of the file format (e.g. "CSV", "GML", "WKT", <i>etc</i>).
- * @param filename name of the file being parsed.
- * @param line 1-based line number where the error occurred, or 0 if unknown.
- * @param column 1-based column number where the error occurred, or 0 if unknown.
- * @return a localized error message for a file that can not be parsed.
+ * @param filename name of the file or the data store.
+ * @param store the input or output object, or {@code null}.
+ * @return the parameters for a localized error message for a file that can not be processed.
*
* @since 0.8
*/
@SuppressWarnings("fallthrough")
- public static String canNotParseFile(final Errors errors, final String format,
- final String filename, final int line, final int column)
- {
+ public static Object[] errorMessageParameters(final String format, final String filename, final Object store) {
+ int line = 0;
+ int column = 0;
+ if (store instanceof XMLStreamReader) {
+ final Location location = ((XMLStreamReader) store).getLocation();
+ line = location.getLineNumber() + 1;
+ column = location.getColumnNumber() + 1;
+ } else if (store instanceof LineNumberReader) {
+ line = ((LineNumberReader) store).getLineNumber();
+ }
final Object[] params = new Object[(line == 0) ? 2 : (column == 0) ? 3 : 4];
switch (params.length) {
default: // Fallthrough everywhere
@@ -581,27 +603,6 @@ public final class IOUtilities extends S
case 1: params[0] = format;
case 0: break;
}
- return errors.getString((line == 0) ? Errors.Keys.CanNotParseFile_2 :
- (column == 0) ? Errors.Keys.CanNotParseFile_3 :
- Errors.Keys.CanNotParseFile_4, params);
- }
-
- /**
- * Returns an error message a file that can not be parsed because of an error at the current line.
- * This method uses the {@link LineNumberReader#getLineNumber()} value if the given {@code input}
- * is an instance of {@link LineNumberReader}.
- *
- * @param errors the resource bundle to use for creating the message.
- * @param format abbreviation of the file format (e.g. "CSV", "GML", "WKT", <i>etc</i>).
- * @param filename name of the file being parsed.
- * @param input the reader, preferably as an instance of {@link LineNumberReader}.
- * @return a localized error message for a file that can not be parsed.
- *
- * @since 0.8
- */
- @SuppressWarnings("fallthrough")
- public static String canNotParseFile(final Errors errors, final String format, final String filename, final Reader input) {
- return canNotParseFile(errors, format, filename,
- (input instanceof LineNumberReader) ? ((LineNumberReader) input).getLineNumber() : 0, 0);
+ return params;
}
}
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -61,17 +61,52 @@ public final class Resources extends Ind
}
/**
+ * Can not read \u201c{1}\u201d as a file in the {0} format.
+ */
+ public static final short CanNotReadFile_2 = 7;
+
+ /**
+ * Can not read line {2} of \u201c{1}\u201d as part of a file in the {0} format.
+ */
+ public static final short CanNotReadFile_3 = 8;
+
+ /**
+ * Can not read line {2} (after column {3}) of \u201c{1}\u201d as part of a file in the {0} format.
+ */
+ public static final short CanNotReadFile_4 = 9;
+
+ /**
+ * This {0} reader is closed.
+ */
+ public static final short ClosedReader_1 = 10;
+
+ /**
+ * This {0} writer is closed.
+ */
+ public static final short ClosedWriter_1 = 11;
+
+ /**
* Character string in the \u201c{0}\u201d file is too long. The string has {2} characters while the
* limit is {1}.
*/
public static final short ExcessiveStringSize_3 = 0;
/**
- * The \u201c{0}\u201d data store does not accept features of type \u201c{1}\u201d.
+ * The {0} data store does not accept features of type \u201c{1}\u201d.
*/
public static final short IllegalFeatureType_2 = 6;
/**
+ * The {0} reader does not accept inputs of type \u2018{1}\u2019.
+ */
+ public static final short IllegalInputTypeForReader_2 = 12;
+
+ /**
+ * The {0} writer does not accept outputs of type \u2018{1}\u2019.
+ */
+ public static final short IllegalOutputTypeForWriter_2 = 13;
+
+ /**
* Components of the \u201c{0}\u201d name are inconsistent with those of the name that was added.
*/
public static final short InconsistentNameComponents_1 = 4;
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties [ISO-8859-1] Fri Dec 30 09:23:24 2016
@@ -19,8 +19,15 @@
# Resources in this file are for "sis-netcdf" usage only and should not be used by any other module.
# For resources shared by all modules in the Apache SIS project, see "org.apache.sis.util.resources" package.
#
+CanNotReadFile_2 = Can not read \u201c{1}\u201d as a file in the {0} format.
+CanNotReadFile_3 = Can not read line {2} of \u201c{1}\u201d as part of a file in the {0} format.
+CanNotReadFile_4 = Can not read line {2} (after column {3}) of \u201c{1}\u201d as part of a file in the {0} format.
+ClosedReader_1 = This {0} reader is closed.
+ClosedWriter_1 = This {0} writer is closed.
ExcessiveStringSize_3 = Character string in the \u201c{0}\u201d file is too long. The string has {2} characters while the limit is {1}.
-IllegalFeatureType_2 = The \u201c{0}\u201d data store does not accept features of type \u201c{1}\u201d.
+IllegalFeatureType_2 = The {0} data store does not accept features of type \u201c{1}\u201d.
+IllegalInputTypeForReader_2 = The {0} reader does not accept inputs of type \u2018{1}\u2019.
+IllegalOutputTypeForWriter_2 = The {0} writer does not accept outputs of type \u2018{1}\u2019.
InconsistentNameComponents_1 = Components of the \u201c{0}\u201d name are inconsistent with those of the name that was added.
MissingSchemeInURI_1 = Missing scheme in \u201c{0}\u201d URI.
ProcessingExecutedOn_1 = Processing executed on {0}.
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties [ISO-8859-1] Fri Dec 30 09:23:24 2016
@@ -24,8 +24,15 @@
# U+202F NARROW NO-BREAK SPACE before ; ! and ?
# U+00A0 NO-BREAK SPACE before :
#
+CanNotReadFile_2 = Ne peut pas lire \u00ab\u202f{1}\u202f\u00bb comme un fichier au format {0}.
+CanNotReadFile_3 = Ne peut pas lire la ligne {2} de \u00ab\u202f{1}\u202f\u00bb comme une partie d\u2019un fichier au format {0}.
+CanNotReadFile_4 = Ne peut pas lire la ligne {2} (apr\u00e8s la colonne {3}) de \u00ab\u202f{1}\u202f\u00bb comme une partie d\u2019un fichier au format {0}.
+ClosedReader_1 = Ce lecteur {0} est ferm\u00e9.
+ClosedWriter_1 = Cet encodeur {0} est ferm\u00e9.
ExcessiveStringSize_3 = La cha\u00eene de caract\u00e8res dans le fichier \u00ab\u202f{0}\u202f\u00bb est trop longue. La cha\u00eene fait {2} caract\u00e8res alors que la limite est {1}.
-IllegalFeatureType_2 = Le format \u00ab\u202f{0}\u202f\u00bb ne stocke pas de donn\u00e9es de type \u00ab\u202f{1}\u202f\u00bb.
+IllegalFeatureType_2 = Le format {0} ne stocke pas de donn\u00e9es de type \u00ab\u202f{1}\u202f\u00bb.
+IllegalInputTypeForReader_2 = Le lecteur {0} n\u2019accepte pas des entr\u00e9s de type \u2018{1}\u2019.
+IllegalOutputTypeForWriter_2 = Le l\u2019encodeur {0} n\u2019accepte pas des sorties de type \u2018{1}\u2019.
InconsistentNameComponents_1 = Les \u00e9l\u00e9ments qui composent le nom \u00ab\u202f{0}\u202f\u00bb ne sont pas coh\u00e9rents avec ceux du nom qui avait \u00e9t\u00e9 ajout\u00e9.
MissingSchemeInURI_1 = Il manque le sch\u00e9ma dans l\u2019URI \u00ab\u202f{0}\u202f\u00bb.
ProcessingExecutedOn_1 = Traitement ex\u00e9cut\u00e9 sur {0}.
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -241,11 +241,11 @@ public final class Store extends Feature
}
source.reset();
} catch (IOException e) {
- throw new DataStoreException(canNotParseFile(), e);
+ throw new DataStoreException(getLocale(), "CSV", filename, source).initCause(e);
} catch (FactoryException e) {
- throw new DataStoreReferencingException(canNotParseFile(), e);
+ throw new DataStoreReferencingException(getLocale(), "CSV", filename, source).initCause(e);
} catch (IllegalArgumentException | DateTimeException e) {
- throw new DataStoreContentException(canNotParseFile(), e);
+ throw new DataStoreContentException(getLocale(), "CSV", filename, source).initCause(e);
}
this.encoding = connector.getOption(OptionKey.ENCODING);
this.envelope = envelope;
@@ -285,7 +285,7 @@ public final class Store extends Feature
case 2: if (element.length() == 2 && Character.toUpperCase(element.charAt(1)) == 'D') {
spatialDimensionCount = element.charAt(0) - '0';
if (spatialDimensionCount < 2 || spatialDimensionCount > 3) {
- throw new DataStoreContentException(errors().getString(
+ throw new DataStoreReferencingException(errors().getString(
Errors.Keys.IllegalCoordinateSystem_1, element));
}
continue;
@@ -307,7 +307,7 @@ public final class Store extends Feature
case "hour": timeUnit = Units.HOUR; continue;
case "day": timeUnit = Units.DAY; continue;
case "absolute": isTimeAbsolute = true; continue;
- default: throw new DataStoreContentException(errors().getString(Errors.Keys.UnknownUnit_1, element));
+ default: throw new DataStoreReferencingException(errors().getString(Errors.Keys.UnknownUnit_1, element));
}
}
// If we reach this point, there is some remaining unknown elements. Ignore them.
@@ -370,7 +370,7 @@ public final class Store extends Feature
if ((dim = lowerCorner.length) != spatialDimensionCount ||
(dim = upperCorner.length) != spatialDimensionCount)
{
- throw new DataStoreContentException(errors().getString(
+ throw new DataStoreReferencingException(errors().getString(
Errors.Keys.MismatchedDimension_2, dim, spatialDimensionCount));
}
for (int i=0; i<spatialDimensionCount; i++) {
@@ -503,7 +503,7 @@ public final class Store extends Feature
try {
builder.addExtent(envelope);
} catch (TransformException e) {
- throw new DataStoreReferencingException(canNotParseFile(), e);
+ throw new DataStoreReferencingException(getLocale(), "CSV", filename, source).initCause(e);
} catch (UnsupportedOperationException e) {
// Failed to set the temporal components if the sis-temporal module was
// not on the classpath, but the other dimensions still have been set.
@@ -769,7 +769,8 @@ public final class Store extends Feature
* The error message will contain the line number if available.
*/
final String canNotParseFile() {
- return IOUtilities.canNotParseFile(errors(), "CSV", filename, source);
+ final Object[] parameters = IOUtilities.errorMessageParameters("CSV", filename, source);
+ return errors().getString(IOUtilities.errorMessageKey(parameters), parameters);
}
/**
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -34,7 +34,6 @@ import org.apache.sis.storage.DataStore;
import org.apache.sis.storage.StorageConnector;
import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.DataStoreContentException;
-import org.apache.sis.internal.storage.IOUtilities;
import org.apache.sis.metadata.iso.DefaultMetadata;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.CharSequences;
@@ -139,21 +138,13 @@ final class Store extends DataStore {
}
} while (pos.getIndex() < wkt.length());
} catch (ParseException e) {
- throw new DataStoreContentException(canNotParseFile(in), e);
+ throw new DataStoreContentException(getLocale(), "WKT", name, in).initCause(e);
} catch (IOException e) {
- throw new DataStoreException(canNotParseFile(in), e);
+ throw new DataStoreException(getLocale(), "WKT", name, in).initCause(e);
}
}
/**
- * Returns the error message for a file that can not be parsed.
- * The error message will contain the line number if available.
- */
- private String canNotParseFile(final Reader in) {
- return IOUtilities.canNotParseFile(Errors.getResources(getLocale()), "WKT", name, in);
- }
-
- /**
* Returns the metadata associated to the parsed objects, or {@code null} if none.
* The current implementation retains only instances of {@link ReferenceSystem}
* and ignore other cases.
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -99,7 +99,7 @@ public abstract class DataStore implemen
/**
* The locale to use for formatting warnings and other messages. This locale if for user interfaces
- * only - it has no effect on the data to be read or written from/to the data store.
+ * only \u2013 it has no effect on the data to be read or written from/to the data store.
*
* <p>The default value is the {@linkplain Locale#getDefault() system default locale}.</p>
*/
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -16,13 +16,16 @@
*/
package org.apache.sis.storage;
+import java.util.Locale;
+import org.apache.sis.internal.storage.Resources;
+
/**
* Thrown when a data store is closed and can no more return data.
*
* @author Marc Le Bihan
* @version 0.6
- * @since 0.6
+ * @since 0.8
* @module
*/
public class DataStoreClosedException extends DataStoreException {
@@ -49,4 +52,17 @@ public class DataStoreClosedException ex
public DataStoreClosedException(String message, Throwable cause) {
super(message, cause);
}
+
+ /**
+ * Creates a localized exception for a reader or writer which has been closed.
+ *
+ * @param locale the locale of the message to be returned by {@link #getLocalizedMessage()}, or {@code null}.
+ * @param writer {@code false} if a read operation was attempted, or {@code true} if a write operation was attempted.
+ * @param format short name or abbreviation of the data format (e.g. "CSV", "GML", "WKT", <i>etc</i>).
+ *
+ * @since 0.8
+ */
+ public DataStoreClosedException(final Locale locale, final boolean writer, final String format) {
+ super(locale, writer ? Resources.Keys.ClosedWriter_1 : Resources.Keys.ClosedReader_1, format);
+ }
}
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreContentException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreContentException.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreContentException.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreContentException.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -16,6 +16,8 @@
*/
package org.apache.sis.storage;
+import java.util.Locale;
+
/**
* Thrown when a store can not be read because the stream contains invalid data.
@@ -66,4 +68,20 @@ public class DataStoreContentException e
public DataStoreContentException(String message, Throwable cause) {
super(message, cause);
}
+
+ /**
+ * Creates a localized exception with a message saying that the given store can not be read.
+ * Location in the file where the error occurred while be fetched from the given {@code store}
+ * argument if possible. If the given store is not recognized, then it will be ignored.
+ *
+ * @param locale the locale of the message to be returned by {@link #getLocalizedMessage()}, or {@code null}.
+ * @param format short name or abbreviation of the data format (e.g. "CSV", "GML", "WKT", <i>etc</i>).
+ * @param filename name of the file or data store where the error occurred.
+ * @param store the input or output object from which to get the current position, or {@code null} if none.
+ * This can be a {@link java.io.LineNumberReader} or {@link javax.xml.stream.XMLStreamReader}
+ * for example.
+ */
+ public DataStoreContentException(Locale locale, String format, String filename, Object store) {
+ super(locale, format, filename, store);
+ }
}
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreException.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreException.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreException.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -17,30 +17,38 @@
package org.apache.sis.storage;
import java.util.Locale;
+import org.opengis.util.InternationalString;
+import org.apache.sis.util.LocalizedException;
import org.apache.sis.internal.storage.Resources;
+import org.apache.sis.internal.storage.IOUtilities;
+import org.apache.sis.util.Workaround;
/**
* Thrown when a {@link DataStore} can not complete a read or write operation.
*
+ * <div class="section">Localization</div>
+ * The {@link #getMessage()} and {@link #getLocalizedMessage()} methods return the same message,
+ * but sometime in different languages. The general policy is that {@link #getMessage()} returns
+ * the message in the JVM {@linkplain Locale#getDefault() default locale} while {@link #getLocalizedMessage()}
+ * returns the message in the locale specified by the last call to {@link DataStore#setLocale(Locale)}.
+ * In a client-server architecture, the former is typically the locale of the system administrator
+ * while the later is presumably the locale of the client connected to the server.
+ * However this policy is applied on a <em>best-effort</em> basis only.
+ *
* @author Johann Sorel (Geomatys)
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
* @version 0.8
* @module
*/
-public class DataStoreException extends Exception {
+public class DataStoreException extends Exception implements LocalizedException {
/**
* For cross-version compatibility.
*/
private static final long serialVersionUID = -1778987176103191950L;
/**
- * The locale to use for formatting the localized error message, or {@code null} for the default.
- */
- private final Locale locale;
-
- /**
* The resources key as one of the {@code Resources.Keys} constant, or 0 if none.
*/
private final short key;
@@ -55,7 +63,6 @@ public class DataStoreException extends
*/
public DataStoreException() {
super();
- locale = null;
key = 0;
arguments = null;
}
@@ -63,11 +70,10 @@ public class DataStoreException extends
/**
* Creates an exception with the specified details message.
*
- * @param message the detail message.
+ * @param message the detail message in the default locale.
*/
public DataStoreException(final String message) {
super(message);
- locale = null;
key = 0;
arguments = null;
}
@@ -79,7 +85,6 @@ public class DataStoreException extends
*/
public DataStoreException(final Throwable cause) {
super(cause);
- locale = null;
key = 0;
arguments = null;
}
@@ -87,28 +92,64 @@ public class DataStoreException extends
/**
* Creates an exception with the specified details message and cause.
*
- * @param message the detail message.
+ * @param message the detail message in the default locale.
* @param cause the cause for this exception.
*/
public DataStoreException(final String message, final Throwable cause) {
super(message, cause);
- locale = null;
key = 0;
arguments = null;
}
/**
+ * Creates a localized exception with a message saying that the given store can not be processed.
+ * Location in the file where the error occurred while be fetched from the given {@code store}
+ * argument if possible, for example by invoking the {@link java.io.LineNumberReader#getLineNumber()}
+ * or {@link javax.xml.stream.XMLStreamReader#getLocation()} method.
+ * If The given {@code store} argument is not one of the recognized types, then it is ignored.
+ *
+ * @param locale the locale of the message to be returned by {@link #getLocalizedMessage()}, or {@code null}.
+ * @param format short name or abbreviation of the data format (e.g. "CSV", "GML", "WKT", <i>etc</i>).
+ * @param filename name of the file or data store where the error occurred.
+ * @param store the input or output object from which to get the current position, or {@code null} if none.
+ * This can be a {@link LineNumberReader} or {@link XMLStreamReader} for example.
+ *
+ * @since 0.8
+ */
+ public DataStoreException(final Locale locale, final String format, final String filename, final Object store) {
+ this(locale, IOUtilities.errorMessageParameters(format, filename, store));
+ }
+
+ /**
+ * Workaround for RFE #4093999
+ * ("Relax constraint on placement of this()/super() call in constructors").
+ */
+ @Workaround(library="JDK", version="1.8")
+ private DataStoreException(final Locale locale, final Object[] params) {
+ this(locale, IOUtilities.errorMessageKey(params), params);
+ }
+
+ /**
* Creates a new exception which will format a localized message in the given locale.
*
- * @param locale the locale for the message to be returned by {@link #getLocalizedMessage()}.
- * @param key one of {@link Resources.Keys} constants.
- * @param arguments arguments to use for formatting the messages.
- */
- DataStoreException(final Locale locale, final short key, final Object... arguments) {
- super(Resources.format(key, arguments));
- this.locale = locale;
+ * @param locale the locale for the message to be returned by {@link #getLocalizedMessage()}.
+ * @param key one of {@link Resources.Keys} constants.
+ * @param parameters parameters to use for formatting the messages.
+ */
+ DataStoreException(final Locale locale, final short key, final Object... parameters) {
+ super(Resources.forLocale(locale).getString(key, parameters));
this.key = key;
- this.arguments = arguments;
+ this.arguments = parameters;
+ }
+
+ /**
+ * Returns the exception message in the default locale, typically for system administrator.
+ *
+ * @return the message of this exception.
+ */
+ @Override
+ public String getMessage() {
+ return (key != 0) ? Resources.format(key, arguments) : super.getMessage();
}
/**
@@ -125,9 +166,6 @@ public class DataStoreException extends
*
* In a client-server architecture, the former is often the locale on the <em>server</em> side while the later
* is the locale on the <em>client</em> side if that information has been provided to the {@link DataStore}.
- * {@code getMessage()} is targeted to the developer would will analyze the stack trace while
- * {@code getLocalizedMessage()} is targeted to the final user would may receive the error message
- * without stack trace.
*
* @return the localized message of this exception.
*
@@ -137,9 +175,30 @@ public class DataStoreException extends
*/
@Override
public String getLocalizedMessage() {
- if (key != 0) {
- return Resources.forLocale(locale).getString(key, arguments);
- }
- return super.getLocalizedMessage();
+ return super.getMessage();
+ }
+
+ /**
+ * If this exception is capable to return the message in various locales, returns that message.
+ * Otherwise returns {@code null}.
+ *
+ * @return the exception message, or {@code null} if this exception can not produce international message.
+ *
+ * @since 0.8
+ */
+ @Override
+ public InternationalString getInternationalMessage() {
+ return (key != 0) ? Resources.formatInternational(key, arguments) : null;
+ }
+
+ /**
+ * Initializes the <i>cause</i> of this throwable to the specified value.
+ *
+ * @param cause the cause saved for later retrieval by the {@link #getCause()} method.
+ * @return a reference to this {@code DataStoreException} instance.
+ */
+ @Override
+ public DataStoreException initCause(final Throwable cause) {
+ return (DataStoreException) super.initCause(cause);
}
}
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreReferencingException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreReferencingException.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreReferencingException.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreReferencingException.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -16,6 +16,8 @@
*/
package org.apache.sis.storage;
+import java.util.Locale;
+
/**
* Thrown when a data store failed to construct the coordinate reference system (CRS)
@@ -35,13 +37,6 @@ public class DataStoreReferencingExcepti
private static final long serialVersionUID = 2671737996817267335L;
/**
- * Creates an exception with no cause and no details message.
- */
- public DataStoreReferencingException() {
- super();
- }
-
- /**
* Creates an exception with the specified details message.
*
* @param message the detail message.
@@ -68,4 +63,20 @@ public class DataStoreReferencingExcepti
public DataStoreReferencingException(final String message, final Throwable cause) {
super(message, cause);
}
+
+ /**
+ * Creates a localized exception with a message saying that the given store can not be read.
+ * Location in the file where the error occurred while be fetched from the given {@code store}
+ * argument if possible. If the given store is not recognized, then it will be ignored.
+ *
+ * @param locale the locale of the message to be returned by {@link #getLocalizedMessage()}, or {@code null}.
+ * @param format short name or abbreviation of the data format (e.g. "CSV", "GML", "WKT", <i>etc</i>).
+ * @param filename name of the file or data store where the error occurred.
+ * @param store the input or output object from which to get the current position, or {@code null} if none.
+ * This can be a {@link java.io.LineNumberReader} or {@link javax.xml.stream.XMLStreamReader}
+ * for example.
+ */
+ public DataStoreReferencingException(Locale locale, String format, String filename, Object store) {
+ super(locale, format, filename, store);
+ }
}
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -212,7 +212,7 @@ search: while (!deferred.isEmpty
}
}
if (open && selected == null) {
- throw new UnsupportedStorageException(Resources.format(Resources.Keys.UnknownFormatFor_1, connector.getStorageName()));
+ throw new UnsupportedStorageException(null, Resources.Keys.UnknownFormatFor_1, connector.getStorageName());
}
return selected;
}
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -16,6 +16,10 @@
*/
package org.apache.sis.storage;
+import java.util.Locale;
+import org.apache.sis.util.Classes;
+import org.apache.sis.internal.storage.Resources;
+
/**
* Thrown when no {@link DataStoreProvider} is found for a given storage object.
@@ -24,7 +28,7 @@ package org.apache.sis.storage;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
- * @version 0.4
+ * @version 0.8
* @module
*/
public class UnsupportedStorageException extends DataStoreException {
@@ -67,4 +71,31 @@ public class UnsupportedStorageException
public UnsupportedStorageException(final String message, final Throwable cause) {
super(message, cause);
}
+
+ /**
+ * Creates a new exception which will format a localized message in the given locale.
+ *
+ * @param locale the locale for the message to be returned by {@link #getLocalizedMessage()}.
+ * @param key one of {@link Resources.Keys} constants.
+ * @param parameters parameters to use for formatting the messages.
+ */
+ UnsupportedStorageException(final Locale locale, final short key, final Object... parameters) {
+ super(locale, key, parameters);
+ }
+
+ /**
+ * Creates a localized exception for an invalid input or output object given to a data store.
+ *
+ * @param locale the locale of the message to be returned by {@link #getLocalizedMessage()}, or {@code null}.
+ * @param writer {@code false} if a read operation was attempted, or {@code true} if a write operation was attempted.
+ * @param format short name or abbreviation of the data format (e.g. "CSV", "GML", "WKT", <i>etc</i>).
+ * @param storage the invalid input or output object.
+ *
+ * @since 0.8
+ */
+ public UnsupportedStorageException(final Locale locale, final boolean writer, final String format, final Object storage) {
+ super(locale, writer ? Resources.Keys.IllegalOutputTypeForWriter_2
+ : Resources.Keys.IllegalInputTypeForReader_2,
+ format, Classes.getClass(storage));
+ }
}
Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Store.java?rev=1776531&r1=1776530&r2=1776531&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Store.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/gpx/Store.java [UTF-8] Fri Dec 30 09:23:24 2016
@@ -191,7 +191,7 @@ public final class Store extends StaxDat
if (cause instanceof DataStoreException) {
throw (DataStoreException) cause;
}
- throw new DataStoreException(e.getMessage(), cause);
+ throw new DataStoreException(e.getLocalizedMessage(), cause);
} catch (Exception e) {
if (e instanceof UncheckedIOException) {
e = ((UncheckedIOException) e).getCause();