Package org.apache.uima.resource.metadata.impl

Examples of org.apache.uima.resource.metadata.impl.Capability_impl


      AnalysisEngineDescription primitiveDesc = new AnalysisEngineDescription_impl();
      primitiveDesc.setPrimitive(true);
      primitiveDesc
              .setAnnotatorImplementationName("org.apache.uima.analysis_engine.impl.TestAnnotator");
      primitiveDesc.getMetaData().setName("Test Primitive TAE");
      Capability cap = new Capability_impl();
      cap.addOutputType("NamedEntity", true);
      cap.addOutputType("DocumentStructure", true);
      Capability[] caps = new Capability[] {cap};
      primitiveDesc.getAnalysisEngineMetaData().setCapabilities(caps);
      _testProcess(primitiveDesc);

      // test simple aggregate TextAnalysisEngine (again using TestAnnotator class)
View Full Code Here


    if (!ReflectionUtil.isAnnotationPresent(componentClass, SofaCapability.class)
            && !ReflectionUtil.isAnnotationPresent(componentClass, TypeCapability.class)) {
      return null;
    }

    Capability capability = new Capability_impl();

    if (ReflectionUtil.isAnnotationPresent(componentClass, SofaCapability.class)) {
      SofaCapability annotation = ReflectionUtil.getAnnotation(componentClass, SofaCapability.class);
      String[] inputSofas = annotation.inputSofas();
      if (inputSofas.length == 1 && inputSofas[0].equals(SofaCapability.NO_DEFAULT_VALUE)) {
        inputSofas = new String[0];
      }
      capability.setInputSofas(inputSofas);

      String[] outputSofas = annotation.outputSofas();
      if (outputSofas.length == 1 && outputSofas[0].equals(SofaCapability.NO_DEFAULT_VALUE)) {
        outputSofas = new String[0];
      }
      capability.setOutputSofas(outputSofas);
    }

    if (ReflectionUtil.isAnnotationPresent(componentClass, TypeCapability.class)) {
      TypeCapability annotation = ReflectionUtil.getAnnotation(componentClass, TypeCapability.class);
      String[] inputTypesOrFeatureNames = annotation.inputs();
      capability.setInputs(createTypesOrFeatures(inputTypesOrFeatureNames));
      String[] outputTypesOrFeatureNames = annotation.outputs();
      capability.setOutputs(createTypesOrFeatures(outputTypesOrFeatureNames));
    }

    return capability;
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.metadata.impl.Capability_impl

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.