sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1390273 - in /sis/trunk: sis-build-helper/src/main/java/org/apache/sis/internal/taglet/ sis-build-helper/src/site/apt/ sis-utility/src/main/java/org/apache/sis/resources/
Date Wed, 26 Sep 2012 03:51:54 GMT
Author: desruisseaux
Date: Wed Sep 26 03:51:53 2012
New Revision: 1390273

URL: http://svn.apache.org/viewvc?rev=1390273&view=rev
Log:
Added a WebSite taglet for URL to the Apache SIS web site (Maven reports for now, may be changed
in the future).

Added:
    sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
  (with props)
    sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java 
 (with props)
Modified:
    sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java
    sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Note.java
    sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
    sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Section.java
    sis/trunk/sis-build-helper/src/site/apt/index.apt
    sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/package-info.java

Added: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java?rev=1390273&view=auto
==============================================================================
--- sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
(added)
+++ sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
Wed Sep 26 03:51:53 2012
@@ -0,0 +1,124 @@
+/*
+ * 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.taglet;
+
+import com.sun.javadoc.Tag;
+import com.sun.tools.doclets.Taglet;
+
+
+/**
+ * Base class of inline taglets.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.3
+ * @version 0.3
+ */
+abstract class InlineTaglet implements Taglet {
+    /**
+     * Constructs a default inline taglet.
+     */
+    InlineTaglet() {
+    }
+
+    /**
+     * Returns {@code true} since SIS taglets can be used in overview.
+     *
+     * @return Default to {@code true}.
+     */
+    @Override
+    public boolean inOverview() {
+        return true;
+    }
+
+    /**
+     * Returns {@code true} since SIS taglets can be used in package documentation.
+     *
+     * @return Default to {@code true}.
+     */
+    @Override
+    public boolean inPackage() {
+        return true;
+    }
+
+    /**
+     * Returns {@code true} since SIS taglets can be used in type documentation
+     * (classes or interfaces).
+     *
+     * @return Default to {@code true}.
+     */
+    @Override
+    public boolean inType() {
+        return true;
+    }
+
+    /**
+     * Returns {@code true} since SIS taglets can be used in constructor
+     *
+     * @return Default to {@code true}.
+     */
+    @Override
+    public boolean inConstructor() {
+        return true;
+    }
+
+    /**
+     * Returns {@code true} since SIS taglets can be used in method documentation.
+     *
+     * @return Default to {@code true}.
+     */
+    @Override
+    public boolean inMethod() {
+        return true;
+    }
+
+    /**
+     * Returns {@code true} since SIS taglets can be used in field documentation.
+     *
+     * @return Default to {@code true}.
+     */
+    @Override
+    public boolean inField() {
+        return true;
+    }
+
+    /**
+     * Returns {@code true} since this base class is all about inline tags.
+     *
+     * @return Always {@code true}.
+     */
+    @Override
+    public final boolean isInlineTag() {
+        return true;
+    }
+
+    /**
+     * Given an array of {@code Tag}s representing this custom tag, return its string
+     * representation. This method should not be called since arrays of inline tags do
+     * not exist. However we define it as a matter of principle.
+     *
+     * @param  tags The tags to format.
+     * @return A string representation of the given tags.
+     */
+    @Override
+    public final String toString(final Tag[] tags) {
+        final StringBuilder buffer = new StringBuilder(64);
+        for (int i=0; i<tags.length; i++) {
+            buffer.append(toString(tags[i]));
+        }
+        return buffer.toString();
+    }
+}

Propchange: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java?rev=1390273&r1=1390272&r2=1390273&view=diff
==============================================================================
--- sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java (original)
+++ sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java Wed
Sep 26 03:51:53 2012
@@ -50,7 +50,7 @@ public final class Module implements Tag
     /**
      * The base URL for Maven reports, with a trailing slash.
      */
-    private static final String MAVEN_REPORTS_BASE_URL = "http://builds.apache.org/job/sis-trunk/site/";
+    private static final String MAVEN_REPORTS_BASE_URL = WebSite.URL + '/';
 
     /**
      * The base URL for Maven repository, with a trailing slash.

Modified: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Note.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Note.java?rev=1390273&r1=1390272&r2=1390273&view=diff
==============================================================================
--- sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Note.java (original)
+++ sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Note.java Wed
Sep 26 03:51:53 2012
@@ -28,7 +28,7 @@ import com.sun.tools.doclets.Taglet;
  * @since   0.3 (derived from geotk-3.00)
  * @version 0.3
  */
-public final class Note implements Taglet {
+public final class Note extends InlineTaglet {
     /**
      * Register this taglet.
      *
@@ -57,77 +57,6 @@ public final class Note implements Tagle
     }
 
     /**
-     * Returns {@code true} since <code>@note</code> can be used in overview.
-     *
-     * @return Always {@code false}.
-     */
-    @Override
-    public boolean inOverview() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@note</code> can be used in package documentation.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inPackage() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@note</code> can be used in type documentation
-     * (classes or interfaces).
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inType() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@note</code> can be used in constructor
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inConstructor() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@note</code> can be used in method documentation.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inMethod() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@note</code> can be used in field documentation.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inField() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@note</code> is an inline tag.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean isInlineTag() {
-        return true;
-    }
-
-    /**
      * Given the <code>Tag</code> representation of this custom tag, return its
string representation.
      *
      * @param  tag The tag to format.
@@ -139,21 +68,4 @@ public final class Note implements Tagle
         buffer.append(tag.text());
         return buffer.append("</font></blockquote>").toString();
     }
-
-    /**
-     * Given an array of {@code Tag}s representing this custom tag, return its string
-     * representation. This method should not be called since arrays of inline tags do
-     * not exist. However we define it as a matter of principle.
-     *
-     * @param  tags The tags to format.
-     * @return A string representation of the given tags.
-     */
-    @Override
-    public String toString(final Tag[] tags) {
-        final StringBuilder buffer = new StringBuilder();
-        for (int i=0; i<tags.length; i++) {
-            buffer.append(toString(tags[i]));
-        }
-        return buffer.toString();
-    }
 }

Modified: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java?rev=1390273&r1=1390272&r2=1390273&view=diff
==============================================================================
--- sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
(original)
+++ sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
Wed Sep 26 03:51:53 2012
@@ -31,7 +31,7 @@ import com.sun.tools.doclets.formats.htm
  * @since   0.3 (derived from geotk-3.00)
  * @version 0.3
  */
-public final class Preformat implements Taglet {
+public final class Preformat extends InlineTaglet {
     /**
      * Special characters to replace by HTML entities.
      */
@@ -80,84 +80,6 @@ public final class Preformat implements 
     }
 
     /**
-     * Returns {@code true} since <code>@preformat</code> can be used in package
documentation.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inPackage() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@preformat</code> can be used in type
documentation
-     * (classes or interfaces).
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inType() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@preformat</code> can be used in constructor
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inConstructor() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@preformat</code> can be used in method
documentation.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inMethod() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@preformat</code> can be used in field
documentation.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inField() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@preformat</code> is an inline tag.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean isInlineTag() {
-        return true;
-    }
-
-    /**
-     * Given an array of {@code Tag}s representing this custom tag, return its string
-     * representation. This method should not be called since arrays of inline tags do
-     * not exist. However we define it as a matter of principle.
-     *
-     * @param tags The tags to format.
-     * @return A string representation of the given tags.
-     */
-    @Override
-    public String toString(final Tag[] tags) {
-        final StringBuilder buffer = new StringBuilder();
-        for (int i=0; i<tags.length; i++) {
-            buffer.append(toString(tags[i]));
-        }
-        return buffer.toString();
-    }
-
-    /**
      * Given the <code>Tag</code> representation of this custom tag, return its
string representation.
      *
      * @param tag The tag to format.

Modified: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Section.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Section.java?rev=1390273&r1=1390272&r2=1390273&view=diff
==============================================================================
--- sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Section.java (original)
+++ sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Section.java Wed
Sep 26 03:51:53 2012
@@ -29,7 +29,7 @@ import com.sun.tools.doclets.Taglet;
  * @since   0.3 (derived from geotk-3.00)
  * @version 0.3
  */
-public final class Section implements Taglet {
+public final class Section extends InlineTaglet {
     /**
      * Register this taglet.
      *
@@ -68,67 +68,6 @@ public final class Section implements Ta
     }
 
     /**
-     * Returns {@code true} since <code>@section</code> can be used in package
documentation.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inPackage() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@section</code> can be used in type documentation
-     * (classes or interfaces).
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inType() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@section</code> can be used in constructor
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inConstructor() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@section</code> can be used in method
documentation.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inMethod() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@section</code> can be used in field
documentation.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean inField() {
-        return true;
-    }
-
-    /**
-     * Returns {@code true} since <code>@section</code> is an inline tag.
-     *
-     * @return Always {@code true}.
-     */
-    @Override
-    public boolean isInlineTag() {
-        return true;
-    }
-
-    /**
      * Given the <code>Tag</code> representation of this custom tag, return its
string representation.
      *
      * @param tag The tag to format.
@@ -152,21 +91,4 @@ public final class Section implements Ta
         }
         return buffer.append("</u></b><br>").toString();
     }
-
-    /**
-     * Given an array of {@code Tag}s representing this custom tag, return its string
-     * representation. This method should not be called since arrays of inline tags do
-     * not exist. However we define it as a matter of principle.
-     *
-     * @param tags The tags to format.
-     * @return A string representation of the given tags.
-     */
-    @Override
-    public String toString(final Tag[] tags) {
-        final StringBuilder buffer = new StringBuilder();
-        for (int i=0; i<tags.length; i++) {
-            buffer.append(toString(tags[i]));
-        }
-        return buffer.toString();
-    }
 }

Added: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java?rev=1390273&view=auto
==============================================================================
--- sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java (added)
+++ sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java Wed
Sep 26 03:51:53 2012
@@ -0,0 +1,74 @@
+/*
+ * 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.taglet;
+
+import java.util.Map;
+import com.sun.javadoc.Tag;
+import com.sun.tools.doclets.Taglet;
+
+
+/**
+ * The <code>@website</code> tag for inserting a URL to the web site.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.3
+ * @version 0.3
+ */
+public final class WebSite extends InlineTaglet {
+    /**
+     * URL to the web site, <strong>without</strong> trailing slash.
+     */
+    static final String URL = "http://builds.apache.org/job/sis-trunk/site";
+
+    /**
+     * Register this taglet.
+     *
+     * @param tagletMap the map to register this tag to.
+     */
+    public static void register(final Map<String,Taglet> tagletMap) {
+       final WebSite tag = new WebSite();
+       tagletMap.put(tag.getName(), tag);
+    }
+
+    /**
+     * Constructs a default <code>@website</code> taglet.
+     */
+    private WebSite() {
+        super();
+    }
+
+    /**
+     * Returns the name of this custom tag.
+     *
+     * @return The tag name.
+     */
+    @Override
+    public String getName() {
+        return "website";
+    }
+
+    /**
+     * Given the <code>Tag</code> representation of this custom tag, return its
string representation.
+     *
+     * @param  tag The tag to format.
+     * @return A string representation of the given tag.
+     */
+    @Override
+    public String toString(final Tag tag) {
+        return URL;
+    }
+}

Propchange: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/trunk/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/WebSite.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: sis/trunk/sis-build-helper/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/sis/trunk/sis-build-helper/src/site/apt/index.apt?rev=1390273&r1=1390272&r2=1390273&view=diff
==============================================================================
--- sis/trunk/sis-build-helper/src/site/apt/index.apt (original)
+++ sis/trunk/sis-build-helper/src/site/apt/index.apt Wed Sep 26 03:51:53 2012
@@ -16,6 +16,8 @@ Building Apache SIS
    * <<<@module>>> - replaced in the generated javadoc by a link to the
module where the
      class is defined.
 
+   * <<<{@website}>>> - an inline taglet for the URL to the Apache SIS
web site (Maven reports).
+
    * <<<{@section}>>> - an inline taglet for the title of a new section
in the javadoc.
 
    * <<<{@note}>>> - an inline taglet for a remark that readers can safely
ignore.

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/package-info.java?rev=1390273&r1=1390272&r2=1390273&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/package-info.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/resources/package-info.java Wed Sep
26 03:51:53 2012
@@ -46,6 +46,5 @@
  *
  * @see java.util.ResourceBundle
  * @see java.text.MessageFormat
- * @see <a href="{@website}/sis-build-helper/index.html"><code>sis-build-helper</code>
module</a>
  */
 package org.apache.sis.resources;



Mime
View raw message