Top Description Inners Fields Constructors Methods
com.openhtmltopdf.util

public Class ThreadCtx

extends Object
Class Inheritance
Imports
com.openhtmltopdf.layout.SharedContext, java.io.Closeable, java.util.function.Consumer

Because OpenHTMLtoPDF is designed to run in a single thread at all times for one invocation, we can use a ThreadLocal to store pseudo global variables. This MUST be set up in the appropriate renderer.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final ThreadLocal<ThreadCtx.ThreadData>
private static final ThreadLocal<Consumer<Diagnostic>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
public static Closeable
public static void
public static ThreadCtx.ThreadData
get()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
private static final ThreadLocal<ThreadCtx.ThreadData> data
diagnosticConsumerback to summary
private static final ThreadLocal<Consumer<Diagnostic>> diagnosticConsumer

Constructor Detail

ThreadCtxback to summary
public ThreadCtx()

Method Detail

addDiagnosticback to summary
pack-priv static void addDiagnostic(Diagnostic diagnostic)
applyDiagnosticConsumerback to summary
public static Closeable applyDiagnosticConsumer(Consumer<Diagnostic> consumer)
cleanupback to summary
public static void cleanup()
getback to summary
public static ThreadCtx.ThreadData get()
com.openhtmltopdf.util back to summary

public Class ThreadCtx.ThreadData

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private SharedContext

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public SharedContext
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sharedContextback to summary
private SharedContext sharedContext

Constructor Detail

ThreadDataback to summary
private ThreadData()

Method Detail

setSharedContextback to summary
public void setSharedContext(SharedContext sharedContext)
sharedContextback to summary
public SharedContext sharedContext()