You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2013/06/24 15:57:13 UTC
svn commit: r1496057 - in /sis/branches/JDK7/core:
sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/
sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/
sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/
Author: desruisseaux
Date: Mon Jun 24 13:57:13 2013
New Revision: 1496057
URL: http://svn.apache.org/r1496057
Log:
Ported the GO_RecordType adapter, and enabled the metadata properties which were commented-out because of the lack of RecordType implementation.
Added:
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java (with props)
Modified:
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1496057&r1=1496056&r2=1496057&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] Mon Jun 24 13:57:13 2013
@@ -41,7 +41,7 @@ import org.apache.sis.xml.Namespaces;
* @module
*/
@XmlType(name = "MD_CoverageDescription_Type", propOrder = {
-// TODO "attributeDescription",
+ "attributeDescription",
"contentType",
"dimensions",
"rangeElementDescriptions"
@@ -135,7 +135,7 @@ public class DefaultCoverageDescription
* Returns the description of the attribute described by the measurement value.
*/
@Override
- // TODO @XmlElement(name = "attributeDescription", required = true)
+ @XmlElement(name = "attributeDescription", required = true)
public RecordType getAttributeDescription() {
return attributeDescription;
}
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java?rev=1496057&r1=1496056&r2=1496057&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java [UTF-8] Mon Jun 24 13:57:13 2013
@@ -110,7 +110,7 @@
@XmlJavaTypeAdapter(LocaleAdapter.class),
@XmlJavaTypeAdapter(InternationalStringAdapter.class),
@XmlJavaTypeAdapter(GO_GenericName.class),
-// @XmlJavaTypeAdapter(GO_RecordType.class), // TODO
+ @XmlJavaTypeAdapter(GO_RecordType.class),
@XmlJavaTypeAdapter(GO_Boolean.class), @XmlJavaTypeAdapter(type=boolean.class, value=GO_Boolean.class),
@XmlJavaTypeAdapter(GO_Decimal.class), @XmlJavaTypeAdapter(type=double.class, value=GO_Decimal.class),
@XmlJavaTypeAdapter(GO_Integer.class), @XmlJavaTypeAdapter(type=int.class, value=GO_Integer.class),
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java?rev=1496057&r1=1496056&r2=1496057&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java [UTF-8] Mon Jun 24 13:57:13 2013
@@ -37,7 +37,7 @@ import org.opengis.util.RecordType;
* @module
*/
@XmlType(name = "DQ_QuantitativeResult_Type", propOrder = {
-// TODO "valueType",
+ "valueType",
"valueUnit",
"errorStatistic"
})
@@ -138,7 +138,7 @@ public class DefaultQuantitativeResult e
* Return the value type for reporting a data quality result, or {@code null} if none.
*/
@Override
- // TODO @XmlElement(name = "valueType")
+ @XmlElement(name = "valueType")
public RecordType getValueType() {
return valueType;
}
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java?rev=1496057&r1=1496056&r2=1496057&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java [UTF-8] Mon Jun 24 13:57:13 2013
@@ -143,7 +143,7 @@
@XmlJavaTypeAdapter(StringAdapter.class),
@XmlJavaTypeAdapter(InternationalStringAdapter.class),
@XmlJavaTypeAdapter(GO_DateTime.class),
-// @XmlJavaTypeAdapter(GO_RecordType.class), // TODO
+ @XmlJavaTypeAdapter(GO_RecordType.class),
@XmlJavaTypeAdapter(GO_Boolean.class), @XmlJavaTypeAdapter(type=boolean.class, value=GO_Boolean.class)
})
package org.apache.sis.metadata.iso.quality;
Added: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java?rev=1496057&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java (added)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java [UTF-8] Mon Jun 24 13:57:13 2013
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.gco;
+
+import javax.xml.bind.annotation.XmlElement;
+import org.opengis.util.RecordType;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+import org.apache.sis.util.iso.DefaultRecordType;
+
+
+/**
+ * JAXB wrapper in order to map implementing class with the GeoAPI interface.
+ * See package documentation for more information about JAXB and interface.
+ *
+ * @author Cédric Briançon (Geomatys)
+ * @since 0.3 (derived from geotk-2.5)
+ * @version 0.3
+ * @module
+ */
+public final class GO_RecordType extends PropertyType<GO_RecordType, RecordType> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public GO_RecordType() {
+ }
+
+ /**
+ * Wraps a {@code RecordType} value with a {@code gco:RecordType} tags at marshalling-time.
+ *
+ * @param metadata The metadata value to marshal.
+ */
+ private GO_RecordType(final RecordType metadata) {
+ super(metadata);
+ }
+
+ /**
+ * Returns a wrapper for the given {@code RecordType} element.
+ *
+ * @param value The value to marshal.
+ * @return The wrapper around the given metadata value.
+ */
+ @Override
+ protected GO_RecordType wrap(final RecordType value) {
+ return new GO_RecordType(value);
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ */
+ @Override
+ protected Class<RecordType> getBoundType() {
+ return RecordType.class;
+ }
+
+ /**
+ * Returns the {@link DefaultRecordType} generated from the metadata value.
+ * This method is systematically called at marshalling-time by JAXB.
+ *
+ * @return The metadata to be marshalled.
+ */
+ @XmlElement(name = "RecordType")
+ public DefaultRecordType getElement() {
+ return skip() ? null : DefaultRecordType.castOrCopy(metadata);
+ }
+
+ /**
+ * Sets the value for the {@link DefaultRecordType}.
+ * This method is systematically called at unmarshalling-time by JAXB.
+ *
+ * @param metadata The unmarshalled metadata.
+ */
+ public void setElement(final DefaultRecordType metadata) {
+ this.metadata = metadata;
+ }
+}
Propchange: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
------------------------------------------------------------------------------
svn:mime-type = text/plain;charset=UTF-8