|
||||||||||
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.
List<ICalendar> icals = ... Writer writer = ... ICalWriter icalWriter = new ICalWriter(writer); 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,
FoldingScheme foldingScheme)
Creates an iCalendar writer that writes to a file. |
|
ICalWriter(File file,
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. |
List<String> |
getWarnings()
Gets the warnings from the last iCal that was written. |
boolean |
isCaretEncodingEnabled()
Gets whether the writer will apply circumflex accent encoding on parameter values (disabled by default). |
void |
registerMarshaller(ICalComponentMarshaller<? extends ICalComponent> marshaller)
Registers a marshaller for an experimental component. |
void |
registerMarshaller(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
Registers a marshaller for an experimental property. |
void |
setCaretEncodingEnabled(boolean enable)
Sets whether the writer will apply circumflex accent encoding on parameter values (disabled by default). |
void |
write(ICalendar ical)
Writes an iCal 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) throws IOException
outputStream
- the output stream to write tofoldingScheme
- the folding scheme to use or null not to fold at all
IOException
public ICalWriter(OutputStream outputStream, FoldingScheme foldingScheme, String newline) throws IOException
outputStream
- the output stream to write tofoldingScheme
- the folding scheme to use or null not to fold at allnewline
- the newline sequence to use
IOException
public ICalWriter(File file) throws IOException
file
- the file to write to
IOException
- if the file cannot be written topublic ICalWriter(File file, FoldingScheme foldingScheme) throws IOException
file
- the file to write tofoldingScheme
- the folding scheme to use or null not to fold at all
IOException
- if the file cannot be written topublic ICalWriter(File file, FoldingScheme foldingScheme, String newline) throws IOException
file
- the file to write tofoldingScheme
- the folding scheme to use or null not to fold at allnewline
- the newline sequence to use
IOException
- 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 List<String> getWarnings()
public void registerMarshaller(ICalPropertyMarshaller<? extends ICalProperty> marshaller)
marshaller
- the marshaller to registerpublic void registerMarshaller(ICalComponentMarshaller<? extends ICalComponent> marshaller)
marshaller
- the marshaller to registerpublic void write(ICalendar ical) throws IOException
ical
- the iCalendar object to write
IOException
public 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 |