Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -104,14 +104,6 @@ public class DefaultGeographicCRS extend private static final long serialVersionUID = 861224913438092335L; /** - * Constructs a new object in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultGeographicCRS() { - } - - /** * Creates a coordinate reference system from the given properties, datum and coordinate system. * The properties given in argument follow the same rules than for the * {@linkplain AbstractReferenceSystem#AbstractReferenceSystem(Map) super-class constructor}. @@ -168,21 +160,6 @@ public class DefaultGeographicCRS extend } /** - * For {@link SC_GeographicCRS} JAXB adapter only. This is needed because GML does not have "GeographicCRS" type. - * Instead, the unmarshalling process will give us a "GeodeticCRS" object with the constraint that the coordinate - * system shall be ellipsoidal. This constructor will be invoked for converting the GeodeticCRS instance to a - * GeographicCRS instance. - */ - DefaultGeographicCRS(final GeodeticCRS crs) { - super(crs); - final CoordinateSystem cs = super.getCoordinateSystem(); - if (!(cs instanceof EllipsoidalCS)) { - throw new IllegalArgumentException(Errors.format( - Errors.Keys.IllegalClass_2, EllipsoidalCS.class, cs.getClass())); - } - } - - /** * Constructs a new coordinate reference system with the same values than the specified one. * This copy constructor provides a way to convert an arbitrary implementation into a SIS one * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. @@ -333,4 +310,41 @@ public class DefaultGeographicCRS extend protected String formatTo(final Formatter formatter) { return super.formatTo(formatter); } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new object in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultGeographicCRS() { + } + + /** + * For {@link SC_GeographicCRS} JAXB adapter only. This is needed because GML does not have "GeographicCRS" type. + * Instead, the unmarshalling process will give us a "GeodeticCRS" object with the constraint that the coordinate + * system shall be ellipsoidal. This constructor will be invoked for converting the GeodeticCRS instance to a + * GeographicCRS instance. + */ + DefaultGeographicCRS(final GeodeticCRS crs) { + super(crs); + final CoordinateSystem cs = super.getCoordinateSystem(); + if (!(cs instanceof EllipsoidalCS)) { + throw new IllegalArgumentException(Errors.format( + Errors.Keys.IllegalClass_2, EllipsoidalCS.class, cs.getClass())); + } + } }
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -72,15 +72,6 @@ public class DefaultImageCRS extends Abs private final ImageDatum datum; /** - * Constructs a new object in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultImageCRS() { - datum = null; - } - - /** * Creates a coordinate reference system from the given properties, datum and coordinate system. * The properties given in argument follow the same rules than for the * {@linkplain AbstractReferenceSystem#AbstractReferenceSystem(Map) super-class constructor}. @@ -206,38 +197,6 @@ public class DefaultImageCRS extends Abs } /** - * Used by JAXB only (invoked by reflection). - * Only one of {@code getAffineCS()} and {@link #getCartesianCS()} can return a non-null value. - */ - @XmlElement(name = "affineCS") - private AffineCS getAffineCS() { - return getCoordinateSystem(AffineCS.class); - } - - /** - * Used by JAXB only (invoked by reflection). - * Only one of {@link #getAffineCS()} and {@code getCartesianCS()} can return a non-null value. - */ - @XmlElement(name = "cartesianCS") - private CartesianCS getCartesianCS() { - return getCoordinateSystem(CartesianCS.class); - } - - /** - * Used by JAXB only (invoked by reflection). - */ - private void setAffineCS(final AffineCS cs) { - setCoordinateSystem("affineCS", cs); - } - - /** - * Used by JAXB only (invoked by reflection). - */ - private void setCartesianCS(final CartesianCS cs) { - setCoordinateSystem("cartesianCS", cs); - } - - /** * {@inheritDoc} * * @return {@inheritDoc} @@ -273,4 +232,40 @@ public class DefaultImageCRS extends Abs } return WKTKeywords.ImageCRS; } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new object in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultImageCRS() { + datum = null; + } + + /** + * Used by JAXB only (invoked by reflection). + * Only one of {@code getAffineCS()} and {@link #getCartesianCS()} can return a non-null value. + */ + @XmlElement(name = "affineCS") private AffineCS getAffineCS() {return getCoordinateSystem(AffineCS.class);} + @XmlElement(name = "cartesianCS") private CartesianCS getCartesianCS() {return getCoordinateSystem(CartesianCS.class);} + + /** + * Used by JAXB only (invoked by reflection). + */ + private void setAffineCS (final AffineCS cs) {setCoordinateSystem("affineCS", cs);} + private void setCartesianCS(final CartesianCS cs) {setCoordinateSystem("cartesianCS", cs);} } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -85,14 +85,6 @@ public class DefaultProjectedCRS extends private static final long serialVersionUID = -4502680112031773028L; /** - * Constructs a new object in which every attributes are set to a default value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultProjectedCRS() { - } - - /** * Creates a projected CRS from a defining conversion. * The properties given in argument follow the same rules than for the * {@linkplain AbstractCRS#AbstractCRS(Map, CoordinateSystem) super-class constructor}. @@ -271,13 +263,6 @@ public class DefaultProjectedCRS extends } /** - * Used by JAXB only (invoked by reflection). - */ - private void setCoordinateSystem(final CartesianCS cs) { - setCoordinateSystem("cartesianCS", cs); - } - - /** * {@inheritDoc} * * @return {@inheritDoc} @@ -492,4 +477,35 @@ public class DefaultProjectedCRS extends } } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new object in which every attributes are set to a default value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultProjectedCRS() { + } + + /** + * Used by JAXB only (invoked by reflection). + * + * @see #getCoordinateSystem() + */ + private void setCoordinateSystem(final CartesianCS cs) { + setCoordinateSystem("cartesianCS", cs); + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -93,15 +93,6 @@ public class DefaultTemporalCRS extends private transient long origin; /** - * Constructs a new object in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultTemporalCRS() { - datum = null; - } - - /** * Creates a coordinate reference system from the given properties, datum and coordinate system. * The properties given in argument follow the same rules than for the * {@linkplain AbstractReferenceSystem#AbstractReferenceSystem(Map) super-class constructor}. @@ -236,13 +227,6 @@ public class DefaultTemporalCRS extends } /** - * Used by JAXB only (invoked by reflection). - */ - private void setCoordinateSystem(final TimeCS cs) { - setCoordinateSystem("timeCS", cs); - } - - /** * {@inheritDoc} * * @return {@inheritDoc} @@ -316,4 +300,36 @@ public class DefaultTemporalCRS extends } return isBaseCRS(formatter) ? WKTKeywords.BaseTimeCRS : WKTKeywords.TimeCRS; } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new object in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultTemporalCRS() { + datum = null; + } + + /** + * Used by JAXB only (invoked by reflection). + * + * @see #getCoordinateSystem() + */ + private void setCoordinateSystem(final TimeCS cs) { + setCoordinateSystem("timeCS", cs); + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -72,15 +72,6 @@ public class DefaultVerticalCRS extends private final VerticalDatum datum; /** - * Constructs a new object in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultVerticalCRS() { - datum = null; - } - - /** * Creates a coordinate reference system from the given properties, datum and coordinate system. * The properties given in argument follow the same rules than for the * {@linkplain AbstractReferenceSystem#AbstractReferenceSystem(Map) super-class constructor}. @@ -207,13 +198,6 @@ public class DefaultVerticalCRS extends } /** - * Used by JAXB only (invoked by reflection). - */ - private void setCoordinateSystem(final VerticalCS cs) { - setCoordinateSystem("verticalCS", cs); - } - - /** * {@inheritDoc} * * @return {@inheritDoc} @@ -244,4 +228,36 @@ public class DefaultVerticalCRS extends return (formatter.getConvention().majorVersion() == 1) ? WKTKeywords.Vert_CS : isBaseCRS(formatter) ? WKTKeywords.BaseVertCRS : WKTKeywords.VerticalCRS; } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new object in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultVerticalCRS() { + datum = null; + } + + /** + * Used by JAXB only (invoked by reflection). + * + * @see #getCoordinateSystem() + */ + private void setCoordinateSystem(final VerticalCS cs) { + setCoordinateSystem("verticalCS", cs); + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -98,11 +98,6 @@ public class AbstractCS extends Abstract static final int VALID = 0, INVALID_DIRECTION = 1, INVALID_UNIT = 2; /** - * An empty array of axes, used only for JAXB. - */ - private static final CoordinateSystemAxis[] EMPTY = new CoordinateSystemAxis[0]; - - /** * The sequence of axes for this coordinate system. */ @XmlElement(name = "axis") @@ -117,16 +112,6 @@ public class AbstractCS extends Abstract private transient Map<AxesConvention,AbstractCS> derived; /** - * Constructs a new object in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved - * to JAXB, which will assign values to the fields using reflexion. - */ - AbstractCS() { - super(org.apache.sis.internal.referencing.NilReferencingObject.INSTANCE); - axes = EMPTY; - } - - /** * Constructs a coordinate system from a set of properties and a sequence of axes. * The properties map is given unchanged to the * {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}. @@ -470,4 +455,33 @@ public class AbstractCS extends Abstract formatter.append(getDimension()); return WKTKeywords.CS; } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * An empty array of axes, used only for JAXB. + */ + private static final CoordinateSystemAxis[] EMPTY = new CoordinateSystemAxis[0]; + + /** + * Constructs a new object in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved + * to JAXB, which will assign values to the fields using reflexion. + */ + AbstractCS() { + super(org.apache.sis.internal.referencing.NilReferencingObject.INSTANCE); + axes = EMPTY; + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultAffineCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -64,14 +64,6 @@ public class DefaultAffineCS extends Abs private static final long serialVersionUID = 7977674229369042440L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - DefaultAffineCS() { - } - - /** * Constructs a coordinate system of arbitrary dimension. This constructor is * not public because {@code AffineCS} are restricted to 2 and 3 dimensions. */ @@ -234,4 +226,26 @@ public class DefaultAffineCS extends Abs default: throw unexpectedDimension(properties, axes, 2); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + DefaultAffineCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -69,14 +69,6 @@ public class DefaultCartesianCS extends private static final long serialVersionUID = -6182037957705712945L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - private DefaultCartesianCS() { - } - - /** * Creates a new coordinate system from an arbitrary number of axes. This constructor is for * implementations of the {@link #createForAxes(Map, CoordinateSystemAxis[])} method only, * because it does not verify the number of axes. @@ -242,4 +234,26 @@ public class DefaultCartesianCS extends default: throw unexpectedDimension(properties, axes, 2); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + private DefaultCartesianCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -213,21 +213,6 @@ public class DefaultCoordinateSystemAxis private final RangeMeaning rangeMeaning; /** - * Constructs a new object in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultCoordinateSystemAxis() { - super(org.apache.sis.internal.referencing.NilReferencingObject.INSTANCE); - abbreviation = null; - direction = null; - unit = null; - rangeMeaning = null; - minimumValue = NEGATIVE_INFINITY; - maximumValue = POSITIVE_INFINITY; - } - - /** * Constructs an axis from a set of properties. The properties given in argument follow the same rules * than for the {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}. * Additionally, the following properties are understood by this constructor: @@ -452,30 +437,6 @@ public class DefaultCoordinateSystemAxis } /** - * Invoke by JAXB at marshalling time for fetching the minimum value, or {@code null} if none. - */ - @XmlElement(name = "minimumValue") - private Double getMinimum() { - return (minimumValue != NEGATIVE_INFINITY) ? minimumValue : null; - } - - /** - * Invoked by JAXB at unmarshalling time for setting the minimum value. - */ - private void setMinimum(final Double value) { - if (minimumValue == NEGATIVE_INFINITY) { - final double min = value; // Apply unboxing. - if (min < maximumValue) { - minimumValue = min; - } else { - outOfRange("minimumValue", value); - } - } else { - ReferencingUtilities.propertyAlreadySet(DefaultCoordinateSystemAxis.class, "setMinimum", "minimumValue"); - } - } - - /** * Returns the maximum value normally allowed for this axis, in the {@linkplain #getUnit() * unit of measure for the axis}. If there is no maximum value, then this method returns * {@linkplain Double#POSITIVE_INFINITY negative infinity}. @@ -488,30 +449,6 @@ public class DefaultCoordinateSystemAxis } /** - * Invoke by JAXB at marshalling time for fetching the maximum value, or {@code null} if none. - */ - @XmlElement(name = "maximumValue") - private Double getMaximum() { - return (maximumValue != POSITIVE_INFINITY) ? maximumValue : null; - } - - /** - * Invoked by JAXB at unmarshalling time for setting the maximum value. - */ - private void setMaximum(final Double value) { - if (maximumValue == POSITIVE_INFINITY) { - final double max = value; // Apply unboxing. - if (max > minimumValue) { - maximumValue = max; - } else { - outOfRange("maximumValue", value); - } - } else { - ReferencingUtilities.propertyAlreadySet(DefaultCoordinateSystemAxis.class, "setMaximum", "maximumValue"); - } - } - - /** * Invoked at unmarshalling time if a minimum or maximum value is out of range. * * @param name The property name. Will also be used as "method" name for logging purpose, @@ -895,4 +832,85 @@ public class DefaultCoordinateSystemAxis return WKTKeywords.Order; } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new object in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultCoordinateSystemAxis() { + super(org.apache.sis.internal.referencing.NilReferencingObject.INSTANCE); + abbreviation = null; + direction = null; + unit = null; + rangeMeaning = null; + minimumValue = NEGATIVE_INFINITY; + maximumValue = POSITIVE_INFINITY; + } + + /** + * Invoked by JAXB at marshalling time for fetching the minimum value, or {@code null} if none. + * + * @see #getMinimumValue() + */ + @XmlElement(name = "minimumValue") + private Double getMinimum() { + return (minimumValue != NEGATIVE_INFINITY) ? minimumValue : null; + } + + /** + * Invoked by JAXB at unmarshalling time for setting the minimum value. + */ + private void setMinimum(final Double value) { + if (minimumValue == NEGATIVE_INFINITY) { + final double min = value; // Apply unboxing. + if (min < maximumValue) { + minimumValue = min; + } else { + outOfRange("minimumValue", value); + } + } else { + ReferencingUtilities.propertyAlreadySet(DefaultCoordinateSystemAxis.class, "setMinimum", "minimumValue"); + } + } + + /** + * Invoked by JAXB at marshalling time for fetching the maximum value, or {@code null} if none. + * + * @see #getMaximumValue() + */ + @XmlElement(name = "maximumValue") + private Double getMaximum() { + return (maximumValue != POSITIVE_INFINITY) ? maximumValue : null; + } + + /** + * Invoked by JAXB at unmarshalling time for setting the maximum value. + */ + private void setMaximum(final Double value) { + if (maximumValue == POSITIVE_INFINITY) { + final double max = value; // Apply unboxing. + if (max > minimumValue) { + maximumValue = max; + } else { + outOfRange("maximumValue", value); + } + } else { + ReferencingUtilities.propertyAlreadySet(DefaultCoordinateSystemAxis.class, "setMaximum", "maximumValue"); + } + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -63,14 +63,6 @@ public class DefaultCylindricalCS extend private static final long serialVersionUID = -8290402732390917907L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - private DefaultCylindricalCS() { - } - - /** * Creates a new coordinate system from an arbitrary number of axes. This constructor is for * implementations of the {@link #createForAxes(Map, CoordinateSystemAxis[])} method only, * because it does not verify the number of axes. @@ -213,4 +205,26 @@ public class DefaultCylindricalCS extend default: throw unexpectedDimension(properties, axes, 2); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + private DefaultCylindricalCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -61,14 +61,6 @@ public class DefaultEllipsoidalCS extend private static final long serialVersionUID = -1452492488902329211L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - private DefaultEllipsoidalCS() { - } - - /** * Creates a new coordinate system from an arbitrary number of axes. This constructor is for * implementations of the {@link #createForAxes(Map, CoordinateSystemAxis[])} method only, * because it does not verify the number of axes. @@ -252,4 +244,26 @@ public class DefaultEllipsoidalCS extend default: throw unexpectedDimension(properties, axes, 1); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + private DefaultEllipsoidalCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -62,14 +62,6 @@ public class DefaultLinearCS extends Abs private static final long serialVersionUID = -6890723478287625763L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - private DefaultLinearCS() { - } - - /** * Creates a new coordinate system from an arbitrary number of axes. This constructor is for * implementations of the {@link #createForAxes(Map, CoordinateSystemAxis[])} method only, * because it does not verify the number of axes. @@ -205,4 +197,26 @@ public class DefaultLinearCS extends Abs default: throw unexpectedDimension(properties, axes, 1); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + private DefaultLinearCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultPolarCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -61,14 +61,6 @@ public class DefaultPolarCS extends Abst private static final long serialVersionUID = 3960197260975470951L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - private DefaultPolarCS() { - } - - /** * Creates a new coordinate system from an arbitrary number of axes. This constructor is for * implementations of the {@link #createForAxes(Map, CoordinateSystemAxis[])} method only, * because it does not verify the number of axes. @@ -208,4 +200,26 @@ public class DefaultPolarCS extends Abst default: throw unexpectedDimension(properties, axes, 2); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + private DefaultPolarCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -65,14 +65,6 @@ public class DefaultSphericalCS extends private static final long serialVersionUID = 196295996465774477L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - private DefaultSphericalCS() { - } - - /** * Creates a new coordinate system from an arbitrary number of axes. This constructor is for * implementations of the {@link #createForAxes(Map, CoordinateSystemAxis[])} method only, * because it does not verify the number of axes. @@ -213,4 +205,26 @@ public class DefaultSphericalCS extends default: throw unexpectedDimension(properties, axes, 2); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + private DefaultSphericalCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultTimeCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultTimeCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultTimeCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultTimeCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -64,14 +64,6 @@ public class DefaultTimeCS extends Abstr private static final long serialVersionUID = 5222911412381303989L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - private DefaultTimeCS() { - } - - /** * Creates a new coordinate system from an arbitrary number of axes. This constructor is for * implementations of the {@link #createForAxes(Map, CoordinateSystemAxis[])} method only, * because it does not verify the number of axes. @@ -205,4 +197,26 @@ public class DefaultTimeCS extends Abstr default: throw unexpectedDimension(properties, axes, 1); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + private DefaultTimeCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultUserDefinedCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -56,14 +56,6 @@ public class DefaultUserDefinedCS extend private static final long serialVersionUID = -4904091898305706316L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - private DefaultUserDefinedCS() { - } - - /** * Creates a new coordinate system from an arbitrary number of axes. This constructor is for * implementations of the {@link #createForAxes(Map, CoordinateSystemAxis[])} method only, * because it does not verify the number of axes. @@ -203,4 +195,26 @@ public class DefaultUserDefinedCS extend default: throw unexpectedDimension(properties, axes, 2); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + private DefaultUserDefinedCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -74,14 +74,6 @@ public class DefaultVerticalCS extends A private static final long serialVersionUID = 1201155778896630499L; /** - * Constructs a new coordinate system in which every attributes are set to a null or empty value. - * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, - * which will assign values to the fields using reflexion. - */ - private DefaultVerticalCS() { - } - - /** * Creates a new coordinate system from an arbitrary number of axes. This constructor is for * implementations of the {@link #createForAxes(Map, CoordinateSystemAxis[])} method only, * because it does not verify the number of axes. @@ -220,4 +212,26 @@ public class DefaultVerticalCS extends A default: throw unexpectedDimension(properties, axes, 1); } } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new coordinate system in which every attributes are set to a null or empty value. + * <strong>This is not a valid object.</strong> This constructor is strictly reserved to JAXB, + * which will assign values to the fields using reflexion. + */ + private DefaultVerticalCS() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -122,19 +122,6 @@ public class AbstractDatum extends Abstr private final InternationalString scope; /** - * Constructs a new object in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - AbstractDatum() { - super(org.apache.sis.internal.referencing.NilReferencingObject.INSTANCE); - anchorDefinition = null; - realizationEpoch = Long.MIN_VALUE; - domainOfValidity = null; - scope = null; - } - - /** * Creates a datum from the given properties. * The properties given in argument follow the same rules than for the * {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}. @@ -303,17 +290,6 @@ public class AbstractDatum extends Abstr } /** - * Invoked by JAXB only at unmarshalling time. - */ - private void setRealizationEpoch(final Date value) { - if (realizationEpoch == Long.MIN_VALUE) { - realizationEpoch = value.getTime(); - } else { - ReferencingUtilities.propertyAlreadySet(AbstractDatum.class, "setRealizationEpoch", "realizationEpoch"); - } - } - - /** * Returns the region or timeframe in which this datum is valid, or {@code null} if unspecified. * * @return Area or region or timeframe in which this datum is valid, or {@code null}. @@ -434,4 +410,42 @@ public class AbstractDatum extends Abstr protected long computeHashCode() { return super.computeHashCode() + Objects.hash(anchorDefinition, realizationEpoch, domainOfValidity, scope); } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new object in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + AbstractDatum() { + super(org.apache.sis.internal.referencing.NilReferencingObject.INSTANCE); + anchorDefinition = null; + realizationEpoch = Long.MIN_VALUE; + domainOfValidity = null; + scope = null; + } + + /** + * Invoked by JAXB only at unmarshalling time. + */ + private void setRealizationEpoch(final Date value) { + if (realizationEpoch == Long.MIN_VALUE) { + realizationEpoch = value.getTime(); + } else { + ReferencingUtilities.propertyAlreadySet(AbstractDatum.class, "setRealizationEpoch", "realizationEpoch"); + } + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -182,17 +182,6 @@ public class DefaultEllipsoid extends Ab private Unit<Length> unit; /** - * Constructs a new object in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultEllipsoid() { - super(org.apache.sis.internal.referencing.NilReferencingObject.INSTANCE); - // We need to let the DefaultEllipsoid fields unitialized - // because afterUnmarshal(…) will check for zero values. - } - - /** * Creates a new ellipsoid using the specified axis length. * The properties map is given unchanged to the * {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}. @@ -348,35 +337,6 @@ public class DefaultEllipsoid extends Ab } /** - * After the unmarshalling process, only one value between {@link #semiMinorAxis} and - * {@link #inverseFlattening} has been defined. Since the {@link #semiMajorAxis} has - * been defined, it is now possible to calculate the value of the missing parameter - * using the values of those that are set. - * - * <div class="note"><b>Note:</b> - * we use a method invoked from setter methods rather than defining an {@code afterUnmarshal(Unmarshaller, Object)} - * method (automatically invoked by JAXB) in order to avoid a dependency to the {@link javax.xml.bind.Unmarshaller} - * interface when the user does not want to read GML documents.</div> - * - * @see #setSemiMajorAxisMeasure(Measure) - * @see #setSecondDefiningParameter(SecondDefiningParameter) - */ - private void afterUnmarshal() { - if (ivfDefinitive) { - if (semiMinorAxis == 0) { - semiMinorAxis = Formulas.getSemiMinor(semiMajorAxis, inverseFlattening); - } - } else { - if (inverseFlattening == 0) { - inverseFlattening = Formulas.getInverseFlattening(semiMajorAxis, semiMinorAxis); - } - } - if (unit == null) { - Measure.missingUOM(DefaultEllipsoid.class, "semiMajorAxis"); - } - } - - /** * Returns the GeoAPI interface implemented by this class. * The SIS implementation returns {@code Ellipsoid.class}. * @@ -415,36 +375,6 @@ public class DefaultEllipsoid extends Ab } /** - * Returns the semi-major axis value as a measurement. - * This method is invoked by JAXB for XML marshalling. - */ - @XmlElement(name = "semiMajorAxis", required = true) - final Measure getSemiMajorAxisMeasure() { - return new Measure(semiMajorAxis, unit); - } - - /** - * Sets the semi-major axis value. - * This method is invoked by JAXB at unmarshalling time only. - * - * @see #setSecondDefiningParameter(SecondDefiningParameter) - * @see #afterUnmarshal() - */ - private void setSemiMajorAxisMeasure(final Measure measure) { - if (semiMajorAxis != 0) { - warnDuplicated("semiMajorAxis"); - } else { - final Unit<Length> uom = unit; // In case semi-minor were defined before semi-major. - ensureStrictlyPositive("semiMajorAxis", semiMajorAxis = measure.value); - unit = measure.getUnit(Length.class); - harmonizeAxisUnits(uom); - if ((ivfDefinitive ? inverseFlattening : semiMinorAxis) != 0) { - afterUnmarshal(); - } - } - } - - /** * Length of the semi-minor axis of the ellipsoid. This is the * polar radius in {@linkplain #getAxisUnit() axis linear unit}. * @@ -513,75 +443,6 @@ public class DefaultEllipsoid extends Ab } /** - * Returns the object to be marshalled as the {@code SecondDefiningParameter} XML element. The - * returned object contains the values for {@link #semiMinorAxis} or {@link #inverseFlattening}, - * according to the {@link #isIvfDefinitive()} value. This method is for JAXB marshalling only. - */ - @XmlElement(name = "secondDefiningParameter") - final SecondDefiningParameter getSecondDefiningParameter() { - return new SecondDefiningParameter(this, true); - } - - /** - * Sets the second defining parameter value, either the inverse of the flattening - * value or the semi minor axis value, according to what have been defined in the - * second defining parameter given. This is for JAXB unmarshalling process only. - * - * @see #setSemiMajorAxisMeasure(Measure) - * @see #afterUnmarshal() - */ - private void setSecondDefiningParameter(SecondDefiningParameter second) { - while (second.secondDefiningParameter != null) { - second = second.secondDefiningParameter; - } - final Measure measure = second.measure; - if (measure != null) { - final boolean isIvfDefinitive = second.isIvfDefinitive(); - if ((isIvfDefinitive ? inverseFlattening : semiMinorAxis) != 0) { - warnDuplicated("secondDefiningParameter"); - } else { - ivfDefinitive = isIvfDefinitive; - double value = measure.value; - if (isIvfDefinitive) { - if (value == 0) { - value = Double.POSITIVE_INFINITY; - } - ensureStrictlyPositive("inverseFlattening", inverseFlattening = value); - } else if (semiMinorAxis == 0) { - ensureStrictlyPositive("semiMinorAxis", semiMinorAxis = value); - harmonizeAxisUnits(measure.getUnit(Length.class)); - } - if (semiMajorAxis != 0) { - afterUnmarshal(); - } - } - } - } - - /** - * Ensures that the semi-minor axis uses the same unit than the semi-major one. - * The {@link #unit} field shall be set to the semi-major axis unit before this method call. - * - * @param uom The semi-minor axis unit. - */ - private void harmonizeAxisUnits(final Unit<Length> uom) { - if (unit == null) { - unit = uom; - } else if (uom != null && uom != unit) { - semiMinorAxis = uom.getConverterTo(unit).convert(semiMinorAxis); - } - } - - /** - * Emits a warning telling that the given element is repeated twice. - */ - private static void warnDuplicated(final String element) { - // We cheat a bit for the "unmarshal" method name since there is not such method... - Context.warningOccured(Context.current(), DefaultEllipsoid.class, "unmarshal", - Errors.class, Errors.Keys.DuplicatedElement_1, element); - } - - /** * {@code true} if the ellipsoid is degenerate and is actually a sphere. * The sphere is completely defined by the {@linkplain #getSemiMajorAxis() semi-major axis}, * which is the radius of the sphere. @@ -814,4 +675,157 @@ public class DefaultEllipsoid extends Ab } return WKTKeywords.Ellipsoid; } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new object in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultEllipsoid() { + super(org.apache.sis.internal.referencing.NilReferencingObject.INSTANCE); + // We need to let the DefaultEllipsoid fields unitialized + // because afterUnmarshal(…) will check for zero values. + } + + /** + * After the unmarshalling process, only one value between {@link #semiMinorAxis} and + * {@link #inverseFlattening} has been defined. Since the {@link #semiMajorAxis} has + * been defined, it is now possible to calculate the value of the missing parameter + * using the values of those that are set. + * + * <div class="note"><b>Note:</b> + * we use a method invoked from setter methods rather than defining an {@code afterUnmarshal(Unmarshaller, Object)} + * method (automatically invoked by JAXB) in order to avoid a dependency to the {@link javax.xml.bind.Unmarshaller} + * interface when the user does not want to read GML documents.</div> + * + * @see #setSemiMajorAxisMeasure(Measure) + * @see #setSecondDefiningParameter(SecondDefiningParameter) + */ + private void afterUnmarshal() { + if (ivfDefinitive) { + if (semiMinorAxis == 0) { + semiMinorAxis = Formulas.getSemiMinor(semiMajorAxis, inverseFlattening); + } + } else { + if (inverseFlattening == 0) { + inverseFlattening = Formulas.getInverseFlattening(semiMajorAxis, semiMinorAxis); + } + } + if (unit == null) { + Measure.missingUOM(DefaultEllipsoid.class, "semiMajorAxis"); + } + } + + /** + * Returns the semi-major axis value as a measurement. + * This method is invoked by JAXB for XML marshalling. + */ + @XmlElement(name = "semiMajorAxis", required = true) + private Measure getSemiMajorAxisMeasure() { + return new Measure(semiMajorAxis, unit); + } + + /** + * Sets the semi-major axis value. + * This method is invoked by JAXB at unmarshalling time only. + * + * @see #setSecondDefiningParameter(SecondDefiningParameter) + * @see #afterUnmarshal() + */ + private void setSemiMajorAxisMeasure(final Measure measure) { + if (semiMajorAxis != 0) { + warnDuplicated("semiMajorAxis"); + } else { + final Unit<Length> uom = unit; // In case semi-minor were defined before semi-major. + ensureStrictlyPositive("semiMajorAxis", semiMajorAxis = measure.value); + unit = measure.getUnit(Length.class); + harmonizeAxisUnits(uom); + if ((ivfDefinitive ? inverseFlattening : semiMinorAxis) != 0) { + afterUnmarshal(); + } + } + } + + /** + * Returns the object to be marshalled as the {@code SecondDefiningParameter} XML element. The + * returned object contains the values for {@link #semiMinorAxis} or {@link #inverseFlattening}, + * according to the {@link #isIvfDefinitive()} value. This method is for JAXB marshalling only. + */ + @XmlElement(name = "secondDefiningParameter") + private SecondDefiningParameter getSecondDefiningParameter() { + return new SecondDefiningParameter(this, true); + } + + /** + * Sets the second defining parameter value, either the inverse of the flattening + * value or the semi minor axis value, according to what have been defined in the + * second defining parameter given. This is for JAXB unmarshalling process only. + * + * @see #setSemiMajorAxisMeasure(Measure) + * @see #afterUnmarshal() + */ + private void setSecondDefiningParameter(SecondDefiningParameter second) { + while (second.secondDefiningParameter != null) { + second = second.secondDefiningParameter; + } + final Measure measure = second.measure; + if (measure != null) { + final boolean isIvfDefinitive = second.isIvfDefinitive(); + if ((isIvfDefinitive ? inverseFlattening : semiMinorAxis) != 0) { + warnDuplicated("secondDefiningParameter"); + } else { + ivfDefinitive = isIvfDefinitive; + double value = measure.value; + if (isIvfDefinitive) { + if (value == 0) { + value = Double.POSITIVE_INFINITY; + } + ensureStrictlyPositive("inverseFlattening", inverseFlattening = value); + } else if (semiMinorAxis == 0) { + ensureStrictlyPositive("semiMinorAxis", semiMinorAxis = value); + harmonizeAxisUnits(measure.getUnit(Length.class)); + } + if (semiMajorAxis != 0) { + afterUnmarshal(); + } + } + } + } + + /** + * Ensures that the semi-minor axis uses the same unit than the semi-major one. + * The {@link #unit} field shall be set to the semi-major axis unit before this method call. + * + * @param uom The semi-minor axis unit. + */ + private void harmonizeAxisUnits(final Unit<Length> uom) { + if (unit == null) { + unit = uom; + } else if (uom != null && uom != unit) { + semiMinorAxis = uom.getConverterTo(unit).convert(semiMinorAxis); + } + } + + /** + * Emits a warning telling that the given element is repeated twice. + */ + private static void warnDuplicated(final String element) { + // We cheat a bit for the "unmarshal" method name since there is not such method... + Context.warningOccured(Context.current(), DefaultEllipsoid.class, "unmarshal", + Errors.class, Errors.Keys.DuplicatedElement_1, element); + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -52,14 +52,6 @@ public class DefaultEngineeringDatum ext private static final long serialVersionUID = 1498304918725248637L; /** - * Constructs a new datum in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultEngineeringDatum() { - } - - /** * Creates an engineering datum from the given properties. The properties map is given * unchanged to the {@linkplain AbstractDatum#AbstractDatum(Map) super-class constructor}. * The following table is a reminder of main (not all) properties: @@ -187,4 +179,26 @@ public class DefaultEngineeringDatum ext } return WKTKeywords.EngineeringDatum; } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new datum in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultEngineeringDatum() { + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -169,17 +169,6 @@ public class DefaultGeodeticDatum extend private final BursaWolfParameters[] bursaWolf; /** - * Constructs a new datum in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultGeodeticDatum() { - ellipsoid = null; - primeMeridian = null; - bursaWolf = null; - } - - /** * Creates a geodetic datum from the given properties. The properties map is given * unchanged to the {@linkplain AbstractDatum#AbstractDatum(Map) super-class constructor}. * In addition to the properties documented in the parent constructor, @@ -344,6 +333,7 @@ public class DefaultGeodeticDatum extend * * @return The Bursa-Wolf parameters, or an empty array if none. */ + @SuppressWarnings("ReturnOfCollectionOrArrayField") public BursaWolfParameters[] getBursaWolfParameters() { if (bursaWolf == null) { return EMPTY_ARRAY; @@ -579,4 +569,29 @@ public class DefaultGeodeticDatum extend } return WKTKeywords.Datum; } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new datum in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultGeodeticDatum() { + ellipsoid = null; + primeMeridian = null; + bursaWolf = null; + } } Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java?rev=1701242&r1=1701241&r2=1701242&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java [UTF-8] Fri Sep 4 13:07:27 2015 @@ -66,15 +66,6 @@ public class DefaultImageDatum extends A private final PixelInCell pixelInCell; /** - * Constructs a new datum in which every attributes are set to a null value. - * <strong>This is not a valid object.</strong> This constructor is strictly - * reserved to JAXB, which will assign values to the fields using reflexion. - */ - private DefaultImageDatum() { - pixelInCell = null; - } - - /** * Creates an image datum from the given properties. The properties map is given * unchanged to the {@linkplain AbstractDatum#AbstractDatum(Map) super-class constructor}. * The following table is a reminder of main (not all) properties: @@ -254,4 +245,27 @@ public class DefaultImageDatum extends A } return WKTKeywords.ImageDatum; } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Constructs a new datum in which every attributes are set to a null value. + * <strong>This is not a valid object.</strong> This constructor is strictly + * reserved to JAXB, which will assign values to the fields using reflexion. + */ + private DefaultImageDatum() { + pixelInCell = null; + } }
