Package org.apache.ivy.osgi.util

Examples of org.apache.ivy.osgi.util.Version


        public int compare(Object o1, Object o2) {
            return compare((ModuleRevisionId) o1, (ModuleRevisionId) o2);
        }

        public int compare(ModuleRevisionId o1, ModuleRevisionId o2) {
            Version v1;
            Version v2;
            try {
                v1 = new Version(o1.getRevision());
                v2 = new Version(o2.getRevision());
            } catch (ParseException e) {
                throw new RuntimeException("Uncomparable versions:" + o1.getRevision() + " and "
                        + o2.getRevision() + " (" + e.getMessage() + ")");
            }
            return v1.compareTo(v2);
View Full Code Here


            }
            String version = (String) tokenValues.get(IvyPatternHelper.REVISION_KEY);
            if (version == null) {
                return Collections.EMPTY_LIST;
            }
            Version v;
            try {
                v = new Version(version);
            } catch (ParseException e) {
                return Collections.EMPTY_LIST;
            }
            BundleCapabilityAndLocation found = null;
            Iterator itBundle = bundleCapabilities.iterator();
View Full Code Here

            Set/* <BundleCapabilityAndLocation> */bundleCapabilities = getRepoDescriptor()
                    .findModule(osgiType, module);
            if (bundleCapabilities == null) {
                return Collections.EMPTY_SET;
            }
            Version v;
            try {
                v = new Version(rev);
            } catch (ParseException e) {
                return Collections.EMPTY_SET;
            }
            BundleCapabilityAndLocation found = null;
            Iterator itBundle = bundleCapabilities.iterator();
View Full Code Here

        protected void handleAttributes(Attributes atts) throws SAXException {
            String id = atts.getValue(ID);
            String version = atts.getValue(VERSION);
            // Boolean singleton = Boolean.valueOf(atts.getValue(SINGLETON));
            try {
                bundleInfo = new BundleInfo(id, new Version(version));
            } catch (ParseException e) {
                throw new SAXException("Incorrect version on bundle '" + id + "': " + version
                        + " (" + e.getMessage() + ")");
            }
        }
View Full Code Here

        public ProvidesHandler() {
            super(PROVIDES);
            addChild(new ProvidedHandler(), new ChildElementHandler() {
                public void childHanlded(DelegetingHandler child) {
                    String name = ((ProvidedHandler) child).name;
                    Version version = ((ProvidedHandler) child).version;
                    String type = namespace2Type(((ProvidedHandler) child).namespace);
                    if (type == null) {
                        return;
                    }
                    BundleCapability capability;
View Full Code Here

        protected void handleAttributes(Attributes atts) throws SAXException {
            namespace = atts.getValue(NAMESPACE);
            name = atts.getValue(NAME);
            try {
                version = new Version(atts.getValue(VERSION));
            } catch (ParseException e) {
                throw new SAXException("Incorrect version on provided capability: " + version
                        + " (" + e.getMessage() + ")");
            }
        }
View Full Code Here

        protected void handleAttributes(Attributes atts) throws SAXException {
            String id = atts.getValue(ID);
            String version = atts.getValue(VERSION);
            String classifier = atts.getValue(CLASSIFIER);
            try {
                artifact = new P2Artifact(id, new Version(version), classifier);
            } catch (ParseException e) {
                throw new SAXException("Incorrect version on artifact '" + id + "': " + version
                        + " (" + e.getMessage() + ")");
            }
        }
View Full Code Here

            });
        }

        protected void handleAttributes(Attributes atts) throws SAXException {
            String id = atts.getValue(ID);
            Version version;
            try {
                version = new Version(atts.getValue(VERSION));
            } catch (ParseException e) {
                throw new SAXException("Incorrect version attribute on artifact '" + id + "': "
                        + atts.getValue(VERSION) + " (" + e.getMessage() + ")");
            }
            String classifier = atts.getValue(CLASSIFIER);
View Full Code Here

        protected void handleAttributes(Attributes atts) throws SAXException {
            String id = atts.getValue(ID);
            String version = atts.getValue(VERSION);
            try {
                feature = new EclipseFeature(id, new Version(version));
            } catch (ParseException e) {
                throw new SAXException("Incorrect version on the feature '" + id + "': " + version
                        + " (" + e.getMessage() + ")");
            }
View Full Code Here

                skip();
                return;
            }

            String v = getOptionalAttribute(atts, VERSION, DEFAULT_VERSION);
            Version version;
            try {
                version = new Version(v);
            } catch (ParseException e) {
                log(Message.MSG_ERR, "Incorrect resource version: " + v + ". The resource "
                        + symbolicname + " is then ignored.");
                skip();
                return;
View Full Code Here

TOP

Related Classes of org.apache.ivy.osgi.util.Version

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.