sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1793687 - /sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
Date Wed, 03 May 2017 17:42:14 GMT
Author: desruisseaux
Date: Wed May  3 17:42:14 2017
New Revision: 1793687

URL: http://svn.apache.org/viewvc?rev=1793687&view=rev
Log:
Missing annotation in previous commit.

Added:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
  (with props)

Added: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java?rev=1793687&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
(added)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
[UTF-8] Wed May  3 17:42:14 2017
@@ -0,0 +1,77 @@
+/*
+ * 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.metadata;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Documented;
+
+
+/**
+ * Identifies the name of a property to use for summarizing in one line the content of a
metadata object.
+ * For example in a {@linkplain org.apache.sis.metadata.iso.citation.DefaultCitation citation},
it is the
+ * {@code "title"} property. This information is used in {@linkplain MetadataStandard#asTreeTable
metadata
+ * tree views} for producing briefer trees, especially when there is redundant node names.
+ *
+ * <div class="note"><b>Example:</b>
+ * the {@code Citation} type contains a {@linkplain org.apache.sis.metadata.iso.citation.DefaultCitation#getDates()
date}
+ * property which itself contains another {@linkplain org.apache.sis.metadata.iso.citation.DefaultCitationDate#getDate()
+ * date} property. They form a tree like below:
+ *
+ * {@preformat text
+ *   Citation
+ *    └─Date
+ *       ├─Date………………… 2012/01/01
+ *       └─Date type…… Creation
+ * }
+ *
+ * The <code>&#64;TitleProperty(name="date")</code> annotation on the {@code
DefaultCitationDate} implementation class
+ * instructs Apache SIS that the tree table view should be as below:
+ *
+ * {@preformat text
+ *   Citation
+ *    └─Date………………………… 2012/01/01
+ *       └─Date type…… Creation
+ * }
+ * </div>
+ *
+ * The property referenced by this annotation should be the main property if possible, but
not necessarily
+ * since it may be only a label. However the property shall be a singleton ([0…1] or [1…1]
cardinality)
+ * and can not be another metadata object.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 0.8
+ * @since   0.8
+ * @module
+ */
+@Documented
+@Inherited
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface TitleProperty {
+    /**
+     * Returns the name of the property to use as a title for a metadata object.
+     * An empty value means that the metadata has no title property
+     * (may be used for overriding a value inherited from the parent type).
+     *
+     * @return property name of the value to use as a title or summary sentence, or an empty
value if none.
+     */
+    String name();
+}

Propchange: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TitleProperty.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8



Mime
View raw message