- List<TypeInfo> types = new LinkedList<TypeInfo>();
- String name = "";
- String value = "";
- String group = "";
-
- if (line.contains(":")) {
- int colIndex = line.indexOf(':');
- String rest = line.substring(0, colIndex);
- value = line.substring(colIndex + 1);
-
- if (rest.contains(";")) {
- String tab[] = rest.split(";");
- name = tab[0];
-
- for (int i = 1; i < tab.length; i++) {
- if (tab[i].contains("=")) {
- int equIndex = tab[i].indexOf('=');
- String tname = tab[i]
- .substring(0, equIndex);
- String tvalue = tab[i]
- .substring(equIndex + 1);
- types.add(new TypeInfo(tname, tvalue));
- } else {
- types.add(new TypeInfo(tab[i], ""));
- }
- }
+ datas.add(line);
+ }
+ }
+ }
+
+ return contacts;
+ }
+
+ /**
+ * Load the given data from under the given {@link Format}.
+ *
+ * @param lines
+ * the input to load from
+ * @param format
+ * the {@link Format} to load as
+ *
+ * @return the list of elements
+ */
+ public static List<Data> parseData(Iterable<String> textData) {
+ List<Data> datas = new LinkedList<Data>();
+
+ for (String line : textData) {
+ List<TypeInfo> types = new LinkedList<TypeInfo>();
+ String name = "";
+ String value = "";
+ String group = "";
+
+ if (line.contains(":")) {
+ int colIndex = line.indexOf(':');
+ String rest = line.substring(0, colIndex);
+ value = line.substring(colIndex + 1);
+
+ if (rest.contains(";")) {
+ String tab[] = rest.split(";");
+ name = tab[0];
+
+ for (int i = 1; i < tab.length; i++) {
+ if (tab[i].contains("=")) {
+ int equIndex = tab[i].indexOf('=');
+ String tname = tab[i].substring(0, equIndex);
+ String tvalue = tab[i].substring(equIndex + 1);
+ types.add(new TypeInfo(tname, tvalue));