ezvcard.io.text
Class FoldingScheme

java.lang.Object
  extended by ezvcard.io.text.FoldingScheme

public class FoldingScheme
extends Object

Specifies how a vCard should be folded when written to a string.

Author:
George El-Haddad, Michael Angstadt

Field Summary
static FoldingScheme MAC_ADDRESS_BOOK
          Folds lines at 76 characters (not including CRLF) and uses 2 spaces as indentation.
static FoldingScheme MIME_DIR
          Folds lines at 75 characters (not including CRLF) and uses 1 space as indentation.
static FoldingScheme MS_OUTLOOK
          Folds lines at 72 characters (not including CRLF) and uses 1 space as indentation.
 
Constructor Summary
FoldingScheme(int lineLength, String indent)
          Creates a folding scheme.
 
Method Summary
 String getIndent()
          Gets the string that is used to indent the folded line.
 int getLineLength()
          Gets the maximum number of characters that can exist on a line before needing to be folded (not including the newline).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIME_DIR

public static final FoldingScheme MIME_DIR
Folds lines at 75 characters (not including CRLF) and uses 1 space as indentation.

See Also:
"RFC2426 p.8"

MS_OUTLOOK

public static final FoldingScheme MS_OUTLOOK
Folds lines at 72 characters (not including CRLF) and uses 1 space as indentation.


MAC_ADDRESS_BOOK

public static final FoldingScheme MAC_ADDRESS_BOOK
Folds lines at 76 characters (not including CRLF) and uses 2 spaces as indentation.

Constructor Detail

FoldingScheme

public FoldingScheme(int lineLength,
                     String indent)
Creates a folding scheme.

Parameters:
lineLength - the maximum number of characters that can exist on a line before needing to be folded (not including the newline)
indent - the string to use for indentation
Throws:
IllegalArgumentException - if the line length is <= 0, or if the line length is less than the length of the indentation string
Method Detail

getLineLength

public int getLineLength()
Gets the maximum number of characters that can exist on a line before needing to be folded (not including the newline).

Returns:
the max line length

getIndent

public String getIndent()
Gets the string that is used to indent the folded line.

Returns:
the indent string


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.