You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by al...@apache.org on 2007/01/17 16:47:58 UTC

svn commit: r497050 - in /incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas: DocumentAnnotation.java DocumentAnnotation_Type.java

Author: alally
Date: Wed Jan 17 07:47:58 2007
New Revision: 497050

URL: http://svn.apache.org/viewvc?view=rev&rev=497050
Log:
Created JCasRegistry class containing static methods moved from
JCasImpl, which are called from JCas cover classes.  Updated
JCasGen and migration utility.
UIMA-10: https://issues.apache.org/jira/browse/UIMA-10

Modified:
    incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java
    incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation_Type.java

Modified: incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java?view=diff&rev=497050&r1=497049&r2=497050
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation.java Wed Jan 17 07:47:58 2007
@@ -20,6 +20,7 @@
 package org.apache.uima.jcas.tcas;
 
 import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
 import org.apache.uima.jcas.cas.TOP_Type;
 import org.apache.uima.jcas.impl.JCasImpl;
 
@@ -32,7 +33,7 @@
  */
 public class DocumentAnnotation extends Annotation {
 
-  public final static int typeIndexID = JCasImpl.getNextIndex();
+  public final static int typeIndexID = JCasRegistry.register(DocumentAnnotation.class);
 
   public final static int type = typeIndexID;
 
@@ -61,7 +62,7 @@
   public String getLanguage() {
     if (DocumentAnnotation_Type.featOkTst
             && ((DocumentAnnotation_Type) jcasType).casFeat_language == null)
-      JCasImpl.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
+      this.jcasType.jcas.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
     return jcasType.ll_cas.ll_getStringValue(addr,
             ((DocumentAnnotation_Type) jcasType).casFeatCode_language);
   }
@@ -72,7 +73,7 @@
   public void setLanguage(String v) {
     if (DocumentAnnotation_Type.featOkTst
             && ((DocumentAnnotation_Type) jcasType).casFeat_language == null)
-      JCasImpl.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
+      this.jcasType.jcas.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
     jcasType.ll_cas.ll_setStringValue(addr,
             ((DocumentAnnotation_Type) jcasType).casFeatCode_language, v);
   }

Modified: incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation_Type.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation_Type.java?view=diff&rev=497050&r1=497049&r2=497050
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation_Type.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-document-annotation/src/main/java/org/apache/uima/jcas/tcas/DocumentAnnotation_Type.java Wed Jan 17 07:47:58 2007
@@ -27,6 +27,7 @@
 import org.apache.uima.cas.impl.FeatureImpl;
 import org.apache.uima.cas.impl.TypeImpl;
 import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
 import org.apache.uima.jcas.impl.JCasImpl;
 
 public class DocumentAnnotation_Type extends Annotation_Type {
@@ -52,7 +53,7 @@
 
   public final static int typeIndexID = DocumentAnnotation.typeIndexID;
 
-  public final static boolean featOkTst = JCasImpl.getFeatOkTst("uima.tcas.DocumentAnnotation");
+  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("uima.tcas.DocumentAnnotation");
 
   final Feature casFeat_language;
 
@@ -60,13 +61,13 @@
 
   public String getLanguage(int addr) {
     if (featOkTst && casFeat_language == null)
-      JCasImpl.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
+      this.jcas.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
     return ll_cas.ll_getStringValue(addr, casFeatCode_language);
   }
 
   public void setLanguage(int addr, String v) {
     if (featOkTst && casFeat_language == null)
-      JCasImpl.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
+      this.jcas.throwFeatMissing("language", "uima.tcas.DocumentAnnotation");
     ll_cas.ll_setStringValue(addr, casFeatCode_language, v);
   }