KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > jayasoft > ivy > version > SubVersionMatcher


1 /*
2  * This file is subject to the licence found in LICENCE.TXT in the root directory of the project.
3  * Copyright Jayasoft 2005 - All rights reserved
4  *
5  * #SNAPSHOT#
6  */

7 package fr.jayasoft.ivy.version;
8
9 import fr.jayasoft.ivy.ModuleRevisionId;
10
11 public class SubVersionMatcher extends AbstractVersionMatcher {
12     public SubVersionMatcher() {
13         super("sub-version");
14     }
15
16     public boolean isDynamic(ModuleRevisionId askedMrid) {
17         return askedMrid.getRevision().endsWith("+");
18     }
19
20     public boolean accept(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid) {
21         String JavaDoc prefix = askedMrid.getRevision().substring(0, askedMrid.getRevision().length() - 1);
22         return foundMrid.getRevision().startsWith(prefix);
23     }
24 }
25
Popular Tags