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/02/22 20:00:49 UTC

svn commit: r1731713 - /uima/uimaj/branches/experiment-v3-jcas/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java

Author: schor
Date: Mon Feb 22 19:00:49 2016
New Revision: 1731713

URL: http://svn.apache.org/viewvc?rev=1731713&view=rev
Log:
[UIMA-4666] update DocumentAnnotation JCas to current design for V3

Modified:
    uima/uimaj/branches/experiment-v3-jcas/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java?rev=1731713&r1=1731712&r2=1731713&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java Mon Feb 22 19:00:49 2016
@@ -19,9 +19,12 @@
 
 package org.apache.uima.jcas.tcas;
 
+import org.apache.uima.cas.CAS;
+import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.TypeImpl;
+import org.apache.uima.cas.impl.TypeSystemImpl;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.JCasRegistry;
-import org.apache.uima.jcas.cas.TOP_Type;
 
 /**
  * The JCas class definition for the CAS <code>DocumentAnnotation</code> type. When text CASs are
@@ -40,42 +43,43 @@ public class DocumentAnnotation extends
     return typeIndexID;
   }
 
+  public final static int _FI_language = JCasRegistry.registerFeature(typeIndexID); 
+        
+  /* local data */
+  private String _F_language;
+
   // Never called. Disable default constructor
   protected DocumentAnnotation() {
   }
 
- /* Internal - Constructor used by generator */
-  public DocumentAnnotation(int addr, TOP_Type type) {
-    super(addr, type);
-  }
-
   public DocumentAnnotation(JCas jcas) {
     super(jcas);
   }
 
+  /**
+   * used by generator
+   * Make a new AnnotationBase
+   * @param c -
+   * @param t -
+   */
+
+  public DocumentAnnotation(TypeImpl t, CASImpl c) {
+    super(t, c);
+  }
+
   // *------------------*
   // * Feature: language
   /**
    * getter for language
    * @return the language
    */
-  public String getLanguage() {
-    if (DocumentAnnotation_Type.featOkTst
-            && ((DocumentAnnotation_Type) jcasType).casFeat_language == null)
-      this.jcasType.jcas.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
-    return jcasType.ll_cas.ll_getStringValue(addr,
-            ((DocumentAnnotation_Type) jcasType).casFeatCode_language);
-  }
+  public String getLanguage() { return _F_language; }
 
   /**
    * setter for language
    * @param v the language
    */
   public void setLanguage(String v) {
-    if (DocumentAnnotation_Type.featOkTst
-            && ((DocumentAnnotation_Type) jcasType).casFeat_language == null)
-      this.jcasType.jcas.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
-    jcasType.ll_cas.ll_setStringValue(addr,
-            ((DocumentAnnotation_Type) jcasType).casFeatCode_language, v);
+    _casView.setWithCheckAndJournalJFRI(this, _FI_language,  () ->_F_language = v);
   }
 }