Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java?rev=1709629&r1=1709628&r2=1709629&view=diff ============================================================================== --- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java [UTF-8] (original) +++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java [UTF-8] Tue Oct 20 16:04:39 2015 @@ -33,6 +33,7 @@ import org.apache.sis.xml.ReferenceResol import org.apache.sis.internal.jaxb.Context; import org.apache.sis.internal.jaxb.PrimitiveTypeProperties; import org.apache.sis.util.iso.SimpleInternationalString; +import org.apache.sis.util.resources.Errors; /** @@ -601,6 +602,21 @@ public abstract class PropertyType<Value return metadata; } + /** + * Invoked by subclasses when the unmarshalled object is missing a component. + * This method is invoked when the missing component is essential to SIS working. + * This method is not invoked if the missing component is flagged as mandatory by GML, + * but is not mandatory for SIS working. + * + * @param missing The name of the missing XML component. + * @throws IllegalArgumentException Always thrown. + * + * @since 0.7 + */ + protected final void incomplete(final String missing) throws IllegalArgumentException { + throw new IllegalArgumentException(Errors.format(Errors.Keys.MissingComponentInElement_2, getBoundType(), missing)); + } + /* * Do not provide the following method here: *
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/EnumAdapter.java URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/EnumAdapter.java?rev=1709629&r1=1709628&r2=1709629&view=diff ============================================================================== --- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/EnumAdapter.java [UTF-8] (original) +++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/EnumAdapter.java [UTF-8] Tue Oct 20 16:04:39 2015 @@ -36,7 +36,7 @@ import org.apache.sis.util.iso.Types; * * @author Martin Desruisseaux (Geomatys) * @since 0.5 - * @version 0.5 + * @version 0.6 * @module */ public abstract class EnumAdapter<ValueType extends EnumAdapter<ValueType,BoundType>, Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java?rev=1709629&r1=1709628&r2=1709629&view=diff ============================================================================== --- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java [UTF-8] (original) +++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/SC_VerticalCRS.java [UTF-8] Tue Oct 20 16:04:39 2015 @@ -21,6 +21,7 @@ import org.opengis.referencing.crs.Verti import org.apache.sis.internal.jaxb.gco.PropertyType; import org.apache.sis.internal.jaxb.Context; import org.apache.sis.util.resources.Errors; +import org.apache.sis.util.Classes; /** @@ -61,7 +62,7 @@ import org.apache.sis.util.resources.Err * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) * @since 0.3 - * @version 0.3 + * @version 0.7 * @module * * @see org.apache.sis.internal.jaxb.AdapterReplacement @@ -126,11 +127,16 @@ public class SC_VerticalCRS extends Prop * of {@link VerticalCRS}, then this method assigns that value to the {@link #metadata} field. * Otherwise this method does nothing. * - * @param metadata The unmarshalled metadata. + * @param crs The unmarshalled metadata. */ - public final void setElement(final Object metadata) { - if (metadata instanceof VerticalCRS) { - this.metadata = (VerticalCRS) metadata; + public final void setElement(final Object crs) { + if (crs instanceof VerticalCRS) { + metadata = (VerticalCRS) crs; + if (metadata.getCoordinateSystem() == null) incomplete("coordinateSystem"); + if (metadata.getDatum() == null) incomplete("verticalDatum"); + } else { + Context.warningOccured(Context.current(), SC_VerticalCRS.class, "setElement", Errors.class, + Errors.Keys.UnexpectedValueInElement_2, "verticalCRS", Classes.getShortClassName(crs)); } } } Modified: sis/branches/JDK6/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml URL: http://svn.apache.org/viewvc/sis/branches/JDK6/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml?rev=1709629&r1=1709628&r2=1709629&view=diff ============================================================================== --- sis/branches/JDK6/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml (original) +++ sis/branches/JDK6/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml Tue Oct 20 16:04:39 2015 @@ -33,9 +33,6 @@ <fra:FRA_DirectReferenceSystem> <gmd:referenceSystemIdentifier> <gmd:RS_Identifier> - <gmd:code> - <gco:CharacterString>4326</gco:CharacterString> - </gmd:code> <gmd:authority> <gmd:CI_Citation> <gmd:title> @@ -67,6 +64,9 @@ </gmd:citedResponsibleParty> </gmd:CI_Citation> </gmd:authority> + <gmd:code> + <gco:CharacterString>4326</gco:CharacterString> + </gmd:code> </gmd:RS_Identifier> </gmd:referenceSystemIdentifier> </fra:FRA_DirectReferenceSystem> Modified: sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1709629&r1=1709628&r2=1709629&view=diff ============================================================================== --- sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] (original) +++ sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] Tue Oct 20 16:04:39 2015 @@ -38,7 +38,7 @@ import static org.apache.sis.test.TestUt * * @author Martin Desruisseaux (Geomatys) * @since 0.3 - * @version 0.3 + * @version 0.7 * @module */ @DependsOn({ @@ -114,9 +114,9 @@ public final strictfp class MetadataRead " │ │ │ ├─Date……………………………………………………………………… 2005-09-22 00:00:00\n" + " │ │ │ └─Date type………………………………………………………… Creation\n" + " │ │ ├─Identifier\n" + - " │ │ │ ├─Code……………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" + - " │ │ │ └─Authority\n" + - " │ │ │ └─Title………………………………………………………… edu.ucar.unidata\n" + + " │ │ │ ├─Authority\n" + + " │ │ │ │ └─Title………………………………………………………… edu.ucar.unidata\n" + + " │ │ │ └─Code……………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" + " │ │ └─Cited responsible party\n" + " │ │ ├─Party\n" + " │ │ │ └─Name…………………………………………………………… NOAA/NWS/NCEP\n" + @@ -157,9 +157,9 @@ public final strictfp class MetadataRead " ├─Metadata scope\n" + " │ └─Resource scope………………………………………………………………… Dataset\n" + " ├─Metadata identifier\n" + - " │ ├─Code…………………………………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" + - " │ └─Authority\n" + - " │ └─Title……………………………………………………………………………… edu.ucar.unidata\n" + + " │ ├─Authority\n" + + " │ │ └─Title……………………………………………………………………………… edu.ucar.unidata\n" + + " │ └─Code…………………………………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" + " ├─Metadata standard (1 of 2)\n" + " │ ├─Title………………………………………………………………………………………… Geographic Information — Metadata Part 1: Fundamentals\n" + " │ ├─Cited responsible party\n" +