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 2016/08/01 22:00:00 UTC
svn commit: r1754802 - in
/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main:
java/org/apache/uima/tools/jcasgen/JCasTypeTemplate.java
javajet/jcasgen/templates/JCasType.javajet
Author: schor
Date: Mon Aug 1 21:59:59 2016
New Revision: 1754802
URL: http://svn.apache.org/viewvc?rev=1754802&view=rev
Log:
no Jira - restore the accidentally deleted part of jcas gen which (for subtypes of annotation) included the additional constructor with the begin/end args
Modified:
uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/JCasTypeTemplate.java
uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/javajet/jcasgen/templates/JCasType.javajet
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/JCasTypeTemplate.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/JCasTypeTemplate.java?rev=1754802&r1=1754801&r2=1754802&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/JCasTypeTemplate.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/JCasTypeTemplate.java Mon Aug 1 21:59:59 2016
@@ -101,7 +101,13 @@ public class JCasTypeTemplate implements
stringBuilder.append(typeName);
stringBuilder.append("(TypeImpl type, CASImpl casImpl) {\n super(type, casImpl);\n readObject();\n }\n \n /** @generated\n * @param jcas JCas to which this Feature Structure belongs \n */\n public ");
stringBuilder.append(typeName);
- stringBuilder.append("(JCas jcas) {\n super(jcas);\n readObject(); \n } \n\n /** \n * <!-- begin-user-doc -->\n * Write your own initialization here\n * <!-- end-user-doc -->\n *\n * @generated modifiable \n */\n private void readObject() {/*default - does nothing empty block */}\n \n");
+ stringBuilder.append("(JCas jcas) {\n super(jcas);\n readObject(); \n } \n\n");
+ if (jg.isSubTypeOfAnnotation(td)) {
+ stringBuilder.append("\n /** @generated\n * @param jcas JCas to which this Feature Structure belongs\n * @param begin offset to the begin spot in the SofA\n * @param end offset to the end spot in the SofA \n */ \n public ");
+ stringBuilder.append(typeName);
+ stringBuilder.append("(JCas jcas, int begin, int end) {\n super(jcas);\n setBegin(begin);\n setEnd(end);\n readObject();\n } \n");
+ }
+ stringBuilder.append("\n /** \n * <!-- begin-user-doc -->\n * Write your own initialization here\n * <!-- end-user-doc -->\n *\n * @generated modifiable \n */\n private void readObject() {/*default - does nothing empty block */}\n \n");
for (FeatureDescription fd : td.getFeatures()) {
String featName = fd.getName();
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/javajet/jcasgen/templates/JCasType.javajet
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/javajet/jcasgen/templates/JCasType.javajet?rev=1754802&r1=1754801&r2=1754802&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/javajet/jcasgen/templates/JCasType.javajet (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/javajet/jcasgen/templates/JCasType.javajet Mon Aug 1 21:59:59 2016
@@ -123,6 +123,21 @@ public class <%=typeName%> extends <%=jg
readObject();
}
+<%if (jg.isSubTypeOfAnnotation(td)) { %>
+
+ /** @generated
+ * @param jcas JCas to which this Feature Structure belongs
+ * @param begin offset to the begin spot in the SofA
+ * @param end offset to the end spot in the SofA
+ */
+ public <%=typeName%>(JCas jcas, int begin, int end) {
+ super(jcas);
+ setBegin(begin);
+ setEnd(end);
+ readObject();
+ }
+<%} %>
+
/**
* <!-- begin-user-doc -->
* Write your own initialization here