krysalis-version/src/templates version.skeleton,NONE,1.1 VersionSourceGenerator.javajet,NONE,1.1
Nick Chalko <[email protected]>
| Newsgroups | gmane.comp.krysalis.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/krysalis/krysalis-version/src/templates
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2482/src/templates
Added Files:
version.skeleton VersionSourceGenerator.javajet
Log Message:
Moved some initial files over nothing compiles yet.
--- NEW FILE: VersionSourceGenerator.javajet ---
<%@ jet
package="org.krysalis.version.ant.stamp"
class="VersionSourceGenerator"
skeleton="version.skeleton"
imports="org.apache.depot.version.VersionMarker java.util.Iterator java.util.Map"
%>
<%
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.
*/
/* NOTE this will also show up in VersionSourceGenerator.java but not in the
* Generated VersionStamp.
*/
%>
/*
*
* NOTE: Automatically Generated File (see Depot Version from the Apache Incubator)
* NOTE: http://incubator.apache.org/depot/version
* NOTE: Ant Task: version-stamp
* NOTE: AntLib: apache-version
*
* $Header: /cvsroot/krysalis/krysalis-version/src/templates/VersionSourceGenerator.javajet,v 1.1 2004/11/04 08:32:33 chalko Exp $
*
*/
package <%=packageName%>;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* A autogenerated VersionStamp class for <%=marker.getId()%> .
* Generated at <%=new java.util.Date() %>
* on <%=getHost()%>
* by <%=getUser()%>
* @author <a href="http://incubator.apache.org/depot">Depot Version</a>
* from the <a href="http://incubator.apache.org/">Apache Incubator</a>,
version <%=depotVersion.getLongVersion() %>
* @version <%=marker.getLongVersion()%>
* @generated
*/
public final class <%=className%> {
/* SINGLETON PATTERN */
private final static <%=className%> INSTANCE = new <%=className%>();
/**
* Get the single instance of <%=className%>.
* @return the single instance of <%=className%>.
*/
public static <%=className%> getInstance() {return INSTANCE ;}
private final Map attributes;
/**
* Private constructor for Singleton.
*/
private <%=className%>() {
Map temp = new HashMap();
<%
for (Iterator i = marker.getAttributes().entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
// TODO need to escape key and value.
%>
temp.put(<%=getValueFrom(entry.getKey())%>,
<%=getValueFrom(entry.getValue())%>);// <%=entry.getValue()%>
<%
}%>
attributes = Collections.unmodifiableMap(temp);
}
/**
* <%=marker.getId()%> is the Id of this project.
* @return the String "<%=marker.getId()%>"
*/
public String getId() {return "<%=marker.getId()%>"; }
/**
* The user that built <%=marker.getId()%> was <%=getUser()%>.
* @return the String "<%=getUser()%>"
*/
public String getUser() {return "<%=getUser()%>"; }
/**
* <%=marker.getId()%> was built on <%=getHost()%>.
* @return the String "<%=getHost()%>"
*/
public String getHost() {return "<%=getHost()%>"; }
/**
* <%=marker.getId()%> was built at <%=getDate()%>.
* @return the Date "<%=getDate()%>"
*/
public Date getDate() {return <%=getValueFrom(getDate())%>; }
/**
* The ID of the Version Specification.
* @return the String "<%=marker.getSpecification().getId()%>".
* @see org.apache.depot.version.specification.VersionSpecificationFactory
*/
public String getSpecificationId(){return "<%=marker.getSpecification().getId()%>";}
/**
* <%=marker.getId()%> <%=marker.getShortVersion()%>.
* @return the String "<%=marker.getShortVersion()%>"
*/
public String getShortVersion() {return "<%=marker.getShortVersion()%>";}
/**
* <%=marker.getId()%> <%=marker.getLongVersion()%>.
* @return the String "<%=marker.getLongVersion()%>"
*/
public String getLongVersion() {return "<%=marker.getLongVersion()%>";}
/**
* <%=marker.getId()%> <%=marker.getDefaultVersion()%>.
* @return the String "<%=marker.getDefaultVersion()%>"
*/
public String getDefaultVersion() {return "<%=marker.getDefaultVersion()%>";}
/**
* Get the Unmodifiable map of attributes.
* <dl><%
for (Iterator i = marker.getAttributes().entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
// TODO need to escape key and value.
%>
* <dt><%=entry.getKey()%></dt>
* <dd><%=entry.getValue()%></dd><%
}%>
* </dl>
* @return unmodifiable Map of attributes.
*/
public Map getAttributes () {return attributes;}
/**
* <%=marker.getId()%> <%=marker.getLongVersion()%>.
* @return the String "<%=marker.getLongVersion()%>"
*/
public String toString() {return "<%=marker.getLongVersion()%>";}
}
--- NEW FILE: version.skeleton ---
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.
*/
public final class CLASS extends org.krysalis.version.ant.stamp.Skeleton
{
public String generate(String packageName, String className, VersionMarker marker)
{
return "";
}
}
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click