@Override protected void _prepareParameters( T property, VCardParameters copy, VCardVersion version, VCard vcard) { MediaTypeParameter contentType = property.getContentType(); if (contentType == null) { contentType = new MediaTypeParameter(null, null, null); } if (property.getUrl() != null) { copy.setEncoding(null); switch (version) { case V2_1: copy.setType(contentType.getValue()); copy.setMediaType(null); break; case V3_0: copy.setType(contentType.getValue()); copy.setMediaType(null); break; case V4_0: copy.setMediaType(contentType.getMediaType()); break; } return; } if (property.getData() != null) { copy.setMediaType(null); switch (version) { case V2_1: copy.setEncoding(Encoding.BASE64); copy.setType(contentType.getValue()); break; case V3_0: copy.setEncoding(Encoding.B); copy.setType(contentType.getValue()); break; case V4_0: copy.setEncoding(null); // don't null out TYPE, it could be set to "home", "work", etc break; } return; } }