sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1594973 - in /sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature: DefaultAssociation.java DefaultAttribute.java DefaultOperation.java FieldType.java Property.java
Date Thu, 15 May 2014 16:36:06 GMT
Author: desruisseaux
Date: Thu May 15 16:36:06 2014
New Revision: 1594973

URL: http://svn.apache.org/r1594973
Log:
Added a convenience 'getName()' method in Property. The previous GeoAPI model did the same.

Modified:
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociation.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FieldType.java
    sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociation.java?rev=1594973&r1=1594972&r2=1594973&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAssociation.java
[UTF-8] Thu May 15 16:36:06 2014
@@ -17,6 +17,7 @@
 package org.apache.sis.feature;
 
 import java.io.Serializable;
+import org.opengis.util.GenericName;
 import org.opengis.metadata.quality.DataQuality;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.ArgumentChecks;
@@ -79,6 +80,17 @@ public class DefaultAssociation extends 
     }
 
     /**
+     * Returns the name of this association as defined by its {@linkplain #getRole() role}.
+     * This convenience method delegates to {@link DefaultAssociationRole#getName()}.
+     *
+     * @return The association name specified by its role.
+     */
+    @Override
+    public GenericName getName() {
+        return role.getName();
+    }
+
+    /**
      * Returns information about the association.
      *
      * <div class="warning"><b>Warning:</b> In a future SIS version, the
return type may be changed
@@ -127,7 +139,7 @@ public class DefaultAssociation extends 
             final DefaultFeatureType type = value.getType();
             if (base != type && !base.maybeAssignableFrom(type)) {
                 throw new IllegalArgumentException(
-                        Errors.format(Errors.Keys.IllegalArgumentClass_3, role.getName(),
base.getName(), type.getName()));
+                        Errors.format(Errors.Keys.IllegalArgumentClass_3, getName(), base.getName(),
type.getName()));
             }
         }
         this.value = value;

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.java?rev=1594973&r1=1594972&r2=1594973&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultAttribute.java
[UTF-8] Thu May 15 16:36:06 2014
@@ -17,6 +17,7 @@
 package org.apache.sis.feature;
 
 import java.io.Serializable;
+import org.opengis.util.GenericName;
 import org.opengis.metadata.quality.DataQuality;
 import org.opengis.metadata.maintenance.ScopeCode;
 import org.apache.sis.util.Debug;
@@ -93,6 +94,17 @@ public class DefaultAttribute<T> extends
     }
 
     /**
+     * Returns the name of this attribute as defined by its {@linkplain #getType() type}.
+     * This convenience method delegates to {@link DefaultAttributeType#getName()}.
+     *
+     * @return The attribute name specified by its type.
+     */
+    @Override
+    public GenericName getName() {
+        return type.getName();
+    }
+
+    /**
      * Returns information about the attribute (base Java class, domain of values, <i>etc.</i>).
      *
      * <div class="warning"><b>Warning:</b> In a future SIS version, the
return type may be changed

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java?rev=1594973&r1=1594972&r2=1594973&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/DefaultOperation.java
[UTF-8] Thu May 15 16:36:06 2014
@@ -137,7 +137,7 @@ public class DefaultOperation extends Pr
     @Override
     public String toString() {
         final StringBuilder buffer = new StringBuilder(40).append("Operation").append('[');
-        final GenericName name = super.getName();
+        final GenericName name = getName();
         if (name != null) {
             buffer.append('“');
         }

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FieldType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FieldType.java?rev=1594973&r1=1594972&r2=1594973&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FieldType.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/FieldType.java
[UTF-8] Thu May 15 16:36:06 2014
@@ -118,7 +118,7 @@ abstract class FieldType extends Propert
      */
     final StringBuilder toString(final String typeName, final String valueName) {
         final StringBuilder buffer = new StringBuilder(40).append(typeName).append('[');
-        final GenericName name = super.getName();
+        final GenericName name = getName();
         if (name != null) {
             buffer.append('“');
         }

Modified: sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java?rev=1594973&r1=1594972&r2=1594973&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-feature/src/main/java/org/apache/sis/feature/Property.java
[UTF-8] Thu May 15 16:36:06 2014
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.feature;
 
+import org.opengis.util.GenericName;
+
 
 /**
  * Place-holder for an interface not available in GeoAPI 3.0.
@@ -30,4 +32,5 @@ package org.apache.sis.feature;
  * @module
  */
 abstract class Property {
+    public abstract GenericName getName();
 }



Mime
View raw message