Package org.apache.uima.resource

Examples of org.apache.uima.resource.FileLanguageResourceSpecifier


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

      FileLanguageResourceSpecifier spec = new FileLanguageResourceSpecifier_impl();
      File baseDir = JUnitExtension.getFile("ResourceTest");    
      spec.setFileUrlPrefix(new File(baseDir, "FileLanguageResource_implTest_data_").toURL().toString());
      spec.setFileUrlSuffix(".dat");
      mResource = new FileLanguageResource_impl();
      mResource.initialize(spec, Collections.EMPTY_MAP);
    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
View Full Code Here


      desc2.setName("myCustomObject");
      desc2.setResourceSpecifier(spec);
      desc2.setImplementationName(TestResourceInterface_impl.class.getName());

      // parameterized (language-based) resource
      FileLanguageResourceSpecifier langSpec = new FileLanguageResourceSpecifier_impl();

      File baseDir = JUnitExtension.getFile("ResourceTest");
      langSpec.setFileUrlPrefix(new File(baseDir, "FileLanguageResource_implTest_data_").toURL()
              .toString());
      langSpec.setFileUrlSuffix(".dat");
      ExternalResourceDescription desc3 = new ExternalResourceDescription_impl();
      desc3.setName("myLanguageResource");
      desc3.setResourceSpecifier(langSpec);

      // parameterized resource with custom impl class
View Full Code Here

  private void fillXrdItem(TreeItem item, ExternalResourceDescription xrd) {
    StringBuffer text = new StringBuffer();
    text.append(xrd.getName());
    ResourceSpecifier rs = xrd.getResourceSpecifier();
    if (rs instanceof FileLanguageResourceSpecifier) {
      FileLanguageResourceSpecifier flrs = (FileLanguageResourceSpecifier) rs;
      text.append("  URL_Prefix: ").append(flrs.getFileUrlPrefix()).append("  URL_Suffix: ")
              .append(flrs.getFileUrlSuffix());
    } else if (rs instanceof FileResourceSpecifier) {
      FileResourceSpecifier frs = (FileResourceSpecifier) rs;
      text.append("  URL: ").append(frs.getFileUrl());
    } else {
      text.append("  Custom Resource Specifier");
View Full Code Here

        frs = new FileResourceSpecifier_impl();
      }
      frs.setFileUrl(setValueChanged(dialog.xrUrl, frs.getFileUrl()));
      xrd.setResourceSpecifier(frs);
    } else {
      FileLanguageResourceSpecifier flrs;
      if (null != rs && rs instanceof FileLanguageResourceSpecifier) {
        flrs = (FileLanguageResourceSpecifier) rs;
      } else {
        flrs = new FileLanguageResourceSpecifier_impl();
      }
      flrs.setFileUrlPrefix(setValueChanged(dialog.xrUrl, flrs.getFileUrlPrefix()));
      flrs.setFileUrlSuffix(setValueChanged(dialog.xrUrlSuffix, flrs.getFileUrlSuffix()));
      xrd.setResourceSpecifier(flrs);
    }
    fillXrdItem(item, xrd);
    if (valueChanged)
      setFileDirty();
View Full Code Here

    // aSpecifier must be a FileLanguageResourceSpecifier
    if (!(aSpecifier instanceof FileLanguageResourceSpecifier))
      return false;

    // If we get here, aSpecifier is supported by this implementation.
    FileLanguageResourceSpecifier spec = (FileLanguageResourceSpecifier) aSpecifier;

    // Store the attributes for later use.
    mFileUrlPrefix = spec.getFileUrlPrefix();
    mFileUrlSuffix = spec.getFileUrlSuffix();

    // store initialization parameters to be passed on to DataReources
    mResourceInitParams = (aAdditionalParams == null) ? new HashMap<String, Object>() : new HashMap<String, Object>(
            aAdditionalParams);
View Full Code Here

    // aSpecifier must be a FileLanguageResourceSpecifier
    if (!(aSpecifier instanceof FileLanguageResourceSpecifier))
      return false;

    // If we get here, aSpecifier is supported by this implementation.
    FileLanguageResourceSpecifier spec = (FileLanguageResourceSpecifier) aSpecifier;

    // Store the attributes for later use.
    mFileUrlPrefix = spec.getFileUrlPrefix();
    mFileUrlSuffix = spec.getFileUrlSuffix();

    // store initialization parameters to be passed on to DataReources
    mResourceInitParams = (aAdditionalParams == null) ? new HashMap() : new HashMap(
            aAdditionalParams);
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.FileLanguageResourceSpecifier

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.