Package org.apache.ivy.osgi.core

Examples of org.apache.ivy.osgi.core.BundleRequirement


        VersionRange range = getVersionRange();
        String resolution = optional ? "optional" : null;
        if (type == null) {
            throw new ParseException("No requirement actually specified", 0);
        }
        BundleRequirement requirement = new BundleRequirement(type, name, range, resolution);
        info.addRequirement(requirement);
        if (BundleInfo.EXECUTION_ENVIRONMENT_TYPE.equals(type)) {
            info.addExecutionEnvironment(name);
        }
    }
View Full Code Here


                            Message.debug("Unsupported required capability " + child.namespace
                                    + " " + name + " " + range);
                        }
                    } else {
                        String resolution = child.optional ? "optional" : null;
                        requirements.add(new BundleRequirement(type, name, range, resolution));
                    }
                }
            });
        }
View Full Code Here

        b.setDescription(feature.getDescription());
        b.setLicense(feature.getLicense());

        for (EclipsePlugin plugin : feature.getPlugins()) {
            BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, plugin.getId(),
                    new VersionRange(plugin.getVersion()), null);
            b.addRequirement(r);
        }

        for (Require require : feature.getRequires()) {
            String id;
            if (require.getPlugin() != null) {
                id = require.getPlugin();
            } else {
                id = require.getFeature();
            }
            VersionRange range;
            if (require.getMatch().equals("greaterOrEqual")) {
                range = new VersionRange(require.getVersion());
            } else {
                throw new IllegalStateException("unsupported match " + require.getMatch());
            }
            BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, id, range, null);
            b.addRequirement(r);
        }

        return b;
    }
View Full Code Here

            addChild(new RequiredHandler(), new ChildElementHandler() {
                public void childHanlded(DelegetingHandler child) {
                    String name = ((RequiredHandler) child).name;
                    VersionRange range = ((RequiredHandler) child).range;
                    String type = namespace2Type(((RequiredHandler) child).namespace);
                    requirements.add(new BundleRequirement(type, name, range, null));
                }
            });
        }
View Full Code Here

            BundleCapability capability = (BundleCapability) itCapabilities.next();
            saxCapability(capability, handler);
        }
        Iterator itRequirement = bundleInfo.getRequirements().iterator();
        while (itRequirement.hasNext()) {
            BundleRequirement requirement = (BundleRequirement) itRequirement.next();
            saxRequirement(requirement, handler);
        }
        handler.endElement("", ResourceHandler.RESOURCE, ResourceHandler.RESOURCE);
        handler.characters("\n".toCharArray(), 0, 1);
    }
View Full Code Here

        VersionRange range = getVersionRange();
        String resolution = optional ? "optional" : null;
        if (type == null) {
            throw new ParseException("No requirement actually specified", 0);
        }
        BundleRequirement requirement = new BundleRequirement(type, name, range, resolution);
        info.addRequirement(requirement);
    }
View Full Code Here

        b.setLicense(feature.getLicense());

        Iterator itPlugins = feature.getPlugins().iterator();
        while (itPlugins.hasNext()) {
            EclipsePlugin plugin = (EclipsePlugin) itPlugins.next();
            BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, plugin.getId(),
                    new VersionRange(plugin.getVersion()), null);
            b.addRequirement(r);
        }

        Iterator itRequires = feature.getRequires().iterator();
        while (itRequires.hasNext()) {
            Require require = (Require) itRequires.next();
            String id;
            if (require.getPlugin() != null) {
                id = require.getPlugin();
            } else {
                id = require.getFeature();
            }
            VersionRange range;
            if (require.getMatch().equals("greaterOrEqual")) {
                range = new VersionRange(require.getVersion());
            } else {
                throw new IllegalStateException("unsupported match " + require.getMatch());
            }
            BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, id, range, null);
            b.addRequirement(r);
        }

        return b;
    }
View Full Code Here

                    String type = namespace2Type(((RequiredHandler) child).namespace);
                    if (type == null) {
                        Message.debug("Unsupported required capability "
                                + ((RequiredHandler) child).namespace + " " + name + " " + range);
                    } else {
                        requirements.add(new BundleRequirement(type, name, range, null));
                    }
                }
            });
        }
View Full Code Here

TOP

Related Classes of org.apache.ivy.osgi.core.BundleRequirement

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.