de.smartics.properties.config.transfer.templatestream
Class StreamPropertySink

Package class diagram package StreamPropertySink
java.lang.Object
  extended by de.smartics.properties.config.transfer.templatestream.StreamPropertySink
All Implemented Interfaces:
de.smartics.properties.api.config.transfer.PropertySink

public final class StreamPropertySink
     
     
extends Object
implements de.smartics.properties.api.config.transfer.PropertySink

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()
           This implementation is a no-op since a stream cannot be cleared.
 void close()
           This is a no-op.
 void write(Iterable<de.smartics.properties.api.config.domain.PropertyProvider> providers)
           
 void write(de.smartics.properties.api.config.domain.PropertyProvider provider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamPropertySink

public StreamPropertySink(String template,
                          PrintWriter stream,
                          ValueEscaper escaper)
                   throws NullPointerException,
                          IllegalArgumentException
Convenience constructor using a default table descriptor with no wrappers.

The stream is closed by calling close() by the client.

Parameters:
template - the template to apply on each property.
stream - the stream to write to.
escaper - the escaper for config key, property name and value.
Throws:
NullPointerException - if template or stream is null.
IllegalArgumentException - if template is blank.

StreamPropertySink

public StreamPropertySink(TableDescriptor descriptor,
                          String template,
                          PrintWriter stream,
                          ValueEscaper escaper)
                   throws NullPointerException,
                          IllegalArgumentException
Convenience constructor with no wrappers.

The stream is closed by calling close() by the client.

Parameters:
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.
Throws:
NullPointerException - if template or stream is null.
IllegalArgumentException - if template is blank.

StreamPropertySink

public StreamPropertySink(TableDescriptor descriptor,
                          Wrapper documentWrapper,
                          Wrapper lineWrapper,
                          String template,
                          PrintWriter stream,
                          ValueEscaper escaper)
                   throws NullPointerException,
                          IllegalArgumentException
Default constructor.

The stream is closed by calling close() by the client.

Parameters:
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.
Throws:
NullPointerException - if template , stream , or is null.
IllegalArgumentException - if template is blank.
Method Detail

clear

public void clear()
           throws de.smartics.properties.api.config.transfer.TransferException

This implementation is a no-op since a stream cannot be cleared.

Specified by:
clear in interface de.smartics.properties.api.config.transfer.PropertySink
Throws:
de.smartics.properties.api.config.transfer.TransferException

write

public void write(de.smartics.properties.api.config.domain.PropertyProvider provider)
           throws de.smartics.properties.api.config.transfer.TransferException
Specified by:
write in interface de.smartics.properties.api.config.transfer.PropertySink
Throws:
de.smartics.properties.api.config.transfer.TransferException

write

public void write(Iterable<de.smartics.properties.api.config.domain.PropertyProvider> providers)
           throws de.smartics.properties.api.config.transfer.TransferException
Specified by:
write in interface de.smartics.properties.api.config.transfer.PropertySink
Throws:
de.smartics.properties.api.config.transfer.TransferException

close

public void close()
           throws de.smartics.properties.api.config.transfer.TransferException

This is a no-op.

Specified by:
close in interface de.smartics.properties.api.config.transfer.PropertySink
Throws:
de.smartics.properties.api.config.transfer.TransferException


Copyright © 2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.