ezvcard
Class Ezvcard.WriterChainXml

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

public static class Ezvcard.WriterChainXml
extends Object

Chainer class for writing XML vCards (xCard).

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

Method Summary
 Document dom()
          Generates an XML document object model (DOM) containing the xCards.
 String go()
          Writes the xCards to a string.
 void go(File file)
          Writes the xCards to a file.
 void go(OutputStream out)
          Writes the xCards to an output stream.
 void go(Writer writer)
          Writes the xCards to a writer.
 Ezvcard.WriterChainXml indent(int indent)
          Sets the number of indent spaces to use for pretty-printing.
 Ezvcard.WriterChainXml 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.WriterChainXml register(VCardPropertyScribe<? extends VCardProperty> scribe)
          Registers a property scribe.
 Ezvcard.WriterChainXml versionStrict(boolean versionStrict)
          Sets whether properties that do not support xCard (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.WriterChainXml 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.WriterChainXml indent(int indent)
Sets the number of indent spaces to use for pretty-printing. If not set, then the XML will not be pretty-printed.

Parameters:
indent - the number of spaces in the indent string
Returns:
this

versionStrict

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

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

register

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

Parameters:
scribe - the scribe to register
Returns:
this

go

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

Returns:
the XML document

go

public void go(OutputStream out)
        throws TransformerException
Writes the xCards to an output stream.

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

go

public void go(File file)
        throws IOException,
               TransformerException
Writes the xCards to a file.

Parameters:
file - the file to write to
Throws:
IOException - if the file can't be opened
TransformerException - if there's a problem writing to the file

go

public void go(Writer writer)
        throws TransformerException
Writes the xCards to a writer.

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

dom

public Document dom()
Generates an XML document object model (DOM) containing the xCards.

Returns:
the DOM


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