예제 #1
0
 public static String getResolutionFailureMessage(VersionConstraint unsatisfied) {
   if (unsatisfied.isResolved()) throw new IllegalArgumentException();
   if (unsatisfied instanceof ImportPackageSpecification) {
     if (ImportPackageSpecification.RESOLUTION_OPTIONAL.equals(
         ((ImportPackageSpecification) unsatisfied).getDirective(Constants.RESOLUTION_DIRECTIVE)))
       return NLS.bind(
           EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_IMPORTED_PACKAGE, toString(unsatisfied));
     if (ImportPackageSpecification.RESOLUTION_DYNAMIC.equals(
         ((ImportPackageSpecification) unsatisfied).getDirective(Constants.RESOLUTION_DIRECTIVE)))
       return NLS.bind(
           EclipseAdaptorMsg.ECLIPSE_MISSING_DYNAMIC_IMPORTED_PACKAGE, toString(unsatisfied));
     return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_IMPORTED_PACKAGE, toString(unsatisfied));
   } else if (unsatisfied instanceof BundleSpecification) {
     if (((BundleSpecification) unsatisfied).isOptional())
       return NLS.bind(
           EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_REQUIRED_BUNDLE, toString(unsatisfied));
     return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIRED_BUNDLE, toString(unsatisfied));
   } else if (unsatisfied instanceof HostSpecification) {
     return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_HOST, toString(unsatisfied));
   } else if (unsatisfied instanceof NativeCodeSpecification) {
     return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_NATIVECODE, unsatisfied.toString());
   } else if (unsatisfied instanceof GenericSpecification) {
     return NLS.bind(
         EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIRED_CAPABILITY, unsatisfied.toString());
   }
   return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIREMENT, unsatisfied.toString());
 }
예제 #2
0
 private void addDynamicImportPackage(ImportPackageSpecification[] packages) {
   if (packages == null) return;
   ArrayList dynamicImports = new ArrayList(packages.length);
   for (int i = 0; i < packages.length; i++)
     if (ImportPackageSpecification.RESOLUTION_DYNAMIC.equals(
         packages[i].getDirective(Constants.RESOLUTION_DIRECTIVE)))
       dynamicImports.add(packages[i].getName());
   if (dynamicImports.size() > 0)
     addDynamicImportPackage((String[]) dynamicImports.toArray(new String[dynamicImports.size()]));
 }