Class CounterFactory
java.lang.Object
com.itextpdf.text.log.CounterFactory
Factory that creates a counter for every reader or writer class.
You can implement your own counter and declare it like this:
CounterFactory.getInstance().setCounter(new SysoCounter());
SysoCounter is just an example of a Counter implementation.
It writes info about files being read and written to the System.out.
This functionality can be used to create metrics in a SaaS context.-
Method Summary
Modifier and TypeMethodDescriptionGetter for the counter.static CountergetCounter(Class<?> klass) Returns a counter factory.static CounterFactoryReturns the singleton instance of the factory.voidsetCounter(Counter counter) Setter for the counter.
-
Method Details
-
getInstance
Returns the singleton instance of the factory. -
getCounter
-
getCounter
Getter for the counter. -
setCounter
Setter for the counter.
-