Examples of resolveImports()


Examples of org.apache.uima.resource.metadata.ResourceMetaData.resolveImports()

    if (aSpecifier instanceof ResourceCreationSpecifier) {
      // resolve imports in the metadata
      ResourceMetaData metadata = ((ResourceCreationSpecifier) aSpecifier).getMetaData();
      name = metadata.getName();
      try {
        metadata.resolveImports(getResourceManager());
      } catch (InvalidXMLException e) {
        throw new ResourceInitializationException(e);
      }
      // store Resource metadata so it can be retrieved via getMetaData() method
      setMetaData(metadata);
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypePriorities.resolveImports()

            .createTypePriorities();
    Iterator it = aTypePriorities.iterator();
    while (it.hasNext()) {
      TypePriorities tp = (TypePriorities) it.next();
      try {
        tp.resolveImports(aResourceManager);
      } catch (InvalidXMLException e) {
        throw new ResourceInitializationException(e);
      }
      TypePriorityList[] pls = tp.getPriorityLists();
      if (pls != null) {
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypePriorities.resolveImports()

        .createTypePriorities();
    Iterator<? extends TypePriorities> it = aTypePriorities.iterator();
    while (it.hasNext()) {
      TypePriorities tp = it.next();
      try {
        tp.resolveImports(aResourceManager);
      } catch (InvalidXMLException e) {
        throw new ResourceInitializationException(e);
      }
      TypePriorityList[] pls = tp.getPriorityLists();
      if (pls != null) {
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

    Iterator it = aTypeSystems.iterator();
    while (it.hasNext()) {
      TypeSystemDescription ts = (TypeSystemDescription) it.next();
      if (ts != null) {
        try {
          ts.resolveImports(aResourceManager);
        } catch (InvalidXMLException e) {
          throw new ResourceInitializationException(e);
        }
        TypeDescription[] types = ts.getTypes();
        if (types != null) {
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

    TypeSystemDescription typeSystemDesciptor;

    try {
      typeSystemDesciptor = (TypeSystemDescription) xmlParser.parse(xmlTypeSystemSource);

      typeSystemDesciptor.resolveImports();
    } catch (InvalidXMLException e) {

      String message = (e.getMessage() != null ? e.getMessage() : "");

      IStatus s = new Status(IStatus.ERROR, CasEditorPlugin.ID, IStatus.OK, message, e);
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

        {
            typeSystemDescriptor = UIMAFramework.getXMLParser()
            .parseTypeSystemDescription(
                    new XMLInputSource(inTypeSystemDescription, new File("")));
           
            typeSystemDescriptor.resolveImports();
        }
        catch (InvalidXMLException e)
        {
            throw new InvocationTargetException(e);
        }
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

   * @throws InvalidXMLException When import cannot be resolved.
   */
  private void importDeclaredTypesystems(TypeSystem casTS) throws InvalidXMLException {
    String[] descriptors = typesystems.toArray(new String[typesystems.size()]);
    TypeSystemDescription ts = TypeSystemDescriptionFactory.createTypeSystemDescription(descriptors);
    ts.resolveImports();
    for (TypeDescription td : ts.getTypes()) {
      Type type = casTS.getType(td.getName());
      if (type != null) {
        addType(type);
      } else {
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

   * @param packageName Package to load or null to load all packages.
   */
  public void importPackageFromTypeSystem(String typesystem, String packageName, String alias) {
    TypeSystemDescription tsd = TypeSystemDescriptionFactory.createTypeSystemDescription(typesystem);
    try {
      tsd.resolveImports();
    } catch (InvalidXMLException e) {
      throw new RuntimeException("Cannot resolve imports in " + typesystem, e);
    }

    for (TypeDescription td : tsd.getTypes()) {
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

    List<CheckDocument> docs = new ArrayList<CheckDocument>(oldDocs);
    TypeSystemDescription tsd = null;
    try {
      tsd = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              new XMLInputSource(typeSystem.getText()));
      tsd.resolveImports();
    } catch (InvalidXMLException e) {
      RutaAddonsPlugin.error(e);
    } catch (IOException e) {
      RutaAddonsPlugin.error(e);
    }
View Full Code Here

Examples of org.apache.uima.resource.metadata.TypeSystemDescription.resolveImports()

              .getActiveWorkbenchWindow().getActivePage().showView(AnnotationCheckView.ID);
      AnnotationCheckComposite composite = (AnnotationCheckComposite) acView.getComposite();
      List<String> types = new ArrayList<String>();
      TypeSystemDescription tsd = UIMAFramework.getXMLParser().parseTypeSystemDescription(
              new XMLInputSource(new File(composite.getTypeSystem())));
      tsd.resolveImports();
      TypeDescription[] systemTypes = tsd.getTypes();
      for (TypeDescription typeDescription : systemTypes) {
        types.add(typeDescription.getName());
      }
      Collections.sort(types);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.