Interface TransactionalUncheckedWriter
-
- All Superinterfaces:
- AutoCloseable, Closeable, IOTransactional, Transactional, VUWriter
A transactional text writer that throws runtime exceptions.This interface defines two methods that terminate a transactional writing operation. These methods change the state of the transactional writer to
terminated. In theterminatedstate, invocations of these methods have no effect and invocations of writing operations throw anIllegalStateException.The terminating methods are
commit()andabort(). Thecommitmethod must be called after the intended contents have been written to make the contents available, for example, as a new file. Otherwise, theabortmethod must be called, both to ensure that temporary resources are released and to ensure that a subsequent invocation ofcommit(), even by accident, has no effect.The above description means that one may call
commit()after callingabort()or callabort()after callingcommit(); in either case, the second method invocation will have no effect. Thus, it is possible and convenient to callcommit()at the end of atrybody and callabort()in afinallyclause of the sametrystatement. Even more conveniently, if the transactional writer is created and used within a try-with-resources statement, no explicit invocation ofabort()is required, because it will be called implicitly (asclose()is defined to callabort()).
-
-
Static Methods Modifier and Type Static Method and Description 
from 

-
Methods Modifier and Type Method and Description 
abort 
This method has no effect if the writer has already been committed or aborted.
asPrintWriter 


asWriter 


close 
The close method is defined to invoke the abort method.
commit 
This method has no effect if the writer has already been committed or aborted.
flush 


newLine 


write 


write 


writeln 


writeln 

-