sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1452358 - in /sis/branches/JDK7: sis-metadata/src/main/java/org/apache/sis/metadata/ sis-utility/src/main/java/org/apache/sis/util/ sis-utility/src/test/java/org/apache/sis/util/
Date Mon, 04 Mar 2013 16:08:54 GMT
Author: desruisseaux
Date: Mon Mar  4 16:08:54 2013
New Revision: 1452358

URL: http://svn.apache.org/r1452358
Log:
Renamed "attribute" as "property":
- For consistency with JavaBeans properties
- Because in metadata, those "attributes" were XML elements, not XML attributes.

Modified:
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/NullValuePolicy.java
    sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Classes.java
    sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java?rev=1452358&r1=1452357&r2=1452358&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java
[UTF-8] Mon Mar  4 16:08:54 2013
@@ -91,7 +91,7 @@ public abstract class AbstractMetadata i
     /**
      * Compares this metadata with the specified object for equality. The default
      * implementation uses Java reflection. Subclasses may override this method
-     * for better performances, or for comparing "hidden" attributes not specified
+     * for better performances, or for comparing "hidden" properties not specified
      * by the GeoAPI (or other standard) interface.
      *
      * @param  object The object to compare with this metadata.

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java?rev=1452358&r1=1452357&r2=1452358&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
[UTF-8] Mon Mar  4 16:08:54 2013
@@ -164,7 +164,7 @@ public abstract class ModifiableMetadata
             final ModifiableMetadata candidate;
             try {
                 /*
-                 * Need a SHALLOW copy of this metadata, because some attributes
+                 * Need a SHALLOW copy of this metadata, because some properties
                  * may already be unmodifiable and we don't want to clone them.
                  */
                 candidate = clone();
@@ -187,7 +187,7 @@ public abstract class ModifiableMetadata
     }
 
     /**
-     * Declares this metadata and all its attributes as unmodifiable. Any attempt to modify
a
+     * Declares this metadata and all its properties as unmodifiable. Any attempt to modify
a
      * property after this method call will throw an {@link UnmodifiableMetadataException}.
      * If this metadata is already unmodifiable, then this method does nothing.
      *
@@ -236,7 +236,7 @@ public abstract class ModifiableMetadata
      *   <li>Invokes {@link #checkWritePermission()} in order to ensure that this metadata
is
      *       modifiable.</li>
      *   <li>If {@code source} is null or empty, returns {@code null}
-     *       (meaning that the metadata attribute is not provided).</li>
+     *       (meaning that the metadata property is not provided).</li>
      *   <li>If {@code target} is null, creates a new {@link List}.</li>
      *   <li>Copies the content of the given {@code source} into the target.</li>
      * </ul>
@@ -284,7 +284,7 @@ public abstract class ModifiableMetadata
      *   <li>Invokes {@link #checkWritePermission()} in order to ensure that this metadata
is
      *       modifiable.</li>
      *   <li>If {@code source} is null or empty, returns {@code null}
-     *       (meaning that the metadata attribute is not provided).</li>
+     *       (meaning that the metadata property is not provided).</li>
      *   <li>If {@code target} is null, creates a new {@link Set}.</li>
      *   <li>Copies the content of the given {@code source} into the target.</li>
      * </ul>
@@ -332,7 +332,7 @@ public abstract class ModifiableMetadata
      *   <li>Invokes {@link #checkWritePermission()} in order to ensure that this metadata
is
      *       modifiable.</li>
      *   <li>If {@code source} is null or empty, returns {@code null}
-     *       (meaning that the metadata attribute is not provided).</li>
+     *       (meaning that the metadata property is not provided).</li>
      *   <li>If {@code target} is null, creates a new {@link Set} or a new {@link
List}
      *       depending on the value returned by {@link #collectionType(Class)}.</li>
      *   <li>Copies the content of the given {@code source} into the target.</li>
@@ -577,7 +577,7 @@ public abstract class ModifiableMetadata
 
     /**
      * Returns the type of collection to use for the given type. The current implementation
can
-     * return only two values: <code>{@linkplain Set}.class</code> if the attribute
should not
+     * return only two values: <code>{@linkplain Set}.class</code> if the property
should not
      * accept duplicated values, or <code>{@linkplain List}.class</code> otherwise.
Future SIS
      * versions may accept other types.
      *
@@ -590,7 +590,7 @@ public abstract class ModifiableMetadata
      * @param  <E> The type of elements in the collection to be created.
      * @param  elementType The type of elements in the collection to be created.
      * @return {@code List.class} or {@code Set.class} depending on whether the
-     *         attribute shall accept duplicated values or not.
+     *         property shall accept duplicated values or not.
      */
     @SuppressWarnings({"rawtypes","unchecked"})
     protected <E> Class<? extends Collection<E>> collectionType(final Class<E>
elementType) {

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/NullValuePolicy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/NullValuePolicy.java?rev=1452358&r1=1452357&r2=1452358&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/NullValuePolicy.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/NullValuePolicy.java
[UTF-8] Mon Mar  4 16:08:54 2013
@@ -20,7 +20,7 @@ package org.apache.sis.metadata;
 /**
  * Whatever {@link MetadataStandard#asMap MetadataStandard.asMap(…)} shall contain entries
  * for null values or empty collections. By default the map does not provide
- * {@linkplain java.util.Map.Entry entries} for {@code null} metadata attributes or
+ * {@linkplain java.util.Map.Entry entries} for {@code null} metadata properties or
  * {@linkplain java.util.Collection#isEmpty() empty} collections.
  * This enumeration allows control on this behavior.
  *
@@ -39,13 +39,13 @@ public enum NullValuePolicy {
     ALL,
 
     /**
-     * Includes only the non-null attributes.
+     * Includes only the non-null properties.
      * Collections are included no matter if they are empty or not.
      */
     NON_NULL,
 
     /**
-     * Includes only the attributes that are non-null and, in the case of collections,
+     * Includes only the properties that are non-null and, in the case of collections,
      * non-{@linkplain java.util.Collection#isEmpty() empty}.
      * This is the default behavior of {@link AbstractMetadata#asMap()}.
      */

Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java?rev=1452358&r1=1452357&r2=1452358&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] Mon Mar  4 16:08:54 2013
@@ -54,7 +54,7 @@ import static org.apache.sis.internal.ut
 /**
  * The getter methods declared in a GeoAPI interface, together with setter methods (if any)
  * declared in the SIS implementation. An instance of {@code PropertyAccessor} gives access
- * to all public attributes of an instance of a metadata object. It uses reflection for this
+ * to all public properties of an instance of a metadata object. It uses reflection for this
  * purpose, a little bit like the <cite>Java Beans</cite> framework.
  *
  * <p>This accessor groups the properties in two categories:</p>
@@ -338,7 +338,7 @@ final class PropertyAccessor {
              */
             Class<?> elementType = getter.getReturnType();
             if (Collection.class.isAssignableFrom(elementType)) {
-                elementType = Classes.boundOfParameterizedAttribute(getter);
+                elementType = Classes.boundOfParameterizedProperty(getter);
             }
             elementTypes[i] = Numbers.primitiveToWrapper(elementType);
         }
@@ -724,7 +724,7 @@ final class PropertyAccessor {
      * @param  value    The new value.
      * @param  getOld   {@code true} if this method should first fetches the old value.
      * @return The old value, or {@code null} if {@code getOld} was {@code false}.
-     * @throws UnmodifiableMetadataException if the attribute for the given key is read-only.
+     * @throws UnmodifiableMetadataException if the property for the given key is read-only.
      * @throws ClassCastException if the given value is not of the expected type.
      * @throws BackingStoreException if the implementation threw a checked exception.
      */

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1452358&r1=1452357&r2=1452358&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] Mon
Mar  4 16:08:54 2013
@@ -44,7 +44,7 @@ import static org.apache.sis.util.collec
  *       ({@link #findCommonClass(Class, Class) findCommonClass},
  *        {@link #findCommonInterfaces(Class, Class) findCommonInterfaces})</li>
  *   <li>Getting the bounds of a parameterized field or method
- *       ({@link #boundOfParameterizedAttribute(Method) boundOfParameterizedAttribute})</li>
+ *       ({@link #boundOfParameterizedProperty(Method) boundOfParameterizedProperty})</li>
  *   <li>Getting a short class name ({@link #getShortName(Class) getShortName},
  *       {@link #getShortClassName(Object) getShortClassName})</li>
  * </ul>
@@ -137,8 +137,8 @@ public final class Classes extends Stati
     }
 
     /**
-     * Returns the upper bounds of the parameterized type of the given attribute.
-     * If the attribute does not have a parameterized type, returns {@code null}.
+     * Returns the upper bounds of the parameterized type of the given property.
+     * If the property does not have a parameterized type, returns {@code null}.
      *
      * <p>This method is typically used for fetching the type of elements in a collection.
      * We do not provide a method working from a {@link Class} instance because of the way
@@ -162,14 +162,14 @@ public final class Classes extends Stati
      * @return The upper bound of parameterized type, or {@code null} if the given field
      *         is not of a parameterized type.
      */
-    public static Class<?> boundOfParameterizedAttribute(final Field field) {
+    public static Class<?> boundOfParameterizedProperty(final Field field) {
         return getActualTypeArgument(field.getGenericType());
     }
 
     /**
-     * If the given method is a getter or a setter for a parameterized attribute, returns
the
+     * If the given method is a getter or a setter for a parameterized property, returns
the
      * upper bounds of the parameterized type. Otherwise returns {@code null}. This method
-     * provides the same semantic than {@link #boundOfParameterizedAttribute(Field)}, but
+     * provides the same semantic than {@link #boundOfParameterizedProperty(Field)}, but
      * works on a getter or setter method rather then the field. See the javadoc of above
      * method for more details.
      *
@@ -181,7 +181,7 @@ public final class Classes extends Stati
      * @return The upper bound of parameterized type, or {@code null} if the given method
      *         do not operate on an object of a parameterized type.
      */
-    public static Class<?> boundOfParameterizedAttribute(final Method method) {
+    public static Class<?> boundOfParameterizedProperty(final Method method) {
         Class<?> c = getActualTypeArgument(method.getGenericReturnType());
         if (c == null) {
             final Type[] parameters = method.getGenericParameterTypes();
@@ -636,7 +636,7 @@ cmp:    for (final Class<?> c : c1) {
     }
 
     /**
-     * Returns {@code true} if the given method may possibly be the getter method for an
attribute.
+     * Returns {@code true} if the given method may possibly be the getter method for a property.
      * This method implements the algorithm used by SIS in order to identify getter methods
in
      * {@linkplain org.opengis.metadata metadata} interfaces. We do not rely on naming convention
      * (method names starting with "{@code get}" or "{@code is}" prefixes) because not every
methods

Modified: sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java?rev=1452358&r1=1452357&r2=1452358&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [UTF-8]
(original)
+++ sis/branches/JDK7/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [UTF-8]
Mon Mar  4 16:08:54 2013
@@ -185,30 +185,30 @@ public final strictfp class ClassesTest 
     }
 
     /**
-     * Tests the {@link Classes#boundOfParameterizedAttribute(Field)} method.
+     * Tests the {@link Classes#boundOfParameterizedProperty(Field)} method.
      *
      * @throws NoSuchFieldException  Should never occur.
      * @throws NoSuchMethodException Should never occur.
      */
     @Test
-    public void testBoundOfParameterizedAttribute() throws NoSuchFieldException, NoSuchMethodException
{
+    public void testBoundOfParameterizedProperty() throws NoSuchFieldException, NoSuchMethodException
{
         final Class<?>[] g = null;
         final Class<?>[] s = new Class<?>[] {Set.class};
         final Class<Parameterized> c = Parameterized.class;
-        assertNull(                 boundOfParameterizedAttribute(c.getMethod("getter0",
g)));
-        assertNull(                 boundOfParameterizedAttribute(c.getMethod("setter0",
s)));
-        assertEquals(Long   .class, boundOfParameterizedAttribute(c.getField ("attrib2" 
 )));
-        assertEquals(Integer.class, boundOfParameterizedAttribute(c.getMethod("getter1",
g)));
-        assertEquals(Byte   .class, boundOfParameterizedAttribute(c.getMethod("getter2",
g)));
-        assertEquals(Object .class, boundOfParameterizedAttribute(c.getMethod("getter3",
g)));
-        assertEquals(short[].class, boundOfParameterizedAttribute(c.getMethod("getter4",
g)));
-        assertEquals(String .class, boundOfParameterizedAttribute(c.getMethod("setter1",
s)));
-        assertEquals(Short  .class, boundOfParameterizedAttribute(c.getMethod("setter2",
s)));
-        assertEquals(Object .class, boundOfParameterizedAttribute(c.getMethod("setter3",
s)));
+        assertNull(                 boundOfParameterizedProperty(c.getMethod("getter0", g)));
+        assertNull(                 boundOfParameterizedProperty(c.getMethod("setter0", s)));
+        assertEquals(Long   .class, boundOfParameterizedProperty(c.getField ("attrib2"  
)));
+        assertEquals(Integer.class, boundOfParameterizedProperty(c.getMethod("getter1", g)));
+        assertEquals(Byte   .class, boundOfParameterizedProperty(c.getMethod("getter2", g)));
+        assertEquals(Object .class, boundOfParameterizedProperty(c.getMethod("getter3", g)));
+        assertEquals(short[].class, boundOfParameterizedProperty(c.getMethod("getter4", g)));
+        assertEquals(String .class, boundOfParameterizedProperty(c.getMethod("setter1", s)));
+        assertEquals(Short  .class, boundOfParameterizedProperty(c.getMethod("setter2", s)));
+        assertEquals(Object .class, boundOfParameterizedProperty(c.getMethod("setter3", s)));
     }
 
     /**
-     * Dummy class for {@link #testBoundOfParameterizedAttribute()} usage only.
+     * Dummy class for {@link #testBoundOfParameterizedProperty()} usage only.
      */
     private static final class Parameterized {
         public Set<? extends Long> attrib2 = null;



Mime
View raw message