Class HtmlDocSerializerSession
- All Implemented Interfaces:
BeanSession,ConverterSession,RecordWritable
- Direct Known Subclasses:
HtmlSchemaDocSerializerSession
HtmlSerializer and its subclasses.
See Serializer for details.
Notes:
- This class is not thread safe and is typically discarded after one use.
See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class.static final classConcrete default builder leaf for the non-subclassedcreate()path (CRTP terminal).Nested classes/interfaces inherited from class org.apache.juneau.marshall.xml.XmlSerializerSession
XmlSerializerSession.ContentResult -
Field Summary
Fields inherited from class org.apache.juneau.marshall.MarshallingTraverseSession
indentFields inherited from class org.apache.juneau.marshall.MarshallingSession
NAME_PROPERTY_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic HtmlDocSerializerSession.Builder<?>create(HtmlDocSerializer ctx) Creates a new builder for this object.protected VarResolverSessionAdds a session object to theVarResolverSessionin this session.protected voiddoWrite(SerializerPipe out, Object o) Serializes a POJO to the specified pipe.protected final HtmlDocSerializerSessionforEachWidget(Consumer<HtmlWidget> action) Performs an action on all widgets defined in his session.protected final String[]getAside()Aside section contents.protected final AsideFloatAside section contents float.protected final String[]Footer section contents.protected final String[]getHead()Additional head section content.protected final String[]Header section contents.protected final String[]getNav()Nav section contents.protected final String[]Page navigation links.final String[]Returns theHtmlDocSerializer.Builder.navlinks(String...)setting value in this context.final StringgetNonce()The per-response Content-Security-Policy nonce for this render.protected final StringNo-results message.protected final String[]Javascript code.protected final String[]getStyle()CSS style code.protected final String[]Stylesheet import URLs.protected final HtmlDocTemplateHTML document template.protected final booleanisNowrap()Prevent word wrap on page.protected final booleanResolve $ variables in serialized POJO.voidparentSerialize(Object out, Object o) Calls the parentdoWrite(SerializerPipe, Object)method which invokes just the HTML serializer.Returns the properties on this bean as a map for debugging.resolveHtmlDoc(String string) Resolves SVL variables for HTML-doc chrome fields that write raw HTML.resolveScriptStyle(String string) Resolves SVL variables for<script>and<style>chrome.Methods inherited from class org.apache.juneau.marshall.html.HtmlStrippedDocSerializerSession
createMethods inherited from class org.apache.juneau.marshall.html.HtmlSerializerSession
create, getAnchorText, getHtmlBeanPropertyMeta, getHtmlClassMeta, getHtmlWriter, getLabelParameter, getUriAnchorText, isAddBeanTypes, isAddKeyValueTableHeaders, isDetectLabelParameters, isDetectLinksInStrings, isHtmlMode, isUri, writeAnything, writeAnythingMethods inherited from class org.apache.juneau.marshall.xml.XmlSerializerSession
create, findNsfMappings, getDefaultNamespace, getNamespaces, getXmlBeanMeta, getXmlBeanPropertyMeta, getXmlClassMeta, getXmlWriter, isAddJsonTags, isAddNamespaceUrisToRoot, isAutoDetectNamespaces, isEnableNamespaces, isRecordStreaming, writeRecordsMethods inherited from class org.apache.juneau.marshall.serializer.WriterSerializerSession
create, createPipe, getMaxIndent, getQuoteChar, getStreamCharset, isUseWhitespace, isWriterSerializer, write, writeToStringMethods inherited from class org.apache.juneau.marshall.serializer.SerializerSession
addVarBean, canIgnoreValue, canIgnoreValue, create, createBeanTypeNameProperty, forEachEntry, forEachEntry, forEachStreamableEntry, generalize, getBeanTypeName, getCalendarFormat, getDateFormat, getDurationFormat, getExpectedRootType, getJavaMethod, getListener, getListener, getLocaleFormat, getPeriodFormat, getResponseHeaders, getSchema, getTemporalFormat, getTimeZoneFormat, getUriContext, getUriRelativity, getUriResolution, getUriResolver, getVarResolver, handleThrown, isAddRootType, isKeepNullProperties, isNonDefault, isSortCollections, isSortMaps, isTrimEmptyCollections, isTrimEmptyMaps, isTrimStrings, onBeanGetterException, onError, push2, relativizeUri, resolve, resolveUri, sort, sort, sort, swap, toList, toListFromStreamable, toString, trim, unwrapSupplier, write, writeCalendar, writeDate, writeDuration, writePeriod, writeTemporalMethods inherited from class org.apache.juneau.marshall.MarshallingTraverseSession
getInitialDepth, getLastLocation, getMaxDepth, getOptionalType, getOptionalValue, getStack, isDetectRecursions, isIgnoreRecursions, isOptional, isRoot, pop, push, setCurrentClass, setCurrentProperty, willExceedDepth, willRecurseMethods inherited from class org.apache.juneau.marshall.MarshallingSession
addWarning, convertToMemberType, convertToMemberType, convertToMemberType, convertToType, convertToType, convertToType, convertToType, create, get, getActiveView, getAnnotationProvider, getArgsClassMeta, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionary, getBeanFieldVisibility, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getBeanTypePropertyName, getClassLoader, getClassMeta, getClassMeta, getClassMetaForObject, getClassMetaForObject, getLocale, getMarshallingContext, getMediaType, getNotBeanClasses, getNotBeanPackagesNames, getPropertyNamer, getSwaps, getTimeZone, getTimeZoneId, isBean, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isFindFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnoreMissingSetters, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isPropertyInActiveView, isRecordComponentOrder, isUnsortedProperties, isUseInterfaceProxies, isUseJavaBeanIntrospector, isValidateSchema, newBean, newBean, newBeanMap, newBeanMap, newGenericList, newGenericMap, newGenericMap, object, parseToList, parseToMap, string, toArray, toBeanMap, toBeanMap, toBeanMapMethods inherited from class org.apache.juneau.marshall.ContextSession
checkForWarnings, getContext, getSessionProperties, getWarnings, isDebug, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.juneau.commons.conversion.ConverterSession
get
-
Constructor Details
-
HtmlDocSerializerSession
Constructor.- Parameters:
builder- The builder for this object.
-
-
Method Details
-
create
Creates a new builder for this object.- Parameters:
ctx- The context creating this session.- Returns:
- A new builder.
-
getNonce
The per-response Content-Security-Policy nonce for this render.When non-
null , inline<script>/<style>tags emitted by the HtmlDoc template are stamped with a matchingnonce="..."attribute so they satisfy a nonce-based CSP.- Returns:
- The nonce token, or
null if nonce stamping is disabled. - See Also:
-
parentSerialize
Calls the parentdoWrite(SerializerPipe, Object)method which invokes just the HTML serializer.- Parameters:
out- Where to send the output from the serializer.o- The object being serialized.- Throws:
Exception- Error occurred during serialization.
-
createDefaultVarResolverSession
Description copied from class:SerializerSessionAdds a session object to theVarResolverSessionin this session.- Overrides:
createDefaultVarResolverSessionin classSerializerSession- Returns:
- This object.
-
doWrite
Description copied from class:SerializerSessionSerializes a POJO to the specified pipe.This method should NOT close the context object.
The default implementation of this method simply calls
Serializer.doWrite(SerializerSession,SerializerPipe,Object).- Overrides:
doWritein classHtmlStrippedDocSerializerSession- Parameters:
out- Where to send the output from the serializer.o- The object to serialize.- Throws:
IOException- Thrown by underlying stream.SerializeException- Problem occurred trying to serialize object.
-
forEachWidget
Performs an action on all widgets defined in his session.- Parameters:
action- The action to perform.- Returns:
- This object.
- See Also:
-
getAside
Aside section contents.- Returns:
- The overridden contents of the aside section on the HTML page.
- See Also:
-
getAsideFloat
Aside section contents float.- Returns:
- The location of where to place the aside section.
- See Also:
-
getHead
Additional head section content.- Returns:
- HTML content to add to the head section of the HTML page.
- See Also:
-
getHeader
Header section contents.- Returns:
- The overridden contents of the header section on the HTML page.
- See Also:
-
getNoResultsMessage
No-results message.- Returns:
- The message used when serializing an empty array or empty list.
- See Also:
-
getScript
Javascript code.- Returns:
- Arbitrary Javascript to add to the HTML page.
- See Also:
-
getStyle
CSS style code.- Returns:
- The CSS instructions to add to the HTML page.
- See Also:
-
getStylesheet
Stylesheet import URLs.- Returns:
- The link to the stylesheet of the HTML page.
- See Also:
-
getTemplate
HTML document template.- Returns:
- The template to use for serializing the page.
- See Also:
-
isNowrap
Prevent word wrap on page.- Returns:
true if"* {white-space:nowrap}" should be added to the CSS instructions on the page to prevent word wrapping.- See Also:
-
isResolveBodyVars
Resolve $ variables in serialized POJO.- Returns:
true if $ variables in serialized POJO should be resolved.- See Also:
-
resolveHtmlDoc
Resolves SVL variables for HTML-doc chrome fields that write raw HTML.Literal characters from the template (including tags) pass through unchanged. Each SVL substitution is XML-escaped before insert, except the HTML-passthrough vars
$W,$C, and$RS.Plain
SerializerSession.resolve(String)is unchanged. Navlinkhrefvalues should keep usingSerializerSession.resolve(String)plus attribute encoding.- Parameters:
string- The chrome template. Can benull .- Returns:
- The resolved chrome string, or
null if the input wasnull .
-
resolveScriptStyle
Resolves SVL variables for<script>and<style>chrome.Request-derived vars (
$RQ,$RH,$RF,$RP,$RA,$SA,$R) are left unresolved (same as an unknown var). Other vars including$W,$C, and$RSstill resolve.- Parameters:
string- The script or style template. Can benull .- Returns:
- The resolved string, or
null if the input wasnull .
-
properties
Description copied from class:ContextSessionReturns the properties on this bean as a map for debugging.- Overrides:
propertiesin classWriterSerializerSession- Returns:
- The properties on this bean as a map for debugging.
-