incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickcha...@apache.org
Subject svn commit: rev 31055 - in incubator/depot/trunk/version/src: java/org/apache/depot/version/generation templates
Date Sat, 31 Jul 2004 22:03:36 GMT
Author: nickchalko
Date: Sat Jul 31 15:03:35 2004
New Revision: 31055

Modified:
   incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/VersionSourceGenerator.java
   incubator/depot/trunk/version/src/templates/VersionSourceGenerator.java.jet
Log:
No dependent, Fixed the Singleton.

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/VersionSourceGenerator.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/VersionSourceGenerator.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/generation/VersionSourceGenerator.java
Sat Jul 31 15:03:35 2004
@@ -30,40 +30,41 @@
   protected final String TEXT_6 = NL + " * by ";
   protected final String TEXT_7 = NL + " * @author <a href=\"http://incubator.apache.org/depot\">Depot
Version</a> " + NL + " *         from the <a href=\"http://incubator.apache.org/\">Apache
Incubator</a>, " + NL + "           version ";
   protected final String TEXT_8 = NL + " * @version ";
-  protected final String TEXT_9 = NL + " */" + NL + "public class ";
-  protected final String TEXT_10 = " {" + NL + "\tpublic final static  ";
+  protected final String TEXT_9 = NL + " */" + NL + "public final class ";
+  protected final String TEXT_10 = " {" + NL + "\tprivate final static  ";
   protected final String TEXT_11 = " INSTANCE = new  ";
-  protected final String TEXT_12 = "();" + NL + "\t" + NL + "\t" + NL + "\tprivate  ";
-  protected final String TEXT_13 = "()  {}" + NL + "\t" + NL + "\t/**" + NL + "\t * The user
that built ";
-  protected final String TEXT_14 = " was ";
-  protected final String TEXT_15 = "." + NL + "\t * @return the String \"";
-  protected final String TEXT_16 = "\"" + NL + "\t */" + NL + "\tpublic String getUser()
{return \"";
-  protected final String TEXT_17 = "\"; }" + NL + "\t" + NL + "\t\t" + NL + "\t/**" + NL
+ "\t * ";
-  protected final String TEXT_18 = " was built on ";
-  protected final String TEXT_19 = "." + NL + "\t * @return the String \"";
-  protected final String TEXT_20 = "\"" + NL + "\t */" + NL + "\tpublic String getHost()
{return \"";
-  protected final String TEXT_21 = "\"; }" + NL + "\t" + NL + "\t/**" + NL + "\t * ";
-  protected final String TEXT_22 = " was built at ";
-  protected final String TEXT_23 = "." + NL + "\t * @return the Date \"";
-  protected final String TEXT_24 = "\"" + NL + "\t */" + NL + "\tpublic Date getDate() {return
new Date(";
-  protected final String TEXT_25 = "l); }" + NL + "\t" + NL + "\t/**" + NL + "\t * The ID
of the Version Specification." + NL + "\t * @return ID of the Version Specification." + NL
+ "\t * @see org.apache.depot.version.specification.VersionSpecificationFactory" + NL + "\t
*/" + NL + "\tpublic String getSpecificationId(){return \"";
-  protected final String TEXT_26 = "\";} " + NL + "\t" + NL + "\t" + NL + "\t/**" + NL +
"\t * ";
-  protected final String TEXT_27 = " ";
-  protected final String TEXT_28 = "." + NL + "\t * @return the String \"";
-  protected final String TEXT_29 = "\"" + NL + "\t */" + NL + "\tpublic String getShortVersion()
{return \"";
-  protected final String TEXT_30 = "\";}" + NL + "\t" + NL + "\t/**" + NL + "\t * ";
-  protected final String TEXT_31 = " ";
-  protected final String TEXT_32 = "." + NL + "\t * @return the String \"";
-  protected final String TEXT_33 = "\"" + NL + "\t */" + NL + "\tpublic String getLongVersion()
{return \"";
-  protected final String TEXT_34 = "\";}" + NL + "" + NL + "\t/**" + NL + "\t * ";
-  protected final String TEXT_35 = " ";
-  protected final String TEXT_36 = "." + NL + "\t * @return the String \"";
-  protected final String TEXT_37 = "\"" + NL + "\t */" + NL + "\tpublic String getDefaultVersion()
{return \"";
-  protected final String TEXT_38 = "\";}\t" + NL + "\t" + NL + "\t/**" + NL + "\t * ";
-  protected final String TEXT_39 = " ";
-  protected final String TEXT_40 = "." + NL + "\t * @return the String \"";
-  protected final String TEXT_41 = "\"" + NL + "\t */" + NL + "\tpublic String toString()
{return \"";
-  protected final String TEXT_42 = "\";}" + NL + "}    ";
+  protected final String TEXT_12 = "();" + NL + "\t" + NL + "\tpublic static ";
+  protected final String TEXT_13 = " getInstance() {return INSTANCE ;}" + NL + "\t" + NL
+ "\tprivate  ";
+  protected final String TEXT_14 = "()  {}" + NL + "\t" + NL + "\t/**" + NL + "\t * The user
that built ";
+  protected final String TEXT_15 = " was ";
+  protected final String TEXT_16 = "." + NL + "\t * @return the String \"";
+  protected final String TEXT_17 = "\"" + NL + "\t */" + NL + "\tpublic String getUser()
{return \"";
+  protected final String TEXT_18 = "\"; }" + NL + "\t" + NL + "\t\t" + NL + "\t/**" + NL
+ "\t * ";
+  protected final String TEXT_19 = " was built on ";
+  protected final String TEXT_20 = "." + NL + "\t * @return the String \"";
+  protected final String TEXT_21 = "\"" + NL + "\t */" + NL + "\tpublic String getHost()
{return \"";
+  protected final String TEXT_22 = "\"; }" + NL + "\t" + NL + "\t/**" + NL + "\t * ";
+  protected final String TEXT_23 = " was built at ";
+  protected final String TEXT_24 = "." + NL + "\t * @return the Date \"";
+  protected final String TEXT_25 = "\"" + NL + "\t */" + NL + "\tpublic Date getDate() {return
new Date(";
+  protected final String TEXT_26 = "l); }" + NL + "\t" + NL + "\t/**" + NL + "\t * The ID
of the Version Specification." + NL + "\t * @return ID of the Version Specification." + NL
+ "\t * @see org.apache.depot.version.specification.VersionSpecificationFactory" + NL + "\t
*/" + NL + "\tpublic String getSpecificationId(){return \"";
+  protected final String TEXT_27 = "\";} " + NL + "\t" + NL + "\t" + NL + "\t/**" + NL +
"\t * ";
+  protected final String TEXT_28 = " ";
+  protected final String TEXT_29 = "." + NL + "\t * @return the String \"";
+  protected final String TEXT_30 = "\"" + NL + "\t */" + NL + "\tpublic String getShortVersion()
{return \"";
+  protected final String TEXT_31 = "\";}" + NL + "\t" + NL + "\t/**" + NL + "\t * ";
+  protected final String TEXT_32 = " ";
+  protected final String TEXT_33 = "." + NL + "\t * @return the String \"";
+  protected final String TEXT_34 = "\"" + NL + "\t */" + NL + "\tpublic String getLongVersion()
{return \"";
+  protected final String TEXT_35 = "\";}" + NL + "" + NL + "\t/**" + NL + "\t * ";
+  protected final String TEXT_36 = " ";
+  protected final String TEXT_37 = "." + NL + "\t * @return the String \"";
+  protected final String TEXT_38 = "\"" + NL + "\t */" + NL + "\tpublic String getDefaultVersion()
{return \"";
+  protected final String TEXT_39 = "\";}\t" + NL + "\t" + NL + "\t/**" + NL + "\t * ";
+  protected final String TEXT_40 = " ";
+  protected final String TEXT_41 = "." + NL + "\t * @return the String \"";
+  protected final String TEXT_42 = "\"" + NL + "\t */" + NL + "\tpublic String toString()
{return \"";
+  protected final String TEXT_43 = "\";}" + NL + "}    ";
 
     public String generate(String packageName,  String className, VersionMarker marker)
   {
@@ -93,64 +94,66 @@
     stringBuffer.append(TEXT_12);
     stringBuffer.append(className);
     stringBuffer.append(TEXT_13);
-    stringBuffer.append(marker.getId());
+    stringBuffer.append(className);
     stringBuffer.append(TEXT_14);
-    stringBuffer.append(getUser());
+    stringBuffer.append(marker.getId());
     stringBuffer.append(TEXT_15);
     stringBuffer.append(getUser());
     stringBuffer.append(TEXT_16);
     stringBuffer.append(getUser());
     stringBuffer.append(TEXT_17);
-    stringBuffer.append(marker.getId());
+    stringBuffer.append(getUser());
     stringBuffer.append(TEXT_18);
-    stringBuffer.append(getHost());
+    stringBuffer.append(marker.getId());
     stringBuffer.append(TEXT_19);
     stringBuffer.append(getHost());
     stringBuffer.append(TEXT_20);
     stringBuffer.append(getHost());
     stringBuffer.append(TEXT_21);
-    stringBuffer.append(marker.getId());
+    stringBuffer.append(getHost());
     stringBuffer.append(TEXT_22);
-    stringBuffer.append(getDate());
+    stringBuffer.append(marker.getId());
     stringBuffer.append(TEXT_23);
     stringBuffer.append(getDate());
     stringBuffer.append(TEXT_24);
-    stringBuffer.append(getDate().getTime());
+    stringBuffer.append(getDate());
     stringBuffer.append(TEXT_25);
-    stringBuffer.append(marker.getSpecification().getId());
+    stringBuffer.append(getDate().getTime());
     stringBuffer.append(TEXT_26);
-    stringBuffer.append(marker.getId());
+    stringBuffer.append(marker.getSpecification().getId());
     stringBuffer.append(TEXT_27);
-    stringBuffer.append(marker.getShortVersion());
+    stringBuffer.append(marker.getId());
     stringBuffer.append(TEXT_28);
     stringBuffer.append(marker.getShortVersion());
     stringBuffer.append(TEXT_29);
     stringBuffer.append(marker.getShortVersion());
     stringBuffer.append(TEXT_30);
-    stringBuffer.append(marker.getId());
+    stringBuffer.append(marker.getShortVersion());
     stringBuffer.append(TEXT_31);
-    stringBuffer.append(marker.getLongVersion());
+    stringBuffer.append(marker.getId());
     stringBuffer.append(TEXT_32);
     stringBuffer.append(marker.getLongVersion());
     stringBuffer.append(TEXT_33);
     stringBuffer.append(marker.getLongVersion());
     stringBuffer.append(TEXT_34);
-    stringBuffer.append(marker.getId());
+    stringBuffer.append(marker.getLongVersion());
     stringBuffer.append(TEXT_35);
-    stringBuffer.append(marker.getDefaultVersion());
+    stringBuffer.append(marker.getId());
     stringBuffer.append(TEXT_36);
     stringBuffer.append(marker.getDefaultVersion());
     stringBuffer.append(TEXT_37);
     stringBuffer.append(marker.getDefaultVersion());
     stringBuffer.append(TEXT_38);
-    stringBuffer.append(marker.getId());
+    stringBuffer.append(marker.getDefaultVersion());
     stringBuffer.append(TEXT_39);
-    stringBuffer.append(marker.getLongVersion());
+    stringBuffer.append(marker.getId());
     stringBuffer.append(TEXT_40);
     stringBuffer.append(marker.getLongVersion());
     stringBuffer.append(TEXT_41);
     stringBuffer.append(marker.getLongVersion());
     stringBuffer.append(TEXT_42);
+    stringBuffer.append(marker.getLongVersion());
+    stringBuffer.append(TEXT_43);
     return stringBuffer.toString();
   }
 }

Modified: incubator/depot/trunk/version/src/templates/VersionSourceGenerator.java.jet
==============================================================================
--- incubator/depot/trunk/version/src/templates/VersionSourceGenerator.java.jet	(original)
+++ incubator/depot/trunk/version/src/templates/VersionSourceGenerator.java.jet	Sat Jul 31
15:03:35 2004
@@ -23,9 +23,10 @@
            version <%=depotVersion.getLongVersion() %>
  * @version <%=marker.getLongVersion()%>
  */
-public class <%=className%> {
-	public final static  <%=className%> INSTANCE = new  <%=className%>();
+public final class <%=className%> {
+	private final static  <%=className%> INSTANCE = new  <%=className%>();
 	
+	public static <%=className%> getInstance() {return INSTANCE ;}
 	
 	private  <%=className%>()  {}
 	

Mime
View raw message