Package org.apache.uima.cas.impl

Examples of org.apache.uima.cas.impl.TypeSystemImpl


      constructorArgsFor_Type[1] = casType;
      TOP_Type x_Type_instance = (TOP_Type) c_Type.newInstance(constructorArgsFor_Type);
      typeArray[typeIndex] = x_Type_instance;
      // install the standard generator
      if (! alreadyLoaded) {
        final TypeSystemImpl ts = casImpl.getTypeSystemImpl();
        fsGenerators[casType.getCode()] = new JCasFsGenerator(typeIndex, cType, jcasTypeInfo.isSubtypeOfAnnotationBase,
                ts.sofaNumFeatCode, ts.annotSofaFeatCode);
//        this.casImpl.getFSClassRegistry().loadJCasGeneratorForType(typeIndex, cType, casType, jcasTypeInfo.isSubtypeOfAnnotationBase);
      }
    } catch (SecurityException e) {
View Full Code Here


      typeArray[typeIndex] = x_Type_instance;
      // install the standard generator
      // this is sharable by all views, since the CAS is passed to the generator
      // Also sharable by all in a CasPool, except for "swapping" due to PEARs/Classloaders.
      if (!alreadyLoaded) {
        final TypeSystemImpl ts = casImpl.getTypeSystemImpl();
        fsGenerators[casType.getCode()] = new JCasFsGenerator(typeIndex, cType,
            jcasTypeInfo.isSubtypeOfAnnotationBase, ts.sofaNumFeatCode, ts.annotSofaFeatCode);
        // this.casImpl.getFSClassRegistry().loadJCasGeneratorForType(typeIndex, cType, casType,
        // jcasTypeInfo.isSubtypeOfAnnotationBase);
      }
View Full Code Here

    }
    RsLangs.addAll(rsLangs, languagesToAdd);
  }
 
  private Iterable<String> subtypeNames(final String typeName) {
    final TypeSystemImpl ts = (TypeSystemImpl) mTypeSystem;
    return new Iterable<String>() {

      public Iterator<String> iterator() {
        return new Iterator<String>() {
          Type t = (null == ts) ? null : ts.getType(typeName);        
          List<Type> subtypes = (null == ts) ? EMPTY_TYPE_LIST
                              : (null == t ) ? EMPTY_TYPE_LIST
                              : ts.getProperlySubsumedTypes(t);
          int  i = 0;

          public boolean hasNext() {
            return i < subtypes.size();
          }
View Full Code Here

      assertTrue(tcas2 == tcas3);
      assertNotNull(cas1.getTypeSystem().getType("Test.ArrayType"));
      assertNotNull(tcas3.getTypeSystem().getType("Test.ArrayType"));
     
      TypeSystemImpl ts = (TypeSystemImpl)cas2.getTypeSystem();
      Type arrayType = ts.getType("Test.ArrayType");
      Feature arrayFeat = arrayType.getFeatureByBaseName("arrayFeature");
      TypeImpl featRange = (TypeImpl)(arrayFeat.getRange());
    
      assertTrue(ts.ll_isArrayType(featRange.getCode()));
      assertFalse(arrayFeat.isMultipleReferencesAllowed());
     
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
View Full Code Here

      typeArray[typeIndex] = x_Type_instance;
      // install the standard generator
      // this is sharable by all views, since the CAS is passed to the generator
      // Also sharable by all in a CasPool, except for "swapping" due to PEARs/Classloaders.
      if (!alreadyLoaded) {
        final TypeSystemImpl ts = casImpl.getTypeSystemImpl();
        fsGenerators[casType.getCode()] = new JCasFsGenerator(typeIndex, cType,
            jcasTypeInfo.isSubtypeOfAnnotationBase, ts.sofaNumFeatCode, ts.annotSofaFeatCode);
        // this.casImpl.getFSClassRegistry().loadJCasGeneratorForType(typeIndex, cType, casType,
        // jcasTypeInfo.isSubtypeOfAnnotationBase);
      }
View Full Code Here

      typeArray[typeIndex] = x_Type_instance;
      // install the standard generator
      // this is sharable by all views, since the CAS is passed to the generator
      // Also sharable by all in a CasPool, except for "swapping" due to PEARs/Classloaders.
      if (!alreadyLoaded) {
        final TypeSystemImpl ts = casImpl.getTypeSystemImpl();
        fsGenerators[casType.getCode()] = new JCasFsGenerator(typeIndex, cType,
            jcasTypeInfo.isSubtypeOfAnnotationBase, ts.sofaNumFeatCode, ts.annotSofaFeatCode);
        // this.casImpl.getFSClassRegistry().loadJCasGeneratorForType(typeIndex, cType, casType,
        // jcasTypeInfo.isSubtypeOfAnnotationBase);
      }
View Full Code Here

  }

  private static void serializeResultSpecification(ResultSpecification rs, CASImpl cas,
          IntVector resultSpecTypes, IntVector resultSpecFeatures) {
    TypeOrFeature[] tofs = rs.getResultTypesAndFeatures();
    TypeSystemImpl tsImpl = cas.getTypeSystemImpl();
    for (int i = 0; i < tofs.length; ++i) {
      if (tofs[i].isType()) {
        TypeImpl t = (TypeImpl) tsImpl.getType(tofs[i].getName());
        resultSpecTypes.add(t.getCode());
      } else {
        FeatureImpl f = (FeatureImpl) tsImpl.getFeatureByFullName(tofs[i].getName());
        resultSpecFeatures.add(f.getCode());
      }
    }
  }
View Full Code Here

    }
    RsLangs.addAll(rsLangs, languagesToAdd);
  }
 
  private Iterable<String> subtypeNames(final String typeName) {
    final TypeSystemImpl ts = (TypeSystemImpl) mTypeSystem;
    return new Iterable<String>() {

      public Iterator<String> iterator() {
        return new Iterator<String>() {
          Type t = (null == ts) ? null : ts.getType(typeName);        
          List<Type> subtypes = (null == ts) ? EMPTY_TYPE_LIST
                              : (null == t ) ? EMPTY_TYPE_LIST
                              : ts.getProperlySubsumedTypes(t);
          int  i = 0;

          public boolean hasNext() {
            return i < subtypes.size();
          }
View Full Code Here

   * Create a new type system that is populated with the built-in CAS types.
   *
   * @return A type system manager object that can be used to add more types.
   */
  public static TypeSystemMgr createTypeSystem() {
    TypeSystemImpl ts = new TypeSystemImpl();
    return ts;
  }
View Full Code Here

  }

  private static void serializeResultSpecification(ResultSpecification rs, CASImpl cas,
          IntVector resultSpecTypes, IntVector resultSpecFeatures) {
    TypeOrFeature[] tofs = rs.getResultTypesAndFeatures();
    TypeSystemImpl tsImpl = cas.getTypeSystemImpl();
    for (int i = 0; i < tofs.length; ++i) {
      if (tofs[i].isType()) {
        TypeImpl t = (TypeImpl) tsImpl.getType(tofs[i].getName());
        resultSpecTypes.add(t.getCode());
      } else {
        FeatureImpl f = (FeatureImpl) tsImpl.getFeatureByFullName(tofs[i].getName());
        resultSpecFeatures.add(f.getCode());
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.cas.impl.TypeSystemImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.