/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */

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;

/**
 * The JCas class definition for the CAS <code>DocumentAnnotation</code> type. When text CASs are
 * created, one instance of this type is created and made accessible via a call to the
 * {@link JCas#getDocumentAnnotationFs()} method. It is also a subtype of {@link Annotation} and
 * therefore would appear as one of the annotations that an iterator over all the annotations would
 * return.
 */
public class DocumentAnnotation extends Annotation {

  public final static int typeIndexID = JCasRegistry.register(DocumentAnnotation.class);

  public final static int type = typeIndexID;

  public int getTypeIndexID() {
    return typeIndexID;
  }

  // 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);
  }

  // *------------------*
  // * 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);
  }

  /**
   * 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);
  }
}

@@ -840,16 +840,179 @@
 .tcas;%0A%0A
+import org.apache.uima.cas.CAS;%0Aimport org.apache.uima.cas.impl.CASImpl;%0Aimport org.apache.uima.cas.impl.TypeImpl;%0Aimport org.apache.uima.cas.impl.TypeSystemImpl;%0A
 import o
@@ -1082,50 +1082,8 @@
 try;
-%0Aimport org.apache.uima.jcas.cas.TOP_Type;
 %0A%0A/*
@@ -1739,222 +1739,397 @@
 %0A%0A  
-// Never called. Disable default constructor%0A  protected DocumentAnnotation() %7B%0A  %7D%0A%0A /* Internal - Constructor used by generator */%0A  public DocumentAnnotation(int addr, TOP_Type type) %7B%0A    super(addr, type);%0A  %7D
+public final static int _FI_language = JCasRegistry.registerFeature(typeIndexID); %0A        %0A  /* local data */%0A  private String _F_language;%0A%0A  // Never called. Disable default constructor%0A  protected DocumentAnnotation() %7B%0A  %7D%0A%0A  public DocumentAnnotation(JCas jcas) %7B%0A    super(jcas);%0A  %7D%0A%0A  /**%0A   * used by generator%0A   * Make a new AnnotationBase%0A   * @param c -%0A   * @param t -%0A   */
 %0A%0A  
@@ -2150,33 +2150,45 @@
 tAnnotation(
-JCas jcas
+TypeImpl t, CASImpl c
 ) %7B%0A    supe
@@ -2181,36 +2181,36 @@
  c) %7B%0A    super(
-jcas
+t, c
 );%0A  %7D%0A%0A  // *--
@@ -2350,327 +2350,18 @@
 () %7B
-%0A    if (DocumentAnnotation_Type.featOkTst%0A            && ((DocumentAnnotation_Type) jcasType).casFeat_language == null)%0A      this.jcasType.jcas.throwFeatMissing(%22language%22, %22uima.tcas.DocumentAnnotation%22);%0A    return jcasType.ll_cas.ll_getStringValue(addr,%0A            ((DocumentAnnotation_Type) jcasType).casFeatCode
+ return _F
 _lan
@@ -2365,20 +2365,17 @@
 language
-);%0A 
+;
  %7D%0A%0A  /*
@@ -2480,175 +2480,62 @@
     
-if (DocumentAnnotation_Type.featOkTst%0A            && ((DocumentAnnotation_Type) jcasType).casFeat_language == null)%0A      this.jcasType.jcas.throwFeatMissing(%22
+_casView.setWithCheckAndJournalJFRI(this, _FI_
 language
 %22, %22
@@ -2534,148 +2534,18 @@
 uage
-%22
 , 
-%22uima.tcas.DocumentAnnotation%22);%0A    jcasType.ll_cas.ll_setStringValue(addr,%0A            ((DocumentAnnotation_Type) jcasType).casFeatCode
+ () -%3E_F
 _lan
@@ -2549,17 +2549,18 @@
 language
-,
+ =
  v);%0A  %7D

update DocumentAnnotation JCas to current design for V3