You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2007/03/13 18:44:45 UTC
svn commit: r517786 -
/incubator/uima/uimaj/trunk/uimaj-jet-expander/src/org/apache/uima/util/jet/JetExpander.java
Author: schor
Date: Tue Mar 13 10:44:45 2007
New Revision: 517786
URL: http://svn.apache.org/viewvc?view=rev&rev=517786
Log:
JIRA-342 jet expander to take another clause: implements "xxxxx"
Modified:
incubator/uima/uimaj/trunk/uimaj-jet-expander/src/org/apache/uima/util/jet/JetExpander.java
Modified: incubator/uima/uimaj/trunk/uimaj-jet-expander/src/org/apache/uima/util/jet/JetExpander.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-jet-expander/src/org/apache/uima/util/jet/JetExpander.java?view=diff&rev=517786&r1=517785&r2=517786
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-jet-expander/src/org/apache/uima/util/jet/JetExpander.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-jet-expander/src/org/apache/uima/util/jet/JetExpander.java Tue Mar 13 10:44:45 2007
@@ -154,6 +154,14 @@
nextQuotePos = in.indexOf('"',i);
String className = in.substring(i, nextQuotePos);
+ String p4 = "implements=\"";
+ String implementsName = null;
+ i = in.indexOf(p4, nextQuotePos) + p4.length();
+ if (i > 0) {
+ nextQuotePos = in.indexOf('"',i);
+ implementsName = in.substring(i, nextQuotePos);
+ }
+
String outFileName = null;
try {
outFileName = outDir + File.separator + pkg.replaceAll("\\.","\\\\") + File.separator + className + ".java";
@@ -171,7 +179,11 @@
fileWriter.write("import " + imports[j] + ";\n");
}
- fileWriter.write("\npublic class " + className + " {\n\n");
+ fileWriter.write("\npublic class " + className);
+ if (implementsName != null) {
+ fileWriter.write(" implements " + implementsName);
+ }
+ fileWriter.write(" {\n\n");
fileWriter.write(" public String generate(Object argument) {\n");
fileWriter.write(" StringBuffer stringBuffer = new StringBuffer();\n");