Search in sources :

Example 6 with QuotedTokenizer

use of aQute.libg.qtokens.QuotedTokenizer in project bnd by bndtools.

the class TestQuotedTokenizer method testQuoted.

public static void testQuoted() {
    String[] s = new QuotedTokenizer("'1 ,\t.jar'", ",").getTokens();
    assertEquals("Length", 1, s.length);
    assertEquals("1 ,\t.jar", s[0]);
}
Also used : QuotedTokenizer(aQute.libg.qtokens.QuotedTokenizer)

Example 7 with QuotedTokenizer

use of aQute.libg.qtokens.QuotedTokenizer in project bnd by bndtools.

the class TestQuotedTokenizer method testNativeSeps.

public static void testNativeSeps() {
    String[] s = new QuotedTokenizer("x;c;d=4", ";,=", true).getTokens();
    assertEquals("Length", 7, s.length);
    assertEquals("x", s[0]);
    assertEquals(";", s[1]);
    assertEquals("c", s[2]);
    assertEquals(";", s[3]);
    assertEquals("d", s[4]);
    assertEquals("=", s[5]);
    assertEquals("4", s[6]);
}
Also used : QuotedTokenizer(aQute.libg.qtokens.QuotedTokenizer)

Example 8 with QuotedTokenizer

use of aQute.libg.qtokens.QuotedTokenizer in project bnd by bndtools.

the class TestQuotedTokenizer method testNative.

public static void testNative() {
    String[] s = new QuotedTokenizer("x.dll;y.dll;abc=3;def=5;version=\"1.2.34,123\"", ";,=").getTokens();
    assertEquals("Length", 8, s.length);
    assertEquals("x.dll", s[0]);
    assertEquals("y.dll", s[1]);
    assertEquals("abc", s[2]);
    assertEquals("3", s[3]);
    assertEquals("def", s[4]);
    assertEquals("5", s[5]);
    assertEquals("version", s[6]);
    assertEquals("1.2.34,123", s[7]);
}
Also used : QuotedTokenizer(aQute.libg.qtokens.QuotedTokenizer)

Example 9 with QuotedTokenizer

use of aQute.libg.qtokens.QuotedTokenizer in project bnd by bndtools.

the class TestQuotedTokenizer method testExplicitEmptyString.

public static void testExplicitEmptyString() {
    QuotedTokenizer qt = new QuotedTokenizer("literal=''", ";=,");
    qt.nextToken();
    assertEquals("", qt.nextToken());
}
Also used : QuotedTokenizer(aQute.libg.qtokens.QuotedTokenizer)

Example 10 with QuotedTokenizer

use of aQute.libg.qtokens.QuotedTokenizer in project bnd by bndtools.

the class TestQuotedTokenizer method testMultipleSeps.

public static void testMultipleSeps() {
    String[] s = new QuotedTokenizer("1.jar,,,,,,,,,,,    , ,2.jar", ",").getTokens();
    assertEquals("Length", 14, s.length);
    assertEquals("1.jar", s[0]);
    assertEquals("2.jar", s[13]);
}
Also used : QuotedTokenizer(aQute.libg.qtokens.QuotedTokenizer)

Aggregations

QuotedTokenizer (aQute.libg.qtokens.QuotedTokenizer)22 File (java.io.File)3 ArrayList (java.util.ArrayList)3 Pattern (java.util.regex.Pattern)2 PomFromManifest (aQute.bnd.maven.PomFromManifest)1 Instructions (aQute.bnd.osgi.Instructions)1 CapReqBuilder (aQute.bnd.osgi.resource.CapReqBuilder)1 Description (aQute.lib.getopt.Description)1 FilenameFilter (java.io.FilenameFilter)1 LinkedList (java.util.LinkedList)1 TreeSet (java.util.TreeSet)1 Attributes (java.util.jar.Attributes)1 Name (java.util.jar.Attributes.Name)1 JarInputStream (java.util.jar.JarInputStream)1 Manifest (java.util.jar.Manifest)1 Matcher (java.util.regex.Matcher)1 Requirement (org.osgi.resource.Requirement)1