Package org.apache.uima.resource.metadata

Examples of org.apache.uima.resource.metadata.TypeDescription


      return null;
    return getFeatureFromTypeDescription(featureName, localTd);
  }

  protected AllowedValue getLocalAllowedValue(TypeDescription td, AllowedValue unchangedAv) {
    TypeDescription localTd = getLocalTypeDefinition(td);
    if (null == localTd)
      return null;
    return getAllowedValue(unchangedAv.getString(), localTd);
  }
View Full Code Here


  protected boolean isLocalFeature(String featureName, TypeDescription td) {
    return (null != getLocalFeatureDefinition(td, featureName));
  }

  protected boolean isLocalAllowedValue(String avString, TypeDescription td) {
    TypeDescription localTd = getLocalTypeDefinition(td);
    if (null == localTd)
      return false;
    return Utility.arrayContains(localTd.getAllowedValues(), avString);
  }
View Full Code Here

  protected boolean isImportedType(TypeDescription td) {
    return null != editor.getImportedTypeSystemDesription().getType(td.getName());
  }

  protected boolean isImportedFeature(String name, TypeDescription td) {
    TypeDescription importedTd = editor.getImportedTypeSystemDesription().getType(td.getName());
    if (null == importedTd)
      return false;
    return null != getFeatureFromTypeDescription(name, importedTd);
  }
View Full Code Here

      return false;
    return null != getFeatureFromTypeDescription(name, importedTd);
  }

  protected boolean isImportedAllowedValue(TypeDescription td, AllowedValue av) {
    TypeDescription importedTd = editor.getImportedTypeSystemDesription().getType(td.getName());
    if (null == importedTd)
      return false;
    return null != getAllowedValue(av.getString(), importedTd);
  }
View Full Code Here

  protected boolean isBuiltInType(String typeName) {
    return null != BuiltInTypes.typeDescriptions.get(typeName);
  }

  protected boolean isBuiltInFeature(String name, TypeDescription td) {
    TypeDescription builtInTd = (TypeDescription) BuiltInTypes.typeDescriptions.get(td.getName());
    if (null == builtInTd)
      return false;
    return null != getFeatureFromTypeDescription(name, builtInTd);
  }
View Full Code Here

  protected void setUp() throws Exception {
    try {
      super.setUp();

      TypeSystemDescription typeSystem = new TypeSystemDescription_impl();
      TypeDescription type1 = typeSystem.addType("Fake", "<b>Fake</b> Type", "Annotation");
      type1.addFeature("TestFeature", "For Testing Only", CAS.TYPE_NAME_STRING);
      TypeDescription enumType = typeSystem.addType("EnumType", "Test Enumerated Type",
              "uima.cas.String");
      enumType.setAllowedValues(new AllowedValue[] { new AllowedValue_impl("One", "First Value"),
          new AllowedValue_impl("Two", "Second Value") });

      TypePriorities typePriorities = new TypePriorities_impl();
      TypePriorityList priorityList = typePriorities.addPriorityList();
      priorityList.addType("Fake");
View Full Code Here

  protected void setUp() throws Exception {
    try {
      super.setUp();

      TypeSystemDescription typeSystem = new TypeSystemDescription_impl();
      TypeDescription type1 = typeSystem.addType("Fake", "<b>Fake</b> Type", "Annotation");
      type1.addFeature("TestFeature", "For Testing Only", CAS.TYPE_NAME_STRING);
      TypeDescription enumType = typeSystem.addType("EnumType", "Test Enumerated Type",
              "uima.cas.String");
      enumType.setAllowedValues(new AllowedValue[] { new AllowedValue_impl("One", "First Value"),
          new AllowedValue_impl("Two", "Second Value") });

      TypePriorities typePriorities = new TypePriorities_impl();
      TypePriorityList priorityList = typePriorities.addPriorityList();
      priorityList.addType("Fake");
View Full Code Here

  /**
   * @see org.apache.uima.cas.TypeSystemDescription#addType(String, String, String)
   */
  public TypeDescription addType(String aTypeName, String aDescription, String aSupertypeName) {
    // create new type description
    TypeDescription newType = new TypeDescription_impl(aTypeName, aDescription, aSupertypeName);

    // add to array
    TypeDescription[] types = getTypes();
    if (types == null) {
      setTypes(new TypeDescription[] { newType });
View Full Code Here

    // verify copy
    CasComparer.assertEquals(srcCas, destCas);

    // try with type systems are not identical (dest. a superset of src.)
    TypeSystemDescription additionalTypes = new TypeSystemDescription_impl();
    TypeDescription fooType = additionalTypes.addType("test.Foo", "Test Type",
            "uima.tcas.Annotation");
    fooType.addFeature("bar", "Test Feature", "uima.cas.String");
    ArrayList<TypeSystemDescription> destTypeSystems = new ArrayList<TypeSystemDescription>();
    destTypeSystems.add(additionalTypes);
    destTypeSystems.add(typeSystem);
    CAS destCas2 = CasCreationUtils.createCas(destTypeSystems);
    CasCopier.copyCas(srcCas, destCas2, true);
View Full Code Here

    // verify copy
    CasComparer.assertEquals(srcCas, destCas);

    // try with type systems are not identical (dest. a superset of src.)
    TypeSystemDescription additionalTypes = new TypeSystemDescription_impl();
    TypeDescription fooType = additionalTypes.addType("test.Foo", "Test Type",
            "uima.tcas.Annotation");
    fooType.addFeature("bar", "Test Feature", "uima.cas.String");
    ArrayList<TypeSystemDescription> destTypeSystems = new ArrayList<TypeSystemDescription>();
    destTypeSystems.add(additionalTypes);
    destTypeSystems.add(typeSystem);
    CAS destCas2 = CasCreationUtils.createCas(destTypeSystems);
    CasCopier.copyCas(srcCas, destCas2, true);
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.metadata.TypeDescription

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.