sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tlpin...@apache.org
Subject svn commit: r1517321 [5/16] - in /sis/branches/Shapefile: ./ application/ application/sis-console/ application/sis-console/src/main/artifact/ application/sis-console/src/main/java/org/apache/sis/console/ application/sis-console/src/main/resources/org/a...
Date Sun, 25 Aug 2013 15:49:59 GMT
Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/DefaultRequirement.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -90,7 +90,7 @@ public class DefaultRequirement extends 
      * Date and time after which collection is no longer valid,
      * or {@link Long#MIN_VALUE} if none.
      */
-    private long expiryDate;
+    private long expiryDate = Long.MIN_VALUE;
 
     /**
      * Plan that identifies solution to satisfy the requirement.
@@ -101,7 +101,6 @@ public class DefaultRequirement extends 
      * Constructs an initially empty requirement.
      */
     public DefaultRequirement() {
-        expiryDate = Long.MIN_VALUE;
     }
 
     /**
@@ -109,20 +108,22 @@ public class DefaultRequirement extends 
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Requirement)
      */
     public DefaultRequirement(final Requirement object) {
         super(object);
-        citation       = object.getCitation();
-        identifiers    = singleton(object.getIdentifier(), Identifier.class); // TODO
-        requestors     = copyCollection(object.getRequestors(), ResponsibleParty.class);
-        recipients     = copyCollection(object.getRecipients(), ResponsibleParty.class);
-        priority       = object.getPriority();
-        requestedDate  = object.getRequestedDate();
-        expiryDate     = toMilliseconds(object.getExpiryDate());
-        satisfiedPlans = copyCollection(object.getSatisfiedPlans(), Plan.class);
+        if (object != null) {
+            citation       = object.getCitation();
+            identifiers    = singleton(object.getIdentifier(), Identifier.class);
+            requestors     = copyCollection(object.getRequestors(), ResponsibleParty.class);
+            recipients     = copyCollection(object.getRecipients(), ResponsibleParty.class);
+            priority       = object.getPriority();
+            requestedDate  = object.getRequestedDate();
+            expiryDate     = toMilliseconds(object.getExpiryDate());
+            satisfiedPlans = copyCollection(object.getSatisfiedPlans(), Plan.class);
+        }
     }
 
     /**
@@ -153,6 +154,8 @@ public class DefaultRequirement extends 
     /**
      * Returns the identification of reference or guidance material for the requirement.
      * {@code null} if unspecified.
+     *
+     * @return Identification of reference or guidance material, or {@code null}.
      */
     @Override
     @XmlElement(name = "citation")
@@ -172,6 +175,8 @@ public class DefaultRequirement extends 
 
     /**
      * Returns the unique name, or code, for the requirement.
+     *
+     * @return Unique name or code, or {@code null}.
      */
     @Override
     @XmlElement(name = "identifier", required = true)
@@ -192,6 +197,8 @@ public class DefaultRequirement extends 
 
     /**
      * Returns the origin of requirement.
+     *
+     * @return Origin of requirement.
      */
     @Override
     @XmlElement(name = "requestor", required = true)
@@ -210,6 +217,8 @@ public class DefaultRequirement extends 
 
     /**
      * Returns the person(s), or body(ies), to receive results of requirement.
+     *
+     * @return Person(s), or body(ies), to receive results.
      */
     @Override
     @XmlElement(name = "recipient", required = true)
@@ -228,6 +237,8 @@ public class DefaultRequirement extends 
 
     /**
      * Returns the relative ordered importance, or urgency, of the requirement.
+     *
+     * @return Relative ordered importance, or urgency, or {@code null}.
      */
     @Override
     @XmlElement(name = "priority", required = true)
@@ -247,6 +258,8 @@ public class DefaultRequirement extends 
 
     /**
      * Returns the required or preferred acquisition date and time.
+     *
+     * @return Required or preferred acquisition date and time, or {@code null}.
      */
     @Override
     @XmlElement(name = "requestedDate", required = true)
@@ -266,6 +279,8 @@ public class DefaultRequirement extends 
 
     /**
      * Returns the date and time after which collection is no longer valid.
+     *
+     * @return Date and time after which collection is no longer valid, or {@code null}.
      */
     @Override
     @XmlElement(name = "expiryDate", required = true)
@@ -285,6 +300,8 @@ public class DefaultRequirement extends 
 
     /**
      * Returns the plan that identifies solution to satisfy the requirement.
+     *
+     * @return Plan that identifies solution to satisfy the requirement.
      */
     @Override
     @XmlElement(name = "satisfiedPlan")

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -122,7 +122,7 @@
     @XmlJavaTypeAdapter(MI_TriggerCode.class),
 
     // Java types, primitive types and basic OGC types handling
-//  @XmlJavaTypeAdapter(GO_DateTime.class), // TODO
+    @XmlJavaTypeAdapter(GO_DateTime.class),
     @XmlJavaTypeAdapter(StringAdapter.class),
     @XmlJavaTypeAdapter(InternationalStringAdapter.class)
 })

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -193,13 +193,34 @@ public final class Citations extends Sta
     }
 
     /**
-     * Returns the shortest identifier for the specified citation, or the title if there is
-     * no identifier. This method is useful for extracting the namespace from an authority,
-     * for example {@code "EPSG"}.
+     * Infers an identifier from the given citation, or returns {@code null} if no identifier has been found.
+     * This method is useful for extracting the namespace from an authority, for example {@code "EPSG"}.
+     * The implementation performs the following choices:
+     *
+     * <ul>
+     *   <li>If the given citation is {@code null}, then this method returns {@code null}.</li>
+     *   <li>Otherwise if the citation contains at least one {@linkplain Citation#getIdentifiers() identifier}, then:
+     *     <ul>
+     *       <li>If at least one identifier is a {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier
+     *           unicode identifier}, then the shortest of those identifiers is returned.</li>
+     *       <li>Otherwise the shortest identifier is returned, despite not being a Unicode identifier.</li>
+     *     </ul></li>
+     *   <li>Otherwise if the citation contains at least one {@linkplain Citation#getTitle() title} or
+     *       {@linkplain Citation#getAlternateTitles() alternate title}, then:
+     *     <ul>
+     *       <li>If at least one title is a {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier
+     *           unicode identifier}, then the shortest of those titles is returned.</li>
+     *       <li>Otherwise the shortest title is returned, despite not being a Unicode identifier.</li>
+     *     </ul></li>
+     *   <li>Otherwise this method returns {@code null}.</li>
+     * </ul>
+     *
+     * This method searches in alternate titles as a fallback because ISO specification said
+     * that those titles are often used for abbreviations.
      *
      * @param  citation The citation for which to get the identifier, or {@code null}.
-     * @return The shortest identifier of the given citation, or {@code null} if the
-     *         given citation was null or doesn't declare any identifier or title.
+     * @return An identifier for the given citation, or {@code null} if the given citation is null
+     *         or does not declare any identifier or title.
      */
     public static String getIdentifier(final Citation citation) {
         return org.apache.sis.internal.util.Citations.getIdentifier(citation);

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultAddress.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultAddress.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultAddress.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultAddress.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -91,18 +91,20 @@ public class DefaultAddress extends ISOM
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Address)
      */
     public DefaultAddress(final Address object) {
         super(object);
-        deliveryPoints          = copyCollection(object.getDeliveryPoints(), String.class);
-        city                    = object.getCity();
-        administrativeArea      = object.getAdministrativeArea();
-        postalCode              = object.getPostalCode();
-        country                 = object.getCountry();
-        electronicMailAddresses = copyCollection(object.getElectronicMailAddresses(), String.class);
+        if (object != null) {
+            deliveryPoints          = copyCollection(object.getDeliveryPoints(), String.class);
+            city                    = object.getCity();
+            administrativeArea      = object.getAdministrativeArea();
+            postalCode              = object.getPostalCode();
+            country                 = object.getCountry();
+            electronicMailAddresses = copyCollection(object.getElectronicMailAddresses(), String.class);
+        }
     }
 
     /**
@@ -132,6 +134,8 @@ public class DefaultAddress extends ISOM
 
     /**
      * Return the state, province of the location.
+     *
+     * @return State, province of the location, or {@code null}.
      */
     @Override
     @XmlElement(name = "administrativeArea")
@@ -151,6 +155,8 @@ public class DefaultAddress extends ISOM
 
     /**
      * Returns the city of the location.
+     *
+     * @return The city of the location, or {@code null}.
      */
     @Override
     @XmlElement(name = "city")
@@ -170,6 +176,8 @@ public class DefaultAddress extends ISOM
 
     /**
      * Returns the country of the physical address.
+     *
+     * @return Country of the physical address, or {@code null}.
      */
     @Override
     @XmlElement(name = "country")
@@ -189,6 +197,8 @@ public class DefaultAddress extends ISOM
 
     /**
      * Returns the address line for the location (as described in ISO 11180, Annex A).
+     *
+     * @return Address line for the location.
      */
     @Override
     @XmlElement(name = "deliveryPoint")
@@ -207,6 +217,8 @@ public class DefaultAddress extends ISOM
 
     /**
      * Returns the address of the electronic mailbox of the responsible organization or individual.
+     *
+     * @return Address of the electronic mailbox of the responsible organization or individual.
      */
     @Override
     @XmlElement(name = "electronicMailAddress")
@@ -225,6 +237,8 @@ public class DefaultAddress extends ISOM
 
     /**
      * Returns ZIP or other postal code.
+     *
+     * @return ZIP or other postal code, or {@code null}.
      */
     @Override
     @XmlElement(name = "postalCode")

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -33,6 +33,7 @@ import org.apache.sis.util.iso.SimpleInt
 import org.apache.sis.internal.jaxb.NonMarshalledAuthority;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.xml.IdentifierSpace;
+import org.apache.sis.xml.IdentifierMap;
 
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
 import static org.apache.sis.internal.metadata.MetadataUtilities.toDate;
@@ -121,7 +122,7 @@ public class DefaultCitation extends ISO
      * Date of the edition in milliseconds elapsed sine January 1st, 1970,
      * or {@link Long#MIN_VALUE} if none.
      */
-    private long editionDate;
+    private long editionDate = Long.MIN_VALUE;
 
     /**
      * Name and position information for an individual or organization that is responsible
@@ -157,7 +158,6 @@ public class DefaultCitation extends ISO
      * Constructs an initially empty citation.
      */
     public DefaultCitation() {
-        editionDate = Long.MIN_VALUE;
     }
 
     /**
@@ -167,7 +167,6 @@ public class DefaultCitation extends ISO
      *        or {@code null} if none.
      */
     public DefaultCitation(final CharSequence title) {
-        this(); // Initialize the date field.
         this.title = Types.toInternationalString(title);
     }
 
@@ -183,7 +182,6 @@ public class DefaultCitation extends ISO
      *              responsible for the resource, or {@code null} if none.
      */
     public DefaultCitation(final ResponsibleParty party) {
-        this(); // Initialize the date field.
         if (party != null) {
             citedResponsibleParties = singleton(party, ResponsibleParty.class);
             title = party.getOrganisationName();
@@ -204,25 +202,32 @@ public class DefaultCitation extends ISO
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Citation)
      */
     public DefaultCitation(final Citation object) {
         super(object);
-        title                   = object.getTitle();
-        alternateTitles         = copyCollection(object.getAlternateTitles(), InternationalString.class);
-        dates                   = copyCollection(object.getDates(), CitationDate.class);
-        edition                 = object.getEdition();
-        editionDate             = toMilliseconds(object.getEditionDate());
-        identifiers             = copyCollection(object.getIdentifiers(), Identifier.class);
-        citedResponsibleParties = copyCollection(object.getCitedResponsibleParties(), ResponsibleParty.class);
-        presentationForms       = copyCollection(object.getPresentationForms(), PresentationForm.class);
-        series                  = object.getSeries();
-        otherCitationDetails    = object.getOtherCitationDetails();
-        collectiveTitle         = object.getCollectiveTitle();
-// TODO ISBN                    = object.getISBN();
-// TODO ISSN                    = object.getISSN();
+        if (object != null) {
+            title                   = object.getTitle();
+            alternateTitles         = copyCollection(object.getAlternateTitles(), InternationalString.class);
+            dates                   = copyCollection(object.getDates(), CitationDate.class);
+            edition                 = object.getEdition();
+            editionDate             = toMilliseconds(object.getEditionDate());
+            identifiers             = copyCollection(object.getIdentifiers(), Identifier.class);
+            citedResponsibleParties = copyCollection(object.getCitedResponsibleParties(), ResponsibleParty.class);
+            presentationForms       = copyCollection(object.getPresentationForms(), PresentationForm.class);
+            series                  = object.getSeries();
+            otherCitationDetails    = object.getOtherCitationDetails();
+            collectiveTitle         = object.getCollectiveTitle();
+            final String id1        = object.getISBN();
+            final String id2        = object.getISSN();
+            if (id1 != null || id2 != null) {
+                final IdentifierMap map = super.getIdentifierMap();
+                if (id1 != null) map.putSpecialized(ISBN, id1);
+                if (id2 != null) map.putSpecialized(ISSN, id2);
+            }
+        }
     }
 
     /**
@@ -252,6 +257,8 @@ public class DefaultCitation extends ISO
 
     /**
      * Returns the name by which the cited resource is known.
+     *
+     * @return The cited resource name, or {@code null}.
      */
     @Override
     @XmlElement(name = "title", required = true)
@@ -272,6 +279,8 @@ public class DefaultCitation extends ISO
     /**
      * Returns the short name or other language name by which the cited information is known.
      * Example: "DCW" as an alternative title for "<cite>Digital Chart of the World</cite>".
+     *
+     * @return Other names for the resource, or an empty collection if none.
      */
     @Override
     @XmlElement(name = "alternateTitle")
@@ -290,6 +299,8 @@ public class DefaultCitation extends ISO
 
     /**
      * Returns the reference date for the cited resource.
+     *
+     * @return The reference date.
      */
     @Override
     @XmlElement(name = "date", required = true)
@@ -308,6 +319,8 @@ public class DefaultCitation extends ISO
 
     /**
      * Returns the version of the cited resource.
+     *
+     * @return The version, or {@code null} if none.
      */
     @Override
     @XmlElement(name = "edition")
@@ -327,6 +340,8 @@ public class DefaultCitation extends ISO
 
     /**
      * Returns the date of the edition.
+     *
+     * @return The edition date, or {@code null} if none.
      */
     @Override
     @XmlElement(name = "editionDate")
@@ -358,6 +373,8 @@ public class DefaultCitation extends ISO
      *        all the above cited identifiers, for ISO 19139 compliance. Those identifiers
      *        will appear in other XML elements or attributes.}
      *
+     * @return The identifiers, or an empty collection if none.
+     *
      * @see #getISBN()
      * @see #getISSN()
      * @see #getIdentifierMap()
@@ -393,6 +410,8 @@ public class DefaultCitation extends ISO
     /**
      * Returns the name and position information for an individual or organization that is
      * responsible for the resource.
+     *
+     * @return The individual or organization that is responsible, or an empty collection if none.
      */
     @Override
     @XmlElement(name = "citedResponsibleParty")
@@ -412,6 +431,8 @@ public class DefaultCitation extends ISO
 
     /**
      * Returns the mode in which the resource is represented.
+     *
+     * @return The presentation modes, or an empty collection if none.
      */
     @Override
     @XmlElement(name = "presentationForm")
@@ -430,6 +451,8 @@ public class DefaultCitation extends ISO
 
     /**
      * Returns the information about the series, or aggregate dataset, of which the dataset is a part.
+     *
+     * @return The series of which the dataset is a part, or {@code null} if none.
      */
     @Override
     @XmlElement(name = "series")
@@ -449,6 +472,8 @@ public class DefaultCitation extends ISO
 
     /**
      * Returns other information required to complete the citation that is not recorded elsewhere.
+     *
+     * @return Other details, or {@code null} if none.
      */
     @Override
     @XmlElement(name = "otherCitationDetails")
@@ -467,9 +492,10 @@ public class DefaultCitation extends ISO
     }
 
     /**
-     * Returns the common title with holdings note. Note: title identifies elements of a series
-     * collectively, combined with information about what volumes are available at the
-     * source cited.
+     * Returns the common title with holdings note. Note: title identifies elements of a series collectively,
+     * combined with information about what volumes are available at the source cited.
+     *
+     * @return The common title, or {@code null} if none.
      */
     @Override
     @XmlElement(name = "collectiveTitle")
@@ -478,8 +504,8 @@ public class DefaultCitation extends ISO
     }
 
     /**
-     * Sets the common title with holdings note. This title identifies elements of a series
-     * collectively, combined with information about what volumes are available at the source cited.
+     * Sets the common title with holdings note. This title identifies elements of a series collectively,
+     * combined with information about what volumes are available at the source cited.
      *
      * @param newValue The new collective title, or {@code null} if none.
      */
@@ -496,6 +522,8 @@ public class DefaultCitation extends ISO
      *   return getIdentifierMap().getSpecialized(Citations.ISBN);
      * }
      *
+     * @return The ISBN, or {@code null} if none.
+     *
      * @see #getIdentifiers()
      * @see Citations#ISBN
      */
@@ -533,6 +561,8 @@ public class DefaultCitation extends ISO
      *   return getIdentifierMap().getSpecialized(Citations.ISSN);
      * }
      *
+     * @return The ISSN, or {@code null} if none.
+     *
      * @see #getIdentifiers()
      * @see Citations#ISSN
      */

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -52,7 +52,7 @@ public class DefaultCitationDate extends
      * Reference date for the cited resource in milliseconds elapsed sine January 1st, 1970,
      * or {@link Long#MIN_VALUE} if none.
      */
-    private long date;
+    private long date = Long.MIN_VALUE;
 
     /**
      * Event used for reference date.
@@ -63,7 +63,6 @@ public class DefaultCitationDate extends
      * Constructs an initially empty citation date.
      */
     public DefaultCitationDate() {
-        date = Long.MIN_VALUE;
     }
 
     /**
@@ -82,14 +81,16 @@ public class DefaultCitationDate extends
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(CitationDate)
      */
     public DefaultCitationDate(final CitationDate object) {
         super(object);
-        date     = toMilliseconds(object.getDate());
-        dateType = object.getDateType();
+        if (object != null) {
+            date     = toMilliseconds(object.getDate());
+            dateType = object.getDateType();
+        }
     }
 
     /**
@@ -119,6 +120,8 @@ public class DefaultCitationDate extends
 
     /**
      * Returns the reference date for the cited resource.
+     *
+     * @return Reference date for the cited resource, or {@code null}.
      */
     @Override
     @XmlElement(name = "date", required = true)
@@ -138,6 +141,8 @@ public class DefaultCitationDate extends
 
     /**
      * Returns the event used for reference date.
+     *
+     * @return Event used for reference date, or {@code null}.
      */
     @Override
     @XmlElement(name = "dateType", required = true)

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -97,17 +97,19 @@ public class DefaultContact extends ISOM
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Contact)
      */
     public DefaultContact(final Contact object) {
         super(object);
-        phone               = object.getPhone();
-        address             = object.getAddress();
-        onlineResource      = object.getOnlineResource();
-        hoursOfService      = object.getHoursOfService();
-        contactInstructions = object.getContactInstructions();
+        if (object != null) {
+            phone               = object.getPhone();
+            address             = object.getAddress();
+            onlineResource      = object.getOnlineResource();
+            hoursOfService      = object.getHoursOfService();
+            contactInstructions = object.getContactInstructions();
+        }
     }
 
     /**
@@ -137,6 +139,8 @@ public class DefaultContact extends ISOM
 
     /**
      * Returns telephone numbers at which the organization or individual may be contacted.
+     *
+     * @return Telephone numbers at which the organization or individual may be contacted, or {@code null}.
      */
     @Override
     @XmlElement(name = "phone")
@@ -156,6 +160,8 @@ public class DefaultContact extends ISOM
 
     /**
      * Returns the physical and email address at which the organization or individual may be contacted.
+     *
+     * @return Physical and email address at which the organization or individual may be contacted, or {@code null}.
      */
     @Override
     @XmlElement(name = "address")
@@ -175,6 +181,8 @@ public class DefaultContact extends ISOM
 
     /**
      * Return on-line information that can be used to contact the individual or organization.
+     *
+     * @return On-line information that can be used to contact the individual or organization, or {@code null}.
      */
     @Override
     @XmlElement(name = "onlineResource")
@@ -193,8 +201,9 @@ public class DefaultContact extends ISOM
     }
 
     /**
-     * Returns the time period (including time zone) when individuals can contact the organization
-     * or individual.
+     * Returns the time period (including time zone) when individuals can contact the organization or individual.
+     *
+     * @return Time period when individuals can contact the organization or individual, or {@code null}.
      */
     @Override
     @XmlElement(name = "hoursOfService")
@@ -203,8 +212,7 @@ public class DefaultContact extends ISOM
     }
 
     /**
-     * Sets time period (including time zone) when individuals can contact the organization or
-     * individual.
+     * Sets time period (including time zone) when individuals can contact the organization or individual.
      *
      * @param newValue The new hours of service, or {@code null} if none.
      */
@@ -215,6 +223,8 @@ public class DefaultContact extends ISOM
 
     /**
      * Returns supplemental instructions on how or when to contact the individual or organization.
+     *
+     * @return Supplemental instructions on how or when to contact the individual or organization, or {@code null}.
      */
     @Override
     @XmlElement(name = "contactInstructions")

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -104,18 +104,20 @@ public class DefaultOnlineResource exten
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(OnlineResource)
      */
     public DefaultOnlineResource(final OnlineResource object) {
         super(object);
-        linkage            = object.getLinkage();
-        protocol           = object.getProtocol();
-        applicationProfile = object.getApplicationProfile();
-        name               = object.getName();
-        description        = object.getDescription();
-        function           = object.getFunction();
+        if (object != null) {
+            linkage            = object.getLinkage();
+            protocol           = object.getProtocol();
+            applicationProfile = object.getApplicationProfile();
+            name               = object.getName();
+            description        = object.getDescription();
+            function           = object.getFunction();
+        }
     }
 
     /**
@@ -146,6 +148,8 @@ public class DefaultOnlineResource exten
     /**
      * Returns the name of an application profile that can be used with the online resource.
      * Returns {@code null} if none.
+     *
+     * @return Application profile that can be used with the online resource, or {@code null}.
      */
     @Override
     @XmlElement(name = "applicationProfile")
@@ -165,6 +169,8 @@ public class DefaultOnlineResource exten
 
     /**
      * Name of the online resource. Returns {@code null} if none.
+     *
+     * @return Name of the online resource, or {@code null}.
      */
     @Override
     @XmlElement(name = "name")
@@ -184,6 +190,8 @@ public class DefaultOnlineResource exten
 
     /**
      * Returns the detailed text description of what the online resource is/does.
+     *
+     * @return Text description of what the online resource is/does, or {@code null}.
      */
     @Override
     @XmlElement(name = "description")
@@ -203,6 +211,8 @@ public class DefaultOnlineResource exten
 
     /**
      * Returns the code for function performed by the online resource.
+     *
+     * @return Function performed by the online resource, or {@code null}.
      */
     @Override
     @XmlElement(name = "function")
@@ -223,6 +233,8 @@ public class DefaultOnlineResource exten
     /**
      * Returns the location (address) for on-line access using a Uniform Resource Locator address or
      * similar addressing scheme such as "{@code http://www.statkart.no/isotc211}".
+     *
+     * @return Location for on-line access using a Uniform Resource Locator address or similar scheme, or {@code null}.
      */
     @Override
     @XmlElement(name = "linkage", required = true)
@@ -242,18 +254,13 @@ public class DefaultOnlineResource exten
     }
 
     /**
-     * Returns the connection protocol to be used. If no protocol has been {@linkplain #setProtocol(String)
-     * explicitely set}, then this method returns the {@linkplain #getLinkage() linkage}
-     * {@linkplain URI#getScheme() scheme} (if any).
+     * Returns the connection protocol to be used.
      *
-     * @see <a href="../doc-files/auto-properties.html">List of automatic properties</a>
+     * @return Connection protocol to be used, or {@code null}.
      */
     @Override
     @XmlElement(name = "protocol")
     public String getProtocol() {
-        if (protocol == null && linkage != null) {
-            return linkage.getScheme();
-        }
         return protocol;
     }
 

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -96,17 +96,19 @@ public class DefaultResponsibleParty ext
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(ResponsibleParty)
      */
     public DefaultResponsibleParty(final ResponsibleParty object) {
         super(object);
-        individualName   = object.getIndividualName();
-        organisationName = object.getOrganisationName();
-        positionName     = object.getPositionName();
-        contactInfo      = object.getContactInfo();
-        role             = object.getRole();
+        if (object != null) {
+            individualName   = object.getIndividualName();
+            organisationName = object.getOrganisationName();
+            positionName     = object.getPositionName();
+            contactInfo      = object.getContactInfo();
+            role             = object.getRole();
+        }
     }
 
     /**
@@ -136,8 +138,10 @@ public class DefaultResponsibleParty ext
 
     /**
      * Returns the name of the responsible person- surname, given name, title separated by a delimiter.
-     * Only one of {@code individualName}, {@link #getOrganisationName organisationName}
-     * and {@link #getPositionName positionName} should be provided.
+     * Only one of {@code individualName}, {@link #getOrganisationName() organisationName}
+     * and {@link #getPositionName() positionName} shall be provided.
+     *
+     * @return Name, surname, given name and title of the responsible person, or {@code null}.
      */
     @Override
     @XmlElement(name = "individualName")
@@ -147,8 +151,8 @@ public class DefaultResponsibleParty ext
 
     /**
      * Sets the name of the responsible person- surname, given name, title separated by a delimiter.
-     * Only one of {@code individualName}, {@link #getOrganisationName organisationName}
-     * and {@link #getPositionName positionName} should be provided.
+     * Only one of {@code individualName}, {@link #getOrganisationName() organisationName}
+     * and {@link #getPositionName() positionName} shall be provided.
      *
      * @param newValue The new individual name, or {@code null} if none.
      */
@@ -159,8 +163,10 @@ public class DefaultResponsibleParty ext
 
     /**
      * Returns the name of the responsible organization. Only one of
-     * {@link #getIndividualName individualName}, {@code organisationName}
-     * and {@link #getPositionName positionName} should be provided.
+     * {@link #getIndividualName() individualName}, {@code organisationName}
+     * and {@link #getPositionName() positionName} shall be provided.
+     *
+     * @return Name of the responsible organization, or {@code null}.
      */
     @Override
     @XmlElement(name = "organisationName")
@@ -170,10 +176,10 @@ public class DefaultResponsibleParty ext
 
     /**
      * Sets the name of the responsible organization. Only one of
-     * {@link #getIndividualName individualName}, {@code organisationName}
-     * and {@link #getPositionName positionName} should be provided.
+     * {@link #getIndividualName() individualName}, {@code organisationName}
+     * and {@link #getPositionName() positionName} shall be provided.
      *
-     * @param newValue The new organisation name, or {@code null} if none.
+     * @param newValue The new organization name, or {@code null} if none.
      */
     public void setOrganisationName(final InternationalString newValue) {
         checkWritePermission();
@@ -182,8 +188,10 @@ public class DefaultResponsibleParty ext
 
     /**
      * Returns the role or position of the responsible person Only one of
-     * {@link #getIndividualName individualName}, {@link #getOrganisationName organisationName}
-     * and {@code positionName} should be provided.
+     * {@link #getIndividualName() individualName}, {@link #getOrganisationName() organisationName}
+     * and {@code positionName} shall be provided.
+     *
+     * @return Role or position of the responsible person, or {@code null}
      */
     @Override
     @XmlElement(name = "positionName")
@@ -193,8 +201,8 @@ public class DefaultResponsibleParty ext
 
     /**
      * set the role or position of the responsible person Only one of
-     * {@link #getIndividualName individualName}, {@link #getOrganisationName organisationName}
-     * and {@code positionName} should be provided.
+     * {@link #getIndividualName() individualName}, {@link #getOrganisationName() organisationName}
+     * and {@code positionName} shall be provided.
      *
      * @param newValue The new position name, or {@code null} if none.
      */
@@ -205,6 +213,8 @@ public class DefaultResponsibleParty ext
 
     /**
      * Returns the address of the responsible party.
+     *
+     * @return Address of the responsible party, or {@code null}.
      */
     @Override
     @XmlElement(name = "contactInfo")
@@ -224,6 +234,8 @@ public class DefaultResponsibleParty ext
 
     /**
      * Returns the function performed by the responsible party.
+     *
+     * @return Function performed by the responsible party, or {@code null}.
      */
     @Override
     @XmlElement(name = "role", required = true)

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultSeries.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultSeries.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultSeries.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultSeries.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -81,15 +81,17 @@ public class DefaultSeries extends ISOMe
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Series)
      */
     public DefaultSeries(final Series object) {
         super(object);
-        name                = object.getName();
-        issueIdentification = object.getIssueIdentification();
-        page                = object.getPage();
+        if (object != null) {
+            name                = object.getName();
+            issueIdentification = object.getIssueIdentification();
+            page                = object.getPage();
+        }
     }
 
     /**
@@ -119,6 +121,8 @@ public class DefaultSeries extends ISOMe
 
     /**
      * Returns the name of the series, or aggregate dataset, of which the dataset is a part.
+     *
+     * @return The name of the series or aggregate dataset, or {@code null}.
      */
     @Override
     @XmlElement(name = "name")
@@ -138,6 +142,8 @@ public class DefaultSeries extends ISOMe
 
     /**
      * Returns information identifying the issue of the series.
+     *
+     * @return Information identifying the issue of the series, or {@code null}.
      */
     @Override
     @XmlElement(name = "issueIdentification")
@@ -157,6 +163,8 @@ public class DefaultSeries extends ISOMe
 
     /**
      * Returns details on which pages of the publication the article was published.
+     *
+     * @return Details on which pages of the publication the article was published, or {@code null}.
      */
     @Override
     @XmlElement(name = "page")

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -65,14 +65,16 @@ public class DefaultTelephone extends IS
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Telephone)
      */
     public DefaultTelephone(final Telephone object) {
         super(object);
-        voices     = copyCollection(object.getVoices(), String.class);
-        facsimiles = copyCollection(object.getFacsimiles(), String.class);
+        if (object != null) {
+            voices     = copyCollection(object.getVoices(), String.class);
+            facsimiles = copyCollection(object.getFacsimiles(), String.class);
+        }
     }
 
     /**
@@ -101,8 +103,9 @@ public class DefaultTelephone extends IS
     }
 
     /**
-     * Returns the telephone numbers by which individuals can speak to the responsible
-     * organization or individual.
+     * Returns the telephone numbers by which individuals can speak to the responsible organization or individual.
+     *
+     * @return Telephone numbers by which individuals can speak to the responsible organization or individual.
      */
     @Override
     @XmlElement(name = "voice")
@@ -111,8 +114,7 @@ public class DefaultTelephone extends IS
     }
 
     /**
-     * Sets the telephone numbers by which individuals can speak to the responsible
-     * organization or individual.
+     * Sets the telephone numbers by which individuals can speak to the responsible organization or individual.
      *
      * @param newValues The new telephone numbers, or {@code null} if none.
      */
@@ -121,8 +123,9 @@ public class DefaultTelephone extends IS
     }
 
     /**
-     * Returns the telephone numbers of a facsimile machine for the responsible organization
-     * or individual.
+     * Returns the telephone numbers of a facsimile machine for the responsible organization or individual.
+     *
+     * @return Telephone numbers of a facsimile machine for the responsible organization or individual.
      */
     @Override
     @XmlElement(name = "facsimile")
@@ -131,8 +134,7 @@ public class DefaultTelephone extends IS
     }
 
     /**
-     * Sets the telephone number of a facsimile machine for the responsible organization
-     * or individual.
+     * Sets the telephone number of a facsimile machine for the responsible organization or individual.
      *
      * @param newValues The new telephone number, or {@code null} if none.
      */

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -64,11 +64,6 @@
  * except at XML marshalling time (for ISO 19139 compliance).
  * See {@link org.apache.sis.xml.IdentifierMap} for more information.
  *
- * {@section Automatic properties}
- * Some properties provide default value based on the value of other properties.
- * See the <a href="../doc-files/auto-properties.html">list of automatic properties</a>
- * page for more information.
- *
  * {@section Null values, nil objects and collections}
  * All constructors (except the <cite>copy constructors</cite>) and setter methods accept {@code null} arguments.
  * A null argument value means that the metadata element can not be provided, and the reason for that is unspecified.
@@ -111,8 +106,8 @@
     @XmlJavaTypeAdapter(MD_Identifier.class),
 
     // Java types, primitive types and basic OGC types handling
-//    @XmlJavaTypeAdapter(GO_URL.class), // TODO
-//    @XmlJavaTypeAdapter(GO_DateTime.class), // TODO
+    @XmlJavaTypeAdapter(GO_URL.class),
+    @XmlJavaTypeAdapter(GO_DateTime.class),
     @XmlJavaTypeAdapter(StringAdapter.class),
     @XmlJavaTypeAdapter(InternationalStringAdapter.class)
 })

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -77,13 +77,15 @@ public class DefaultConstraints extends 
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Constraints)
      */
     public DefaultConstraints(final Constraints object) {
         super(object);
-        useLimitations = copyCollection(object.getUseLimitations(), InternationalString.class);
+        if (object != null) {
+            useLimitations = copyCollection(object.getUseLimitations(), InternationalString.class);
+        }
     }
 
     /**
@@ -126,6 +128,8 @@ public class DefaultConstraints extends 
     /**
      * Returns the limitation affecting the fitness for use of the resource.
      * Example: "<cite>not to be used for navigation</cite>".
+     *
+     * @return Limitation affecting the fitness for use of the resource.
      */
     @Override
     @XmlElement(name = "useLimitation")

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraints.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -91,15 +91,17 @@ public class DefaultLegalConstraints ext
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(LegalConstraints)
      */
     public DefaultLegalConstraints(final LegalConstraints object) {
         super(object);
-        accessConstraints = copyCollection(object.getAccessConstraints(), Restriction.class);
-        useConstraints    = copyCollection(object.getUseConstraints(), Restriction.class);
-        otherConstraints  = copyCollection(object.getOtherConstraints(), InternationalString.class);
+        if (object != null) {
+            accessConstraints = copyCollection(object.getAccessConstraints(), Restriction.class);
+            useConstraints    = copyCollection(object.getUseConstraints(), Restriction.class);
+            otherConstraints  = copyCollection(object.getOtherConstraints(), InternationalString.class);
+        }
     }
 
     /**
@@ -130,6 +132,8 @@ public class DefaultLegalConstraints ext
     /**
      * Returns the access constraints applied to assure the protection of privacy or intellectual property,
      * and any special restrictions or limitations on obtaining the resource.
+     *
+     * @return Access constraints applied to assure the protection of privacy or intellectual property.
      */
     @Override
     @XmlElement(name = "accessConstraints")
@@ -150,6 +154,8 @@ public class DefaultLegalConstraints ext
     /**
      * Returns the constraints applied to assure the protection of privacy or intellectual property,
      * and any special restrictions or limitations or warnings on using the resource.
+     *
+     * @return Constraints applied to assure the protection of privacy or intellectual property.
      */
     @Override
     @XmlElement(name = "useConstraints")
@@ -169,9 +175,11 @@ public class DefaultLegalConstraints ext
 
     /**
      * Returns the other restrictions and legal prerequisites for accessing and using the resource.
-     * Should be a non-empty value only if {@linkplain #getAccessConstraints() access constraints}
+     * Shall be a non-empty value only if {@linkplain #getAccessConstraints() access constraints}
      * or {@linkplain #getUseConstraints() use constraints} declares
      * {@linkplain Restriction#OTHER_RESTRICTIONS other restrictions}.
+     *
+     * @return Other restrictions and legal prerequisites for accessing and using the resource.
      */
     @Override
     @XmlElement(name = "otherConstraints")

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultSecurityConstraints.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -97,16 +97,18 @@ public class DefaultSecurityConstraints 
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(SecurityConstraints)
      */
     public DefaultSecurityConstraints(final SecurityConstraints object) {
         super(object);
-        classification       = object.getClassification();
-        userNote             = object.getUserNote();
-        classificationSystem = object.getClassificationSystem();
-        handlingDescription  = object.getHandlingDescription();
+        if (object != null) {
+            classification       = object.getClassification();
+            userNote             = object.getUserNote();
+            classificationSystem = object.getClassificationSystem();
+            handlingDescription  = object.getHandlingDescription();
+        }
     }
 
     /**
@@ -136,6 +138,8 @@ public class DefaultSecurityConstraints 
 
     /**
      * Returns the name of the handling restrictions on the resource.
+     *
+     * @return Name of the handling restrictions on the resource, or {@code null}.
      */
     @Override
     @XmlElement(name = "classification", required = true)
@@ -156,6 +160,8 @@ public class DefaultSecurityConstraints 
     /**
      * Returns the explanation of the application of the legal constraints or other restrictions and legal
      * prerequisites for obtaining and using the resource.
+     *
+     * @return Explanation of the application of the legal constraints, or {@code null}.
      */
     @Override
     @XmlElement(name = "userNote")
@@ -176,6 +182,8 @@ public class DefaultSecurityConstraints 
 
     /**
      * Returns the name of the classification system.
+     *
+     * @return Name of the classification system, or {@code null}.
      */
     @Override
     @XmlElement(name = "classificationSystem")
@@ -195,6 +203,8 @@ public class DefaultSecurityConstraints 
 
     /**
      * Returns the additional information about the restrictions on handling the resource.
+     *
+     * @return Additional information about the restrictions, or {@code null}.
      */
     @Override
     @XmlElement(name = "handlingDescription")

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/AbstractContentInformation.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -58,7 +58,7 @@ public class AbstractContentInformation 
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(ContentInformation)
      */

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -22,14 +22,12 @@ import javax.xml.bind.annotation.XmlElem
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.metadata.content.Band;
 import org.opengis.metadata.content.BandDefinition;
 import org.opengis.metadata.content.PolarizationOrientation;
 import org.opengis.metadata.content.TransferFunctionType;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.measure.ValueRange;
-import org.apache.sis.internal.jaxb.gco.GO_Real;
 
 
 /**
@@ -151,25 +149,27 @@ public class DefaultBand extends Default
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(Band)
      */
     public DefaultBand(final Band object) {
         super(object);
-        maxValue                 = object.getMaxValue();
-        minValue                 = object.getMinValue();
-        units                    = object.getUnits();
-        peakResponse             = object.getPeakResponse();
-        bitsPerValue             = object.getBitsPerValue();
-        toneGradation            = object.getToneGradation();
-        scaleFactor              = object.getScaleFactor();
-        offset                   = object.getOffset();
-        bandBoundaryDefinition   = object.getBandBoundaryDefinition();
-        nominalSpatialResolution = object.getNominalSpatialResolution();
-        transferFunctionType     = object.getTransferFunctionType();
-        transmittedPolarization  = object.getTransmittedPolarization();
-        detectedPolarization     = object.getDetectedPolarization();
+        if (object != null) {
+            maxValue                 = object.getMaxValue();
+            minValue                 = object.getMinValue();
+            units                    = object.getUnits();
+            peakResponse             = object.getPeakResponse();
+            bitsPerValue             = object.getBitsPerValue();
+            toneGradation            = object.getToneGradation();
+            scaleFactor              = object.getScaleFactor();
+            offset                   = object.getOffset();
+            bandBoundaryDefinition   = object.getBandBoundaryDefinition();
+            nominalSpatialResolution = object.getNominalSpatialResolution();
+            transferFunctionType     = object.getTransferFunctionType();
+            transmittedPolarization  = object.getTransmittedPolarization();
+            detectedPolarization     = object.getDetectedPolarization();
+        }
     }
 
     /**
@@ -198,19 +198,20 @@ public class DefaultBand extends Default
     }
 
     /**
-     * Returns the longest wavelength that the sensor is capable of collecting within
-     * a designated band.
+     * Returns the longest wavelength that the sensor is capable of collecting within a designated band.
+     * The units of measurement is given by {@link #getUnits()}.
+     *
+     * @return Longest wavelength that the sensor is capable of collecting within a designated band,
+     *         or {@code null} if unspecified.
      */
     @Override
     @XmlElement(name = "maxValue")
-    @XmlJavaTypeAdapter(GO_Real.class)
     public Double getMaxValue() {
         return maxValue;
     }
 
     /**
-     * Sets the longest wavelength that the sensor is capable of collecting within a
-     * designated band.
+     * Sets the longest wavelength that the sensor is capable of collecting within a designated band.
      *
      * @param newValue The new longest wavelength.
      */
@@ -220,19 +221,20 @@ public class DefaultBand extends Default
     }
 
     /**
-     * Returns the shortest wavelength that the sensor is capable of collecting
-     * within a designated band.
+     * Returns the shortest wavelength that the sensor is capable of collecting within a designated band.
+     * The units of measurement is given by {@link #getUnits()}.
+     *
+     * @return Shortest wavelength that the sensor is capable of collecting within a designated band,
+     *         or {@code null} if unspecified.
      */
     @Override
     @XmlElement(name = "minValue")
-    @XmlJavaTypeAdapter(GO_Real.class)
     public Double getMinValue() {
         return minValue;
     }
 
     /**
-     * Sets the shortest wavelength that the sensor is capable of collecting within
-     * a designated band.
+     * Sets the shortest wavelength that the sensor is capable of collecting within a designated band.
      *
      * @param newValue The new shortest wavelength.
      */
@@ -242,9 +244,11 @@ public class DefaultBand extends Default
     }
 
     /**
-     * Returns the units in which sensor wavelengths are expressed. Should be non-null
+     * Returns the units in which sensor wavelengths are expressed. Shall be non-null
      * if {@linkplain #getMinValue() min value} or {@linkplain #getMaxValue() max value}
      * are provided.
+     *
+     * @return Units in which sensor wavelengths are expressed, or {@code null}.
      */
     @Override
     @XmlElement(name = "units")
@@ -253,7 +257,7 @@ public class DefaultBand extends Default
     }
 
     /**
-     * Sets the units in which sensor wavelengths are expressed. Should be non-null if
+     * Sets the units in which sensor wavelengths are expressed. Shall be non-null if
      * {@linkplain #getMinValue() min value} or {@linkplain #getMaxValue() max value}
      * are provided.
      *
@@ -266,6 +270,9 @@ public class DefaultBand extends Default
 
     /**
      * Returns the wavelength at which the response is the highest.
+     * The units of measurement is given by {@link #getUnits()}.
+     *
+     * @return Wavelength at which the response is the highest, or {@code null} if unspecified.
      */
     @Override
     @XmlElement(name = "peakResponse")
@@ -286,6 +293,8 @@ public class DefaultBand extends Default
     /**
      * Returns the maximum number of significant bits in the uncompressed
      * representation for the value in each band of each pixel.
+     *
+     * @return Maximum number of significant bits in the uncompressed representation, or {@code null}.
      */
     @Override
     @ValueRange(minimum=1)
@@ -307,6 +316,8 @@ public class DefaultBand extends Default
 
     /**
      * Returns the number of discrete numerical values in the grid data.
+     *
+     * @return Number of discrete numerical values in the grid data, or {@code null}.
      */
     @Override
     @ValueRange(minimum=0)
@@ -327,6 +338,8 @@ public class DefaultBand extends Default
 
     /**
      * Returns the scale factor which has been applied to the cell value.
+     *
+     * @return Scale factor which has been applied to the cell value, or {@code null}.
      */
     @Override
     @XmlElement(name = "scaleFactor")
@@ -346,6 +359,8 @@ public class DefaultBand extends Default
 
     /**
      * Returns the physical value corresponding to a cell value of zero.
+     *
+     * @return The physical value corresponding to a cell value of zero, or {@code null}.
      */
     @Override
     @XmlElement(name = "offset")
@@ -364,8 +379,9 @@ public class DefaultBand extends Default
     }
 
     /**
-     * Returns the designation of criterion for defining maximum and minimum wavelengths
-     * for a spectral band.
+     * Returns the designation of criterion for defining maximum and minimum wavelengths for a spectral band.
+     *
+     * @return Criterion for defining maximum and minimum wavelengths, or {@code null}.
      */
     @Override
     @XmlElement(name = "bandBoundaryDefinition", namespace = Namespaces.GMI)
@@ -374,8 +390,7 @@ public class DefaultBand extends Default
     }
 
     /**
-     * Sets designation of criterion for defining maximum and minimum wavelengths
-     * for a spectral band.
+     * Sets designation of criterion for defining maximum and minimum wavelengths for a spectral band.
      *
      * @param newValue The new band definition.
      */
@@ -387,6 +402,8 @@ public class DefaultBand extends Default
     /**
      * Returns the smallest distance between which separate points can be distinguished,
      * as specified in instrument design.
+     *
+     * @return Smallest distance between which separate points can be distinguished, or {@code null}.
      */
     @Override
     @ValueRange(minimum=0, isMinIncluded=false)
@@ -408,6 +425,8 @@ public class DefaultBand extends Default
 
     /**
      * Returns type of transfer function to be used when scaling a physical value for a given element.
+     *
+     * @return Type of transfer function, or {@code null}.
      */
     @Override
     @XmlElement(name = "transferFunctionType", namespace = Namespaces.GMI)
@@ -427,6 +446,8 @@ public class DefaultBand extends Default
 
     /**
      * Polarization of the radiation transmitted.
+     *
+     * @return Polarization of the radiation transmitted, or {@code null}.
      */
     @Override
     @XmlElement(name = "transmittedPolarization", namespace = Namespaces.GMI)
@@ -446,6 +467,8 @@ public class DefaultBand extends Default
 
     /**
      * Polarization of the radiation detected.
+     *
+     * @return Polarization of the radiation detected, or {@code null}.
      */
     @Override
     @XmlElement(name = "detectedPolarization", namespace = Namespaces.GMI)

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -41,7 +41,7 @@ import org.apache.sis.xml.Namespaces;
  * @module
  */
 @XmlType(name = "MD_CoverageDescription_Type", propOrder = {
-// TODO    "attributeDescription",
+    "attributeDescription",
     "contentType",
     "dimensions",
     "rangeElementDescriptions"
@@ -88,16 +88,18 @@ public class DefaultCoverageDescription 
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(CoverageDescription)
      */
     public DefaultCoverageDescription(final CoverageDescription object) {
         super(object);
-        attributeDescription     = object.getAttributeDescription();
-        contentType              = object.getContentType();
-        dimensions               = copyCollection(object.getDimensions(), RangeDimension.class);
-        rangeElementDescriptions = copyCollection(object.getRangeElementDescriptions(), RangeElementDescription.class);
+        if (object != null) {
+            attributeDescription     = object.getAttributeDescription();
+            contentType              = object.getContentType();
+            dimensions               = copyCollection(object.getDimensions(), RangeDimension.class);
+            rangeElementDescriptions = copyCollection(object.getRangeElementDescriptions(), RangeElementDescription.class);
+        }
     }
 
     /**
@@ -133,9 +135,11 @@ public class DefaultCoverageDescription 
 
     /**
      * Returns the description of the attribute described by the measurement value.
+     *
+     * @return Description of the attribute, or {@code null}.
      */
     @Override
-    // TODO @XmlElement(name = "attributeDescription", required = true)
+    @XmlElement(name = "attributeDescription", required = true)
     public RecordType getAttributeDescription() {
         return attributeDescription;
     }
@@ -152,6 +156,8 @@ public class DefaultCoverageDescription 
 
     /**
      * Returns the type of information represented by the cell value.
+     *
+     * @return Type of information represented by the cell value, or {@code null}.
      */
     @Override
     @XmlElement(name = "contentType", required = true)
@@ -171,6 +177,8 @@ public class DefaultCoverageDescription 
 
     /**
      * Returns the information on the dimensions of the cell measurement value.
+     *
+     * @return Dimensions of the cell measurement value.
      */
     @Override
     @XmlElement(name = "dimension")

Modified: sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java?rev=1517321&r1=1517320&r2=1517321&view=diff
==============================================================================
--- sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] (original)
+++ sis/branches/Shapefile/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultFeatureCatalogueDescription.java [UTF-8] Sun Aug 25 15:49:51 2013
@@ -25,9 +25,6 @@ import org.opengis.util.GenericName;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.content.FeatureCatalogueDescription;
 
-import static org.apache.sis.internal.metadata.MetadataUtilities.getBoolean;
-import static org.apache.sis.internal.metadata.MetadataUtilities.setBoolean;
-
 
 /**
  * Information identifying the feature catalogue.
@@ -36,7 +33,7 @@ import static org.apache.sis.internal.me
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.3
+ * @version 0.4
  * @module
  */
 @XmlType(name = "MD_FeatureCatalogueDescription_Type", propOrder = {
@@ -53,28 +50,26 @@ public class DefaultFeatureCatalogueDesc
     /**
      * Serial number for inter-operability with different versions.
      */
-    private static final long serialVersionUID = -3626075463499626813L;
+    private static final long serialVersionUID = -3626075463499626815L;
 
     /**
-     * Mask for the {@code compliant} {@link Boolean} value.
-     * Needs 2 bits since the values can be {@code true}, {@code false} or {@code null}.
+     * Whether or not the cited feature catalogue complies with ISO 19110.
      *
-     * @see #booleans
+     * <p>Implementation note: we need to store the reference to the {@code Boolean} instance instead
+     * than using bitmask because {@link org.apache.sis.internal.jaxb.PrimitiveTypeProperties} may
+     * associate some properties to that particular instance.</p>
      */
-    private static final byte COMPLIANT_MASK = 3; // 0b011
+    private Boolean compliant;
 
     /**
-     * Mask for the {@code includedWithDataset} {@code boolean} value.
-     * Needs only 1 bit because the value can not be {@code null}.
-     *
-     * @see #booleans
+     * Language(s) used within the catalogue
      */
-    private static final byte INCLUDED_MASK = 4; // 0b100
+    private Collection<Locale> languages;
 
     /**
-     * Language(s) used within the catalogue
+     * Whether or not the feature catalogue is included with the dataset.
      */
-    private Collection<Locale> languages;
+    private boolean includedWithDataset;
 
     /**
      * Subset of feature types from cited feature catalogue occurring in dataset.
@@ -87,15 +82,6 @@ public class DefaultFeatureCatalogueDesc
     private Collection<Citation> featureCatalogueCitations;
 
     /**
-     * The set of {@code boolean} and {@link Boolean} values.
-     * Bits are read and written using the {@code *_MASK} constants.
-     *
-     * @see #COMPLIANT_MASK
-     * @see #INCLUDED_MASK
-     */
-    private byte booleans;
-
-    /**
      * Constructs an initially empty feature catalogue description.
      */
     public DefaultFeatureCatalogueDescription() {
@@ -106,17 +92,19 @@ public class DefaultFeatureCatalogueDesc
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * @param object The metadata to copy values from.
+     * @param object The metadata to copy values from, or {@code null} if none.
      *
      * @see #castOrCopy(FeatureCatalogueDescription)
      */
     public DefaultFeatureCatalogueDescription(final FeatureCatalogueDescription object) {
         super(object);
-        booleans                  = object.isIncludedWithDataset() ? INCLUDED_MASK : 0;
-        booleans                  = (byte) setBoolean(booleans, COMPLIANT_MASK, object.isCompliant());
-        languages                 = copyCollection(object.getLanguages(), Locale.class);
-        featureTypes              = copyCollection(object.getFeatureTypes(), GenericName.class);
-        featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class);
+        if (object != null) {
+            compliant                 = object.isCompliant();
+            includedWithDataset       = object.isIncludedWithDataset();
+            languages                 = copyCollection(object.getLanguages(), Locale.class);
+            featureTypes              = copyCollection(object.getFeatureTypes(), GenericName.class);
+            featureCatalogueCitations = copyCollection(object.getFeatureCatalogueCitations(), Citation.class);
+        }
     }
 
     /**
@@ -146,11 +134,13 @@ public class DefaultFeatureCatalogueDesc
 
     /**
      * Returns whether or not the cited feature catalogue complies with ISO 19110.
+     *
+     * @return Whether or not the cited feature catalogue complies with ISO 19110, or {@code null}.
      */
     @Override
     @XmlElement(name = "complianceCode")
     public Boolean isCompliant() {
-        return getBoolean(booleans, COMPLIANT_MASK);
+        return compliant;
     }
 
     /**
@@ -160,11 +150,13 @@ public class DefaultFeatureCatalogueDesc
      */
     public void setCompliant(final Boolean newValue) {
         checkWritePermission();
-        booleans = (byte) setBoolean(booleans, COMPLIANT_MASK, newValue);
+        compliant = newValue;
     }
 
     /**
      * Returns the language(s) used within the catalogue
+     *
+     * @return Language(s) used within the catalogue.
      */
     @Override
     @XmlElement(name = "language")
@@ -183,11 +175,13 @@ public class DefaultFeatureCatalogueDesc
 
     /**
      * Returns whether or not the feature catalogue is included with the dataset.
+     *
+     * @return Whether or not the feature catalogue is included with the dataset.
      */
     @Override
     @XmlElement(name = "includedWithDataset", required = true)
     public boolean isIncludedWithDataset() {
-        return (booleans & INCLUDED_MASK) != 0;
+        return includedWithDataset;
     }
 
     /**
@@ -197,15 +191,13 @@ public class DefaultFeatureCatalogueDesc
      */
     public void setIncludedWithDataset(final boolean newValue) {
         checkWritePermission();
-        if (newValue) {
-            booleans |= INCLUDED_MASK;
-        } else {
-            booleans &= ~INCLUDED_MASK;
-        }
+        includedWithDataset = newValue;
     }
 
     /**
      * Returns the subset of feature types from cited feature catalogue occurring in dataset.
+     *
+     * @return Subset of feature types occurring in dataset.
      */
     @Override
     @XmlElement(name = "featureTypes")
@@ -224,6 +216,8 @@ public class DefaultFeatureCatalogueDesc
 
     /**
      * Returns the complete bibliographic reference to one or more external feature catalogues.
+     *
+     * @return Bibliographic reference to one or more external feature catalogues.
      */
     @Override
     @XmlElement(name = "featureCatalogueCitation", required = true)



Mime
View raw message