ezvcard
Class Ezvcard.WriterChainJson

java.lang.Object
  extended by ezvcard.Ezvcard.WriterChainJson
Enclosing class:
Ezvcard

public static class Ezvcard.WriterChainJson
extends Object

Chainer class for writing JSON-encoded vCards (jCard).

See Also:
Ezvcard.writeJson(Collection), Ezvcard.writeJson(VCard...)

Method Summary
 String go()
          Writes the jCards to a string.
 void go(File file)
          Writes the jCards to a file.
 void go(OutputStream out)
          Writes the jCards to an output stream.
 void go(Writer writer)
          Writes the jCards to a writer.
 Ezvcard.WriterChainJson indent(boolean indent)
          Sets whether or not to pretty-print the JSON.
 Ezvcard.WriterChainJson prodId(boolean include)
          Sets whether or not to add a PRODID property to each vCard, saying that the vCard was generated by this library.
 Ezvcard.WriterChainJson register(VCardPropertyScribe<? extends VCardProperty> scribe)
          Registers a property scribe.
 Ezvcard.WriterChainJson versionStrict(boolean versionStrict)
          Sets whether properties that do not support jCard (vCard version 4.0) will be excluded from the written vCard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

prodId

public Ezvcard.WriterChainJson prodId(boolean include)
Sets whether or not to add a PRODID property to each vCard, saying that the vCard was generated by this library.

Parameters:
include - true to add PRODID (default), false not to
Returns:
this

indent

public Ezvcard.WriterChainJson indent(boolean indent)
Sets whether or not to pretty-print the JSON.

Parameters:
indent - true to pretty-print it, false not to (defaults to false)
Returns:
this

versionStrict

public Ezvcard.WriterChainJson versionStrict(boolean versionStrict)
Sets whether properties that do not support jCard (vCard version 4.0) will be excluded from the written vCard.

Parameters:
versionStrict - true to exclude properties that do not support jCard, false to include them anyway (defaults to true)
Returns:
this

register

public Ezvcard.WriterChainJson register(VCardPropertyScribe<? extends VCardProperty> scribe)
Registers a property scribe.

Parameters:
scribe - the scribe to register
Returns:
this

go

public String go()
Writes the jCards to a string.

Returns:
the JSON string

go

public void go(OutputStream out)
        throws IOException
Writes the jCards to an output stream.

Parameters:
out - the output stream to write to
Throws:
IOException - if there's a problem writing to the output stream

go

public void go(File file)
        throws IOException
Writes the jCards to a file.

Parameters:
file - the file to write to
Throws:
IOException - if there's a problem writing to the file

go

public void go(Writer writer)
        throws IOException
Writes the jCards to a writer.

Parameters:
writer - the writer to write to
Throws:
IOException - if there's a problem writing to the writer


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