|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.config.transfer.templatestream.StreamPropertySink
public final class StreamPropertySink
Writes properties to a folder.
Constructor Summary | |
---|---|
StreamPropertySink(String template, PrintWriter stream, ValueEscaper escaper) Convenience constructor using a default table descriptor with no wrappers. |
|
StreamPropertySink(TableDescriptor descriptor, String template, PrintWriter stream, ValueEscaper escaper) Convenience constructor with no wrappers. |
|
StreamPropertySink(TableDescriptor descriptor, Wrapper documentWrapper, Wrapper lineWrapper, String template, PrintWriter stream, ValueEscaper escaper) Default constructor. |
Method Summary | |
---|---|
void |
clear() Removes all information from the sink. |
void |
close() Closes the sink. |
void |
write(Iterable<PropertyProvider> providers) Writes the property definitions provided by the given providers. |
void |
write(PropertyProvider provider) Writes the property definitions provided by the given provider. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamPropertySink(String template, PrintWriter stream, ValueEscaper escaper) throws NullPointerException, IllegalArgumentException
The stream is closed by calling close()
by the client.
template
- the template to apply on each property.
stream
- the stream to write to.
escaper
- the escaper for config key, property name and value.
NullPointerException
- if
template
or
stream
is
null
.
IllegalArgumentException
- if
template
is blank.
public StreamPropertySink(TableDescriptor descriptor, String template, PrintWriter stream, ValueEscaper escaper) throws NullPointerException, IllegalArgumentException
The stream is closed by calling close()
by the client.
descriptor
- the descriptor for table and column names to store property values.
template
- the template to apply on each property.
stream
- the stream to write to.
escaper
- the escaper for config key, property name and value.
NullPointerException
- if
template
or
stream
is
null
.
IllegalArgumentException
- if
template
is blank.
public StreamPropertySink(TableDescriptor descriptor, Wrapper documentWrapper, Wrapper lineWrapper, String template, PrintWriter stream, ValueEscaper escaper) throws NullPointerException, IllegalArgumentException
The stream is closed by calling close()
by the client.
descriptor
- the descriptor for table and column names to store property values.
documentWrapper
- the introduction to write to the stream at the start.
lineWrapper
- the text to write to the stream at the end before closing the stream.
template
- the template to apply on each property.
stream
- the stream to write to.
escaper
- the escaper for config key, property name and value.
NullPointerException
- if
template
,
stream
, or is
null
.
IllegalArgumentException
- if
template
is blank.
Method Detail |
---|
public void clear() throws TransferException
This implementation is a no-op since a stream cannot be cleared.
clear
in interface
PropertySink
TransferException
- on any problem clearing the sink.
public void write(PropertyProvider provider) throws TransferException
PropertySink
It is assumed that the writing is transactional. If it is not, the implementation should document that it isn't.
write
in interface
PropertySink
provider
- the provider of property definitions.
TransferException
- on any problem writing the definitions to this sink.
public void write(Iterable<PropertyProvider> providers) throws TransferException
PropertySink
It is assumed that the writing is transactional. If it is not, the implementation should document that it isn't.
write
in interface
PropertySink
providers
- the list of providers to add their property definitions.
TransferException
- on any problem writing property definitions to this sink.
public void close() throws TransferException
This is a no-op.
close
in interface
PropertySink
TransferException
- on any problem closing the sink.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |