|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiweekly.io.text.ICalWriter
public class ICalWriter
Writes ICalendar
objects to an iCalendar data stream.
Example:
List<ICalendar> icals = ... OutputStream out = ... ICalWriter icalWriter = new ICalWriter(out); for (ICalendar ical : icals){ icalWriter.write(ical); } icalWriter.close();
Constructor Summary | |
---|---|
ICalWriter(File file)
Creates an iCalendar writer that writes to a file. |
|
ICalWriter(File file,
boolean append)
Creates an iCalendar writer that writes to a file. |
|
ICalWriter(File file,
boolean append,
FoldingScheme foldingScheme)
Creates an iCalendar writer that writes to a file. |
|
ICalWriter(File file,
boolean append,
FoldingScheme foldingScheme,
String newline)
Creates an iCalendar writer that writes to a file. |
|
ICalWriter(OutputStream outputStream)
Creates an iCalendar writer that writes to an output stream. |
|
ICalWriter(OutputStream outputStream,
FoldingScheme foldingScheme)
Creates an iCalendar writer that writes to an output stream. |
|
ICalWriter(OutputStream outputStream,
FoldingScheme foldingScheme,
String newline)
Creates an iCalendar writer that writes to an output stream. |
|
ICalWriter(Writer writer)
Creates an iCalendar writer that writes to a writer. |
|
ICalWriter(Writer writer,
FoldingScheme foldingScheme)
Creates an iCalendar writer that writes to a writer. |
|
ICalWriter(Writer writer,
FoldingScheme foldingScheme,
String newline)
Creates an iCalendar writer that writes to a writer. |
Method Summary | |
---|---|
void |
close()
Closes the underlying Writer object. |
FoldingScheme |
getFoldingScheme()
Gets the rules for how each line is folded. |
String |
getNewline()
Gets the newline sequence that is used to separate lines. |
ICalMarshallerRegistrar |
getRegistrar()
Gets the object that manages the component/property marshaller objects. |
boolean |
isCaretEncodingEnabled()
Gets whether the writer will apply circumflex accent encoding on parameter values (disabled by default). |
void |
registerMarshaller(ICalComponentMarshaller<? extends ICalComponent> marshaller)
Registers an experimental component marshaller. |
void |
registerMarshaller(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
Registers an experimental property marshaller. |
void |
setCaretEncodingEnabled(boolean enable)
Sets whether the writer will apply circumflex accent encoding on parameter values (disabled by default). |
void |
setRegistrar(ICalMarshallerRegistrar registrar)
Sets the object that manages the component/property marshaller objects. |
void |
write(ICalendar ical)
Writes an iCalendar object to the data stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ICalWriter(OutputStream outputStream)
outputStream
- the output stream to write topublic ICalWriter(OutputStream outputStream, FoldingScheme foldingScheme)
outputStream
- the output stream to write tofoldingScheme
- the folding scheme to use or null not to fold at allpublic ICalWriter(OutputStream outputStream, FoldingScheme foldingScheme, String newline)
outputStream
- the output stream to write tofoldingScheme
- the folding scheme to use or null not to fold at allnewline
- the newline sequence to usepublic ICalWriter(File file) throws FileNotFoundException
file
- the file to write to
FileNotFoundException
- if the file cannot be written topublic ICalWriter(File file, boolean append) throws FileNotFoundException
file
- the file to write toappend
- true to append to the end of the file, false to overwrite
it
FileNotFoundException
- if the file cannot be written topublic ICalWriter(File file, boolean append, FoldingScheme foldingScheme) throws FileNotFoundException
file
- the file to write toappend
- true to append to the end of the file, false to overwrite
itfoldingScheme
- the folding scheme to use or null not to fold at all
FileNotFoundException
- if the file cannot be written topublic ICalWriter(File file, boolean append, FoldingScheme foldingScheme, String newline) throws FileNotFoundException
file
- the file to write toappend
- true to append to the end of the file, false to overwrite
itfoldingScheme
- the folding scheme to use or null not to fold at allnewline
- the newline sequence to use
FileNotFoundException
- if the file cannot be written topublic ICalWriter(Writer writer)
writer
- the writer to the data streampublic ICalWriter(Writer writer, FoldingScheme foldingScheme)
writer
- the writer to the data streamfoldingScheme
- the folding scheme to use or null not to fold at allpublic ICalWriter(Writer writer, FoldingScheme foldingScheme, String newline)
writer
- the writer to the data streamfoldingScheme
- the folding scheme to use or null not to fold at allnewline
- the newline sequence to useMethod Detail |
---|
public boolean isCaretEncodingEnabled()
Gets whether the writer will apply circumflex accent encoding on parameter values (disabled by default). This escaping mechanism allows for newlines and double quotes to be included in parameter values.
When disabled, the writer will replace newlines with spaces and double quotes with single quotes.
ICalRawWriter.isCaretEncodingEnabled()
public void setCaretEncodingEnabled(boolean enable)
Sets whether the writer will apply circumflex accent encoding on parameter values (disabled by default). This escaping mechanism allows for newlines and double quotes to be included in parameter values.
When disabled, the writer will replace newlines with spaces and double quotes with single quotes.
enable
- true to use circumflex accent encoding, false not toICalRawWriter.setCaretEncodingEnabled(boolean)
public String getNewline()
public FoldingScheme getFoldingScheme()
public void registerMarshaller(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
Registers an experimental property marshaller. Can also be used to override the marshaller of a standard property (such as DTSTART). Calling this method is the same as calling:
getRegistrar().register(marshaller)
.
marshaller
- the marshaller to registerpublic void registerMarshaller(ICalComponentMarshaller<? extends ICalComponent> marshaller)
Registers an experimental component marshaller. Can also be used to override the marshaller of a standard component (such as VEVENT). Calling this method is the same as calling:
getRegistrar().register(marshaller)
.
marshaller
- the marshaller to registerpublic ICalMarshallerRegistrar getRegistrar()
public void setRegistrar(ICalMarshallerRegistrar registrar)
registrar
- the marshaller registrarpublic void write(ICalendar ical) throws IOException
ical
- the iCalendar object to write
IllegalArgumentException
- if the marshaller class for a component
or property object cannot be found (only happens when an experimental
property/component marshaller is not registered with the
registerMarshaller
method.)
IOException
- if there's a problem writing to the data streampublic void close() throws IOException
Writer
object.
close
in interface Closeable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |