Package net.sourceforge.cardme.vcard.types

Examples of net.sourceforge.cardme.vcard.types.SourceType


   
    ProfileType profile = new ProfileType();
    profile.setProfile("VCard");
    vcard.setProfile(profile);
   
    SourceType source = new SourceType();
    source.setSource("Whatever");
    vcard.setSource(source);
   
    NType n = new NType();
    n.setEncodingType(EncodingType.QUOTED_PRINTABLE);
    n.setCharset(Charset.forName("UTF-8"));
View Full Code Here


  }
 
  @Test
  public void testBuildSourceType() throws VCardBuildException {
    VCardImpl vcard = getSimpleVCard();
    vcard.setSource(new SourceType("Whatever"));
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

   * @param vcard
   * @throws VCardParseException
   */
  private void parseSourceType(String group, String value, List<ParameterType> paramTypeList, VCardImpl vcard) throws VCardParseException {
    try {
      SourceType sourceType = new SourceType();
      parseParamTypes(sourceType, paramTypeList, value, VCardTypeName.SOURCE);
     
      if(sourceType.isQuotedPrintable()) {
        value = decodeQuotedPrintableValue(sourceType, value);
      }
     
      if(group != null) {
        sourceType.setGroup(group);
      }
     
      sourceType.setSource(VCardUtils.unescapeString(value));
      vcard.setSource(sourceType);
    }
    catch(Exception ex) {
      throw new VCardParseException("SourceType ("+VCardTypeName.SOURCE.getType()+") ["+ex.getClass().getName()+"] "+ex.getMessage(), ex);
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.cardme.vcard.types.SourceType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.