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 2014/09/10 02:06:41 UTC
svn commit: r1623891 - in /sis/branches/JDK6: ./
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/meta...
Author: desruisseaux
Date: Wed Sep 10 00:06:39 2014
New Revision: 1623891
URL: http://svn.apache.org/r1623891
Log:
Merge from the JDK7 branch.
Added:
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/
- copied from r1623888, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/
- copied from r1623888, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
- copied unchanged from r1623888, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
Removed:
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/ReferenceSystemMetadata.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultParameter.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultParameterTest.java
Modified:
sis/branches/JDK6/ (props changed)
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java
sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java
sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java
sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java
sis/branches/JDK6/profiles/sis-french-profile/src/test/java/org/apache/sis/profile/france/FrenchProfileTest.java
Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
Merged /sis/branches/JDK8:r1622723-1623886
Merged /sis/branches/JDK7:r1622724-1623888
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -17,7 +17,7 @@
package org.apache.sis.internal.jaxb.code;
import javax.xml.bind.annotation.XmlElement;
-import org.opengis.metadata.service.ParameterDirection;
+import org.opengis.parameter.ParameterDirection;
import org.apache.sis.internal.jaxb.gmd.EnumAdapter;
import org.apache.sis.xml.Namespaces;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -19,6 +19,7 @@ package org.apache.sis.internal.jaxb.met
import javax.xml.bind.annotation.XmlElementRef;
import org.opengis.referencing.ReferenceSystem;
import org.apache.sis.internal.jaxb.gco.PropertyType;
+import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -17,9 +17,9 @@
package org.apache.sis.internal.jaxb.metadata;
import javax.xml.bind.annotation.XmlElementRef;
-import org.opengis.metadata.service.Parameter;
-import org.apache.sis.metadata.iso.service.DefaultParameter;
+import org.opengis.parameter.ParameterDescriptor;
import org.apache.sis.internal.jaxb.gco.PropertyType;
+import org.apache.sis.internal.jaxb.metadata.replace.ServiceParameter;
/**
@@ -31,7 +31,7 @@ import org.apache.sis.internal.jaxb.gco.
* @version 0.5
* @module
*/
-public final class SV_Parameter extends PropertyType<SV_Parameter, Parameter> {
+public final class SV_Parameter extends PropertyType<SV_Parameter, ParameterDescriptor<?>> {
/**
* Empty constructor for JAXB only.
*/
@@ -43,17 +43,18 @@ public final class SV_Parameter extends
* This method is indirectly invoked by the private constructor
* below, so it shall not depend on the state of this object.
*
- * @return {@code Parameter.class}
+ * @return {@code ParameterDescriptor.class}
*/
@Override
- protected Class<Parameter> getBoundType() {
- return Parameter.class;
+ @SuppressWarnings("unchecked")
+ protected Class<ParameterDescriptor<?>> getBoundType() {
+ return (Class) ParameterDescriptor.class;
}
/**
* Constructor for the {@link #wrap} method only.
*/
- private SV_Parameter(final Parameter metadata) {
+ private SV_Parameter(final ParameterDescriptor<?> metadata) {
super(metadata);
}
@@ -65,7 +66,7 @@ public final class SV_Parameter extends
* @return A {@code PropertyType} wrapping the given the metadata element.
*/
@Override
- protected SV_Parameter wrap(final Parameter metadata) {
+ protected SV_Parameter wrap(final ParameterDescriptor<?> metadata) {
return new SV_Parameter(metadata);
}
@@ -77,8 +78,8 @@ public final class SV_Parameter extends
* @return The metadata to be marshalled.
*/
@XmlElementRef
- public DefaultParameter getElement() {
- return DefaultParameter.castOrCopy(metadata);
+ public ServiceParameter<?> getElement() {
+ return ServiceParameter.castOrCopy(metadata);
}
/**
@@ -86,7 +87,7 @@ public final class SV_Parameter extends
*
* @param metadata The unmarshalled metadata.
*/
- public void setElement(final DefaultParameter metadata) {
+ public void setElement(final ServiceParameter<?> metadata) {
this.metadata = metadata;
}
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java?rev=1623891&r1=1623888&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -139,7 +139,7 @@ public final class ServiceParameter<T> e
if (parameter == null || parameter instanceof ServiceParameter<?>) {
return (ServiceParameter<?>) parameter;
}
- return new ServiceParameter<>(parameter);
+ return new ServiceParameter(parameter);
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -89,6 +89,8 @@ public final class MetadataUtilities ext
return true;
}
final boolean p = value;
+ // (value == Boolean.FALSE) is an optimization for a common case avoiding PrimitiveTypeProperties check.
+ // DO NOT REPLACE BY 'equals' OR 'booleanValue()' - the exact reference value matter.
if (p || value == Boolean.FALSE || !(PrimitiveTypeProperties.property(value) instanceof NilReason)) {
return p;
}
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -32,7 +32,10 @@
* {@linkplain org.apache.sis.metadata.iso.ISOMetadata ISO-19115 metadata}<br>
* {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultCitation Citation}<br>
* {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultCitationDate Citation date}<br>
- * {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultResponsibleParty Responsible party}<br>
+ * {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultResponsibility Responsibility}<br>
+ * {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.AbstractParty Party}<br>
+ * {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultIndividual Individual}<br>
+ * {@code │ └─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultOrganisation Organisation}<br>
* {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultContact Contact}<br>
* {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultTelephone Telephone}<br>
* {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultAddress Address}<br>
@@ -47,12 +50,13 @@
* {@linkplain org.apache.sis.metadata.iso.citation.DefaultCitation Citation}<br>
* {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultCitationDate Citation date}<br>
* {@code │ └─} {@linkplain org.opengis.metadata.citation.DateType Date type} «code list»<br>
- * {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultResponsibleParty Responsible party}<br>
- * {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultContact Contact}<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultTelephone Telephone}<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultAddress Address}<br>
- * {@code │ │ └─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultOnlineResource Online resource}<br>
- * {@code │ │ └─} {@linkplain org.opengis.metadata.citation.OnLineFunction Online function} «code list»<br>
+ * {@code ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultResponsibility Responsibility}<br>
+ * {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.citation.AbstractParty Party}<br>
+ * {@code │ │ └─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultContact Contact}<br>
+ * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultTelephone Telephone}<br>
+ * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultAddress Address}<br>
+ * {@code │ │ └─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultOnlineResource Online resource}<br>
+ * {@code │ │ └─} {@linkplain org.opengis.metadata.citation.OnLineFunction Online function} «code list»<br>
* {@code │ └─} {@linkplain org.opengis.metadata.citation.Role Role} «code list»<br>
* {@code ├─} {@linkplain org.opengis.metadata.citation.PresentationForm Presentation form} «code list»<br>
* {@code └─} {@linkplain org.apache.sis.metadata.iso.citation.DefaultSeries Series}<br>
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -26,7 +26,7 @@ import org.apache.sis.metadata.iso.ISOMe
import org.opengis.metadata.citation.OnlineResource;
import org.opengis.metadata.service.DistributedComputingPlatform;
import org.opengis.metadata.service.OperationMetadata;
-import org.opengis.metadata.service.Parameter;
+import org.opengis.parameter.ParameterDescriptor;
/**
@@ -91,7 +91,7 @@ public class DefaultOperationMetadata ex
/**
* The parameters that are required for this interface.
*/
- private Collection<Parameter> parameters;
+ private Collection<ParameterDescriptor<?>> parameters;
/**
* List of operation that must be completed immediately.
@@ -129,6 +129,7 @@ public class DefaultOperationMetadata ex
*
* @see #castOrCopy(OperationMetadata)
*/
+ @SuppressWarnings("unchecked")
public DefaultOperationMetadata(final OperationMetadata object) {
super(object);
if (object != null) {
@@ -137,7 +138,7 @@ public class DefaultOperationMetadata ex
this.operationDescription = object.getOperationDescription();
this.invocationName = object.getInvocationName();
this.connectPoints = copyCollection(object.getConnectPoints(), OnlineResource.class);
- this.parameters = copySet(object.getParameters(), Parameter.class);
+ this.parameters = copySet(object.getParameters(), (Class) ParameterDescriptor.class);
this.dependsOn = copyList(object.getDependsOn(), OperationMetadata.class);
}
}
@@ -277,9 +278,10 @@ public class DefaultOperationMetadata ex
* @return The parameters that are required for this interface, or an empty collection if none.
*/
@Override
+ @SuppressWarnings("unchecked")
@XmlElement(name = "parameters")
- public Collection<Parameter> getParameters() {
- return parameters = nonNullCollection(parameters, Parameter.class);
+ public Collection<ParameterDescriptor<?>> getParameters() {
+ return parameters = nonNullCollection(parameters, (Class) ParameterDescriptor.class);
}
/**
@@ -287,8 +289,9 @@ public class DefaultOperationMetadata ex
*
* @param newValues The new set of parameters that are required for this interface.
*/
- public void setParameters(final Collection<? extends Parameter> newValues) {
- parameters = writeCollection(newValues, parameters, Parameter.class);
+ @SuppressWarnings("unchecked")
+ public void setParameters(final Collection<? extends ParameterDescriptor<?>> newValues) {
+ parameters = writeCollection(newValues, parameters, (Class) ParameterDescriptor.class);
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -26,7 +26,7 @@ import org.opengis.metadata.citation.Onl
import org.opengis.metadata.service.CoupledResource;
import org.opengis.metadata.service.DistributedComputingPlatform;
import org.opengis.metadata.service.OperationMetadata;
-import org.opengis.metadata.service.Parameter;
+import org.opengis.parameter.ParameterDescriptor;
import org.opengis.util.InternationalString;
@@ -65,7 +65,7 @@ final class OperationName implements Ope
@Override public InternationalString getOperationDescription() {return null;}
@Override public Collection<DistributedComputingPlatform> getDistributedComputingPlatforms() {return Collections.emptySet();}
@Override public Collection<OnlineResource> getConnectPoints() {return Collections.emptySet();}
- @Override public Collection<Parameter> getParameters() {return Collections.emptySet();}
+ @Override public Collection<ParameterDescriptor<?>> getParameters() {return Collections.emptySet();}
@Override public List<OperationMetadata> getDependsOn() {return Collections.emptyList();}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java?rev=1623891&r1=1623888&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -45,7 +45,7 @@ public final strictfp class ServiceParam
public static ServiceParameter<?> create() {
final TypeName valueType = SIS_NAMES.createTypeName(null, "CharacterString");
final MemberName paramName = SIS_NAMES.createMemberName(null, "Version", valueType);
- final ServiceParameter<?> param = new ServiceParameter<>();
+ final ServiceParameter<?> param = new ServiceParameter();
param.name = paramName;
param.optionality = true;
param.repeatability = false;
@@ -81,7 +81,7 @@ public final strictfp class ServiceParam
*/
@Test
public void testMarshalEmpty() throws JAXBException {
- final String xml = marshal(new ServiceParameter<>());
+ final String xml = marshal(new ServiceParameter());
assertXmlEquals(
"<srv:SV_Parameter xmlns:srv=\"" + Namespaces.SRV + '"' +
" xmlns:gco=\"" + Namespaces.GCO + "\">\n" +
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -231,6 +231,8 @@ public abstract strictfp class MetadataT
*/
final Class<?> propertyType = Numbers.primitiveToWrapper(accessor.type(i, TypeValuePolicy.PROPERTY_TYPE));
final Class<?> elementType = Numbers.primitiveToWrapper(accessor.type(i, TypeValuePolicy.ELEMENT_TYPE));
+ assertNotNull(testingMethod, propertyType);
+ assertNotNull(testingMethod, elementType);
final boolean isCollection = Collection.class.isAssignableFrom(propertyType);
assertFalse("Element type can not be Collection.", Collection.class.isAssignableFrom(elementType));
assertEquals("Property and element types shall be the same if and only if not a collection.",
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -191,7 +191,6 @@ public final strictfp class AllMetadataT
org.opengis.metadata.service.CoupledResource.class,
org.opengis.metadata.service.OperationChainMetadata.class,
org.opengis.metadata.service.OperationMetadata.class,
- org.opengis.metadata.service.Parameter.class,
org.opengis.metadata.service.ServiceIdentification.class,
org.opengis.metadata.spatial.CellGeometry.class,
org.opengis.metadata.spatial.Dimension.class,
@@ -228,7 +227,7 @@ public final strictfp class AllMetadataT
* @return {@inheritDoc}
*/
@Override
- protected String getExpectedPropertyName(final UML uml) {
+ protected String getExpectedXmlElementName(final UML uml) {
String name = uml.identifier();
if (name.equals("distributedComputingPlatform")) {
name = "DCP";
@@ -246,7 +245,7 @@ public final strictfp class AllMetadataT
* @return {@inheritDoc}
*/
@Override
- protected String getExpectedTypeName(final UML uml) {
+ protected String getExpectedXmlRootElementName(final UML uml) {
String name = uml.identifier();
if (name.equals("MD_Scope")) { // ISO 19115:2014
name = "DQ_Scope"; // ISO 19115:2003
@@ -277,7 +276,7 @@ public final strictfp class AllMetadataT
* @return {@inheritDoc}
*/
@Override
- protected String getExpectedTypeForElement(final Class<?> type, final Class<?> impl) {
+ protected String getExpectedXmlTypeForElement(final Class<?> type, final Class<?> impl) {
final String rootName = type.getAnnotation(UML.class).identifier();
/* switch (rootName) */ { // "String in switch" on the JDK7 branch.
// We don't know yet what is the type of this one.
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -19,8 +19,9 @@ package org.apache.sis.metadata.iso.serv
import org.opengis.util.ScopedName;
import org.opengis.metadata.citation.OnlineResource;
import org.opengis.metadata.service.CoupledResource;
-import org.opengis.metadata.service.DistributedComputingPlatform;
import org.opengis.metadata.service.OperationMetadata;
+import org.opengis.metadata.service.DistributedComputingPlatform;
+import org.apache.sis.internal.jaxb.metadata.replace.ServiceParameterTest;
import org.apache.sis.xml.NilReason;
import org.apache.sis.test.DependsOn;
import org.apache.sis.test.TestCase;
@@ -39,7 +40,7 @@ import static org.junit.Assert.*;
* @version 0.5
* @module
*/
-@DependsOn(DefaultParameterTest.class)
+@DependsOn(ServiceParameterTest.class)
public final strictfp class DefaultCoupledResourceTest extends TestCase {
/**
* Creates the resource to use for testing purpose.
@@ -47,7 +48,7 @@ public final strictfp class DefaultCoupl
static DefaultCoupledResource create() {
final DefaultOperationMetadata operation = new DefaultOperationMetadata("Get Map",
DistributedComputingPlatform.WEB_SERVICES, null);
- operation.setParameters(singleton(DefaultParameterTest.create()));
+ operation.setParameters(singleton(ServiceParameterTest.create()));
operation.setConnectPoints(singleton(NilReason.MISSING.createNilObject(OnlineResource.class)));
final DefaultCoupledResource resource = new DefaultCoupledResource();
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -38,7 +38,6 @@ import static org.apache.sis.internal.sy
* @module
*/
@DependsOn({
- DefaultParameterTest.class,
DefaultCoupledResourceTest.class,
org.apache.sis.metadata.iso.identification.DefaultDataIdentificationTest.class
})
Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -72,7 +72,7 @@ import org.junit.BeforeClass;
org.apache.sis.metadata.iso.identification.DefaultResolutionTest.class,
org.apache.sis.metadata.iso.identification.DefaultBrowseGraphicTest.class,
org.apache.sis.metadata.iso.identification.DefaultDataIdentificationTest.class,
- org.apache.sis.metadata.iso.service.DefaultParameterTest.class,
+ org.apache.sis.internal.jaxb.metadata.replace.ServiceParameterTest.class,
org.apache.sis.metadata.iso.service.DefaultCoupledResourceTest.class,
org.apache.sis.metadata.iso.service.DefaultServiceIdentificationTest.class,
org.apache.sis.metadata.iso.quality.AbstractElementTest.class,
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -68,13 +68,13 @@ import org.apache.sis.internal.jdk7.Obje
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Johann Sorel (Geomatys)
* @since 0.4 (derived from geotk-2.0)
- * @version 0.4
+ * @version 0.5
* @module
*
* @see DefaultParameterValue
* @see DefaultParameterDescriptorGroup
*/
-public class DefaultParameterDescriptor<T> extends AbstractIdentifiedObject implements ParameterDescriptor<T> {
+public class DefaultParameterDescriptor<T> extends AbstractParameterDescriptor implements ParameterDescriptor<T> {
/**
* Serial number for inter-operability with different versions.
*/
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -89,13 +89,13 @@ import static org.apache.sis.util.Utilit
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Johann Sorel (Geomatys)
* @since 0.4 (derived from geotk-2.0)
- * @version 0.4
+ * @version 0.5
* @module
*
* @see DefaultParameterValueGroup
* @see DefaultParameterDescriptor
*/
-public class DefaultParameterDescriptorGroup extends AbstractIdentifiedObject implements ParameterDescriptorGroup {
+public class DefaultParameterDescriptorGroup extends AbstractParameterDescriptor implements ParameterDescriptorGroup {
/**
* Serial number for inter-operability with different versions.
*/
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -31,7 +31,6 @@ import org.opengis.parameter.GeneralPara
import org.opengis.parameter.GeneralParameterDescriptor;
import org.opengis.parameter.ParameterNotFoundException;
import org.apache.sis.referencing.IdentifiedObjects;
-import org.apache.sis.referencing.AbstractIdentifiedObject;
import org.apache.sis.referencing.operation.matrix.Matrices;
import org.apache.sis.internal.referencing.WKTUtilities;
import org.apache.sis.internal.util.Numerics;
@@ -55,10 +54,10 @@ import org.apache.sis.util.Debug;
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.4 (derived from geotk-2.0)
- * @version 0.4
+ * @version 0.5
* @module
*/
-final class TensorValues<E> extends AbstractIdentifiedObject
+final class TensorValues<E> extends AbstractParameterDescriptor
implements ParameterDescriptorGroup, ParameterValueGroup, Cloneable
{
/**
@@ -171,22 +170,6 @@ final class TensorValues<E> extends Abst
}
/**
- * Returns 1 since this group is considered mandatory.
- */
- @Override
- public int getMinimumOccurs() {
- return 1;
- }
-
- /**
- * Returns 1 since we expect exactly one instance of this group.
- */
- @Override
- public int getMaximumOccurs() {
- return 1;
- }
-
- /**
* Returns the current tensor dimensions.
*/
private int[] dimensions() {
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -20,8 +20,19 @@
* An explanation for this package is provided in the {@linkplain org.opengis.parameter OpenGIS® javadoc}.
* The remaining discussion on this page is specific to the SIS implementation.
*
- * <p>Parameters are organized in <cite>groups</cite>. A group may be for example the set of all parameters needed
- * for the definition of a <cite>Mercator projection</cite>.
+ * <p>There is three categories of classes in this package:</p>
+ * <ul>
+ * <li><b>Parameter descriptors</b> are immutable types that describes the parameters needed by an operation or a
+ * process. Descriptors contain information like parameter name, optionality, repeatability and value type, but
+ * do not contain the actual parameter value.</li>
+ * <li><b>Parameter values</b> are (<var>descriptor</var>, <var>value</var>) tuples, together with convenience methods
+ * for performing unit conversions and getting the values as instances of some commonly used types.</li>
+ * <li>Builders, formatters and static methods aim to simplify the creation of {@code ParameterDescriptor}s,
+ * the search for parameter values and visualizing them in a tabular format.</li>
+ * </ul>
+ *
+ * <p>Parameters are organized in <cite>groups</cite>.
+ * A group may be for example the set of all parameters needed for the definition of a <cite>Mercator projection</cite>.
* Parameter groups have some similarities with {@code java.util.Map} where:</p>
*
* <ul>
@@ -73,7 +84,7 @@
* if the given value is not assignable to the expected class or is not inside the value domain.
*
* @author Martin Desruisseaux (IRD, Geomatys)
- * @since 0.4 (derived from geotk-2.0)
+ * @since 0.5 (derived from geotk-2.0)
* @version 0.4
* @module
*/
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -20,6 +20,7 @@ import java.util.Collection;
import java.util.Set;
import javax.measure.unit.SI;
import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDirection;
import org.opengis.parameter.ParameterValue;
import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.util.GenericName;
@@ -40,7 +41,7 @@ import static org.junit.Assert.*;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
- * @version 0.4
+ * @version 0.5
* @module
*/
@DependsOn({
@@ -113,6 +114,8 @@ public final strictfp class ParametersTe
@Override public Collection<GenericName> getAlias() {return descriptor.getAlias();}
@Override public Set<ReferenceIdentifier> getIdentifiers() {return descriptor.getIdentifiers();}
@Override public InternationalString getRemarks() {return descriptor.getRemarks();}
+ @Override public InternationalString getDescription() {return descriptor.getDescription();}
+ @Override public ParameterDirection getDirection() {return descriptor.getDirection();}
@Override public int getMinimumOccurs() {return descriptor.getMinimumOccurs();}
@Override public int getMaximumOccurs() {return descriptor.getMaximumOccurs();}
@Override public Class<T> getValueClass() {return descriptor.getValueClass();}
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -45,7 +45,7 @@ import org.apache.sis.referencing.datum.
import org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis;
import org.apache.sis.referencing.cs.DefaultVerticalCS;
import org.apache.sis.referencing.crs.DefaultVerticalCRS;
-import org.apache.sis.internal.jaxb.metadata.ReferenceSystemMetadata;
+import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
import org.apache.sis.internal.jaxb.gmx.Anchor;
import org.apache.sis.referencing.NamedIdentifier;
import org.apache.sis.util.iso.SimpleInternationalString;
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -41,7 +41,7 @@ import org.apache.sis.internal.jdk7.Obje
*
* @author Guilhem Legal (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @since 0.3 (derived from geotk-3.00)
+ * @since 0.5 (derived from geotk-3.00)
* @version 0.3
* @module
*/
@@ -49,12 +49,12 @@ public class SimpleIdentifiedObject impl
/**
* For cross-version compatibility.
*/
- private static final long serialVersionUID = 4773397959809985024L;
+ private static final long serialVersionUID = 5297493321524903545L;
/**
* The primary name by which this object is identified.
*/
- protected ReferenceIdentifier referenceSystemIdentifier;
+ protected ReferenceIdentifier name;
/**
* Creates an identified object without identifier.
@@ -69,7 +69,7 @@ public class SimpleIdentifiedObject impl
* @param object The identified object to partially copy.
*/
public SimpleIdentifiedObject(final IdentifiedObject object) {
- referenceSystemIdentifier = object.getName();
+ name = object.getName();
}
/**
@@ -78,7 +78,7 @@ public class SimpleIdentifiedObject impl
* @param name The primary name by which this object is identified.
*/
public SimpleIdentifiedObject(final ReferenceIdentifier name) {
- referenceSystemIdentifier = name;
+ this.name = name;
}
/**
@@ -88,7 +88,7 @@ public class SimpleIdentifiedObject impl
*/
@Override
public ReferenceIdentifier getName() {
- return referenceSystemIdentifier;
+ return name;
}
/**
@@ -150,9 +150,9 @@ public class SimpleIdentifiedObject impl
@Override
public final int hashCode() {
int code = (int) serialVersionUID;
- final ReferenceIdentifier id = referenceSystemIdentifier;
- if (id != null) {
- code ^= id.hashCode();
+ final ReferenceIdentifier name = this.name;
+ if (name != null) {
+ code ^= name.hashCode();
}
return code;
}
@@ -183,12 +183,12 @@ public class SimpleIdentifiedObject impl
if (mode == ComparisonMode.STRICT) {
if (object != null && object.getClass() == getClass()) {
final SimpleIdentifiedObject that = (SimpleIdentifiedObject) object;
- return Objects.equals(referenceSystemIdentifier, that.referenceSystemIdentifier);
+ return Objects.equals(name, that.name);
}
} else {
if (object instanceof IdentifiedObject) {
final IdentifiedObject that = (IdentifiedObject) object;
- return Utilities.deepEquals(referenceSystemIdentifier, that.getName(), mode);
+ return Utilities.deepEquals(name, that.getName(), mode);
}
}
return false;
@@ -212,11 +212,11 @@ public class SimpleIdentifiedObject impl
public String toString() {
final String code, codespace;
final Citation authority;
- final ReferenceIdentifier id = referenceSystemIdentifier;
- if (id != null) {
- code = id.getCode();
- codespace = id.getCodeSpace();
- authority = id.getAuthority();
+ final ReferenceIdentifier name = this.name;
+ if (name != null) {
+ code = name.getCode();
+ codespace = name.getCodeSpace();
+ authority = name.getAuthority();
} else {
code = null;
codespace = null;
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -211,6 +211,11 @@ public final class Classes extends Stati
* At this point we are not going to continue the loop anymore.
* Check if we have an array, then check the (component) class.
*/
+ if (type instanceof ParameterizedType) {
+ // Example: replace ParameterDescriptor<?> by ParameterDescriptor
+ // before we test for instance of Class.
+ type = ((ParameterizedType) type).getRawType();
+ }
int dimension = 0;
while (type instanceof GenericArrayType) {
type = ((GenericArrayType) type).getGenericComponentType();
Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -45,9 +45,11 @@ import static org.apache.sis.test.TestUt
* <ul>
* <li>All implementation classes have {@link XmlRootElement} and {@link XmlType} annotations.</li>
* <li>The name declared in the {@code XmlType} annotations matches the
- * {@linkplain #getExpectedTypeForElement expected value}.</li>
+ * {@link #getExpectedXmlTypeForElement expected value}.</li>
* <li>The name declared in the {@code XmlRootElement} (classes) or {@link XmlElement} (methods)
- * annotations matches the identifier declared in the {@link UML} annotation of the GeoAPI interfaces.</li>
+ * annotations matches the identifier declared in the {@link UML} annotation of the GeoAPI interfaces.
+ * The UML - XML name mapping can be changed by overriding {@link #getExpectedXmlElementName(UML)} and
+ * {@link #getExpectedXmlRootElementName(UML)}.</li>
* <li>The {@code XmlElement.required()} boolean is consistent with the UML {@linkplain Obligation obligation}.</li>
* <li>The namespace declared in the {@code XmlRootElement} or {@code XmlElement} annotations
* is not redundant with the {@link XmlSchema} annotation in the package.</li>
@@ -198,7 +200,7 @@ public abstract strictfp class Annotatio
*
* @see #testImplementationAnnotations()
*/
- protected abstract String getExpectedTypeForElement(Class<?> type, Class<?> impl);
+ protected abstract String getExpectedXmlTypeForElement(Class<?> type, Class<?> impl);
/**
* Returns the expected namespace for an element defined by the given specification.
@@ -236,7 +238,7 @@ public abstract strictfp class Annotatio
* @param uml The UML element.
* @return The corresponding XML element name.
*/
- protected String getExpectedTypeName(final UML uml) {
+ protected String getExpectedXmlRootElementName(final UML uml) {
return uml.identifier();
}
@@ -246,7 +248,7 @@ public abstract strictfp class Annotatio
* @param uml The UML element.
* @return The corresponding XML element name.
*/
- protected String getExpectedPropertyName(final UML uml) {
+ protected String getExpectedXmlElementName(final UML uml) {
return uml.identifier();
}
@@ -453,7 +455,7 @@ public abstract strictfp class Annotatio
* <ul>
* <li>All implementation classes have {@link XmlRootElement} and {@link XmlType} annotations.</li>
* <li>The name declared in the {@code XmlType} annotations matches the
- * {@linkplain #getExpectedTypeForElement expected value}.</li>
+ * {@link #getExpectedXmlTypeForElement expected value}.</li>
* <li>The name declared in the {@code XmlRootElement} annotations matches the identifier declared
* in the {@link UML} annotation of the GeoAPI interfaces.</li>
* <li>The namespace declared in the {@code XmlRootElement} annotations is not redundant with
@@ -490,7 +492,7 @@ public abstract strictfp class Annotatio
assertNotNull("Missing @XmlRootElement annotation.", root);
final UML uml = type.getAnnotation(UML.class);
if (uml != null) {
- assertEquals("Wrong @XmlRootElement.name().", getExpectedTypeName(uml), root.name());
+ assertEquals("Wrong @XmlRootElement.name().", getExpectedXmlRootElementName(uml), root.name());
}
/*
* Check that the namespace is the expected one (according subclass)
@@ -502,7 +504,7 @@ public abstract strictfp class Annotatio
*/
final XmlType xmlType = impl.getAnnotation(XmlType.class);
assertNotNull("Missing @XmlType annotation.", xmlType);
- String expected = getExpectedTypeForElement(type, impl);
+ String expected = getExpectedXmlTypeForElement(type, impl);
if (expected == null) {
expected = DEFAULT;
}
@@ -562,7 +564,7 @@ public abstract strictfp class Annotatio
* is because subclasses may choose to override the above test method.
*/
if (uml != null) {
- assertEquals("Wrong @XmlElement.name().", getExpectedPropertyName(uml), element.name());
+ assertEquals("Wrong @XmlElement.name().", getExpectedXmlElementName(uml), element.name());
assertEquals("Wrong @XmlElement.required().", uml.obligation() == Obligation.MANDATORY, element.required());
}
/*
Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -26,7 +26,7 @@ import org.opengis.metadata.citation.Add
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.citation.OnLineFunction;
import org.opengis.metadata.content.ImagingCondition;
-import org.opengis.metadata.service.ParameterDirection;
+import org.opengis.parameter.ParameterDirection;
import org.opengis.referencing.datum.Datum;
import org.opengis.referencing.cs.AxisDirection;
import org.apache.sis.test.TestCase;
Modified: sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java [UTF-8] (original)
+++ sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -20,7 +20,7 @@ import javax.xml.bind.annotation.XmlType
import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.referencing.ReferenceSystem;
import org.opengis.referencing.ReferenceIdentifier;
-import org.apache.sis.internal.jaxb.metadata.ReferenceSystemMetadata;
+import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
/**
Modified: sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java [UTF-8] (original)
+++ sis/branches/JDK6/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -20,7 +20,7 @@ import javax.xml.bind.annotation.XmlType
import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.referencing.ReferenceSystem;
import org.opengis.referencing.ReferenceIdentifier;
-import org.apache.sis.internal.jaxb.metadata.ReferenceSystemMetadata;
+import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
/**
Modified: sis/branches/JDK6/profiles/sis-french-profile/src/test/java/org/apache/sis/profile/france/FrenchProfileTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/profiles/sis-french-profile/src/test/java/org/apache/sis/profile/france/FrenchProfileTest.java?rev=1623891&r1=1623890&r2=1623891&view=diff
==============================================================================
--- sis/branches/JDK6/profiles/sis-french-profile/src/test/java/org/apache/sis/profile/france/FrenchProfileTest.java [UTF-8] (original)
+++ sis/branches/JDK6/profiles/sis-french-profile/src/test/java/org/apache/sis/profile/france/FrenchProfileTest.java [UTF-8] Wed Sep 10 00:06:39 2014
@@ -23,7 +23,7 @@ import org.opengis.metadata.constraint.S
import org.apache.sis.metadata.iso.constraint.DefaultConstraints;
import org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints;
import org.apache.sis.metadata.iso.constraint.DefaultSecurityConstraints;
-import org.apache.sis.internal.jaxb.metadata.ReferenceSystemMetadata;
+import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
import org.apache.sis.internal.profile.fra.IndirectReferenceSystem;
import org.apache.sis.internal.profile.fra.DirectReferenceSystem;
import org.apache.sis.metadata.iso.ImmutableIdentifier;