You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by mb...@apache.org on 2010/01/28 19:56:51 UTC

svn commit: r904214 - in /ant/core/trunk/src/main/org/apache/tools/ant/types/resources: ArchiveResource.java CompressedResource.java ContentTransformingResource.java JavaConstantResource.java MappedResource.java MappedResourceCollection.java

Author: mbenson
Date: Thu Jan 28 18:56:50 2010
New Revision: 904214

URL: http://svn.apache.org/viewvc?rev=904214&view=rev
Log:
javadoc/formatting/protected constructors for abstract classes

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java
    ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java?rev=904214&r1=904213&r2=904214&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java Thu Jan 28 18:56:50 2010
@@ -42,7 +42,7 @@
     /**
      * Default constructor.
      */
-    public ArchiveResource() {
+    protected ArchiveResource() {
     }
 
     /**
@@ -50,7 +50,7 @@
      * entry in the specified archive.
      * @param a the archive as File.
      */
-    public ArchiveResource(File a) {
+    protected ArchiveResource(File a) {
         this(a, false);
     }
 
@@ -60,7 +60,7 @@
      * @param a the archive as File.
      * @param withEntry if the entry has been specified.
      */
-    public ArchiveResource(File a, boolean withEntry) {
+    protected ArchiveResource(File a, boolean withEntry) {
         setArchive(a);
         haveEntry = withEntry;
     }
@@ -71,7 +71,7 @@
      * @param a the archive as Resource.
      * @param withEntry if the entry has been specified.
      */
-    public ArchiveResource(Resource a, boolean withEntry) {
+    protected ArchiveResource(Resource a, boolean withEntry) {
         addConfigured(a);
         haveEntry = withEntry;
     }
@@ -242,6 +242,10 @@
             : getArchive().toString() + ':' + getName();
     }
 
+    /**
+     * Validate settings and ensure that the represented "archive entry"
+     * has been established.  
+     */
     protected final synchronized void checkEntry() throws BuildException {
         dieOnCircularReference();
         if (haveEntry) {
@@ -266,10 +270,13 @@
     }
 
     /**
-     * fetches information from the named entry inside the archive.
+     * Fetch information from the named entry inside the archive.
      */
     protected abstract void fetchEntry();
 
+    /**
+     * {@inheritDoc}
+     */
     protected synchronized void dieOnCircularReference(Stack stk, Project p) {
         if (isChecked()) {
             return;

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java?rev=904214&r1=904213&r2=904214&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java Thu Jan 28 18:56:50 2010
@@ -31,14 +31,14 @@
 public abstract class CompressedResource extends ContentTransformingResource {
 
     /** no arg constructor */
-    public CompressedResource() {
+    protected CompressedResource() {
     }
 
     /**
      * Constructor with another resource to wrap.
      * @param other the resource to wrap.
      */
-    public CompressedResource(ResourceCollection other) {
+    protected CompressedResource(ResourceCollection other) {
         addConfigured(other);
     }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java?rev=904214&r1=904213&r2=904214&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java Thu Jan 28 18:56:50 2010
@@ -26,7 +26,7 @@
 import org.apache.tools.ant.util.FileUtils;
 
 /**
- * A compressed resource.
+ * A resource that transforms the content of another resource.
  *
  * <p>Wraps around another resource, delegates all queries (except
  * getSize) to that other resource but transforms stream content
@@ -39,14 +39,14 @@
     private static final int BUFFER_SIZE = 8192;
 
     /** no arg constructor */
-    public ContentTransformingResource() {
+    protected ContentTransformingResource() {
     }
 
     /**
      * Constructor with another resource to wrap.
      * @param other the resource to wrap.
      */
-    public ContentTransformingResource(ResourceCollection other) {
+    protected ContentTransformingResource(ResourceCollection other) {
         super(other);
     }
 
@@ -121,7 +121,7 @@
                 if (a != null) {
                     return new Appendable() {
                         public OutputStream getAppendOutputStream()
-                            throws IOException {
+                                throws IOException {
                             OutputStream out = a.getAppendOutputStream();
                             if (out != null) {
                                 out = wrapStream(out);
@@ -139,7 +139,7 @@
     }
 
     /**
-     * whether the transformation performed allows appends.
+     * Learn whether the transformation performed allows appends.
      *
      * <p>In general compressed outputs will become invalid if they
      * are appended to, for example.</p>
@@ -151,7 +151,7 @@
     }    
 
     /**
-     * Is supposed to wrap the stream.
+     * Get a content-filtering/transforming InputStream.
      *
      * @param in InputStream to wrap, will never be null.
      * @return a compressed inputstream.
@@ -161,7 +161,7 @@
         throws IOException;
 
     /**
-     * Is supposed to wrap the stream to allow transformation on the fly.
+     * Get a content-filtering/transforming OutputStream.
      *
      * @param out OutputStream to wrap, will never be null.
      * @return a compressed outputstream.

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java?rev=904214&r1=904213&r2=904214&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java Thu Jan 28 18:56:50 2010
@@ -25,8 +25,7 @@
 /**
  * A resource that is a java constant.
  * This lets you extract values off the classpath and use them elsewhere
- * @since Ant1.7
- *
+ * @since Ant 1.7
  */
 
 public class JavaConstantResource extends AbstractClasspathResource {
@@ -67,5 +66,4 @@
         }
     }
 
-
 }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java?rev=904214&r1=904213&r2=904214&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java Thu Jan 28 18:56:50 2010
@@ -35,6 +35,8 @@
 
     /**
      * Wraps an existing resource.
+     * @param r Resource to wrap
+     * @param m FileNameMapper that handles mapping
      */
     public MappedResource(Resource r, FileNameMapper m) {
         super(r);
@@ -48,14 +50,14 @@
         String name = getResource().getName();
         if (isReference()) {
             return name;
-        } else {
-            String[] mapped = mapper.mapFileName(name);
-            return mapped != null && mapped.length > 0 ? mapped[0] : null;
         }
+        String[] mapped = mapper.mapFileName(name);
+        return mapped != null && mapped.length > 0 ? mapped[0] : null;
     }
 
     /**
      * Not really supported since mapper is never null.
+     * @param r reference to set
      */
     public void setRefid(Reference r) {
         if (mapper != null) {
@@ -66,10 +68,11 @@
 
     /**
      * Suppress FileProvider
+     * @param clazz the type to implement
      */
     public Object as(Class clazz) {
         return FileProvider.class.isAssignableFrom(clazz) 
-            ? null : getResource().as(clazz);
+                ? null : getResource().as(clazz);
     }
 
-}
\ No newline at end of file
+}

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java?rev=904214&r1=904213&r2=904214&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java Thu Jan 28 18:56:50 2010
@@ -35,7 +35,7 @@
  * @since Ant 1.8.0
  */
 public class MappedResourceCollection
-    extends DataType implements ResourceCollection, Cloneable {
+        extends DataType implements ResourceCollection, Cloneable {
 
     private ResourceCollection nested = null;
     private Mapper mapper = null;
@@ -86,7 +86,7 @@
     }
 
     /**
-     * @return false
+     * {@inheritDoc}
      */
     public boolean isFilesystemOnly() {
         if (isReference()) {
@@ -98,7 +98,7 @@
     }
 
     /**
-     * @return size of the nested resource collection.
+     * {@inheritDoc}
      */
     public int size() {
         if (isReference()) {
@@ -108,6 +108,9 @@
         return nested.size();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Iterator iterator() {
         if (isReference()) {
             return ((MappedResourceCollection) getCheckedRef()).iterator();
@@ -128,8 +131,7 @@
     }
 
     /**
-     * Implement clone.  The nested resource collection and mapper are
-     * copied.
+     * Implement clone.  The nested resource collection and mapper are copied.
      * @return a cloned instance.
      */
     public Object clone() {
@@ -204,4 +206,4 @@
             throw new UnsupportedOperationException();
         }
     }
-}
\ No newline at end of file
+}