X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Fparsers%2FParser.java;h=1fa7c5749805746d58e41f9fae52e575e2cb529d;hb=cf77cb3542f2aefbebdb9aa00b358dbeb4489a73;hp=5cdd25fee995dfe10aef8c6d4a5d00dcc18aa5ab;hpb=1c03abafc3987d93fa682e7b8758e51bed8a4faf;p=jvcard.git diff --git a/src/be/nikiroo/jvcard/parsers/Parser.java b/src/be/nikiroo/jvcard/parsers/Parser.java index 5cdd25f..1fa7c57 100644 --- a/src/be/nikiroo/jvcard/parsers/Parser.java +++ b/src/be/nikiroo/jvcard/parsers/Parser.java @@ -72,13 +72,28 @@ public class Parser { } } - // -1 = no bkeys - public static String toString(Card card, Format format) { + /** + * Return a {@link String} representation of the given {@link Card}, line by + * line. + * + * @param card + * the card to convert + * + * @param startingBKey + * the starting BKey number (all the other will follow) or -1 for + * no BKey + * + * @param format + * the output {@link Format} to use + * + * @return the {@link String} representation + */ + public static List toStrings(Card card, Format format) { switch (format) { case VCard21: - return Vcard21Parser.toString(card); + return Vcard21Parser.toStrings(card); case Abook: - return AbookParser.toString(card); + return AbookParser.toStrings(card); default: throw new InvalidParameterException("Unknown format: " @@ -86,14 +101,29 @@ public class Parser { } } - // -1 = no bkeys - public static String toString(Contact contact, Format format, + /** + * Return a {@link String} representation of the given {@link Card}, line by + * line. + * + * @param card + * the card to convert + * + * @param startingBKey + * the starting BKey number (all the other will follow) or -1 for + * no BKey + * + * @param format + * the output {@link Format} to use + * + * @return the {@link String} representation + */ + public static List toStrings(Contact contact, Format format, int startingBKey) { switch (format) { case VCard21: - return Vcard21Parser.toString(contact, startingBKey); + return Vcard21Parser.toStrings(contact, startingBKey); case Abook: - return AbookParser.toString(contact, startingBKey); + return AbookParser.toStrings(contact, startingBKey); default: throw new InvalidParameterException("Unknown format: "