Package org.apache.juneau.html
Class HtmlDocSerializerSession
java.lang.Object
- Direct Known Subclasses:
HtmlSchemaDocSerializerSession
Context object that lives for the duration of a single serialization of
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 classes/interfaces inherited from class org.apache.juneau.xml.XmlSerializerSession
XmlSerializerSession.ContentResult
-
Field Summary
Fields inherited from class org.apache.juneau.BeanTraverseSession
indent
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(HtmlDocSerializer ctx) Creates a new builder for this object.protected VarResolverSession
Adds a session object to theVarResolverSession
in this session.protected void
doSerialize
(SerializerPipe out, Object o) Serializes a POJO to the specified pipe.protected final HtmlDocSerializerSession
forEachWidget
(Consumer<HtmlWidget> action) Performs an action on all widgets defined in his session.protected final String[]
getAside()
Aside section contents.protected final AsideFloat
Aside 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.protected final String
No-results message.protected final String[]
Javascript code.protected final String[]
getStyle()
CSS style code.protected final String[]
Stylesheet import URLs.protected final HtmlDocTemplate
HTML document template.protected final boolean
isNowrap()
Prevent word wrap on page.void
parentSerialize
(Object out, Object o) Calls the parentdoSerialize(SerializerPipe, Object)
method which invokes just the HTML serializer.protected JsonMap
Returns the properties on this bean as a map for debugging.Methods inherited from class org.apache.juneau.html.HtmlStrippedDocSerializerSession
create
Methods inherited from class org.apache.juneau.html.HtmlSerializerSession
create, getAnchorText, getHtmlBeanPropertyMeta, getHtmlClassMeta, getHtmlWriter, getLabelParameter, getUriAnchorText, isAddBeanTypes, isAddKeyValueTableHeaders, isDetectLabelParameters, isDetectLinksInStrings, isHtmlMode, isUri, serializeAnything, serializeAnything
Methods inherited from class org.apache.juneau.xml.XmlSerializerSession
create, findNsfMappings, getDefaultNamespace, getNamespaces, getXmlBeanMeta, getXmlBeanPropertyMeta, getXmlClassMeta, getXmlWriter, isAddNamespaceUrisToRoot, isAutoDetectNamespaces, isEnableNamespaces
Methods inherited from class org.apache.juneau.serializer.WriterSerializerSession
create, createPipe, getFileCharset, getMaxIndent, getQuoteChar, getStreamCharset, isUseWhitespace, isWriterSerializer, serialize, serializeToString
Methods inherited from class org.apache.juneau.serializer.SerializerSession
addVarBean, canIgnoreValue, create, createBeanTypeNameProperty, forEachEntry, forEachEntry, generalize, getBeanTypeName, getExpectedRootType, getJavaMethod, getListener, getListener, getResponseHeaders, getSchema, getUriContext, getUriRelativity, getUriResolution, getUriResolver, getVarResolver, handleThrown, isAddRootType, isKeepNullProperties, isSortCollections, isSortMaps, isTrimEmptyCollections, isTrimEmptyMaps, isTrimStrings, onBeanGetterException, onError, push2, relativizeUri, resolve, resolveUri, serialize, sort, sort, sort, swap, toList, toString, trim
Methods inherited from class org.apache.juneau.BeanTraverseSession
getInitialDepth, getLastLocation, getMaxDepth, getOptionalType, getOptionalValue, getStack, isDetectRecursions, isIgnoreRecursions, isOptional, isRoot, pop, push, setCurrentClass, setCurrentProperty, willExceedDepth, willRecurse
Methods inherited from class org.apache.juneau.BeanSession
_class, addWarning, convertToMemberType, convertToMemberType, convertToType, convertToType, convertToType, create, getArgsClassMeta, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionary, getBeanFieldVisibility, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getBeanTypePropertyName, getClassMeta, getClassMeta, getClassMetaForObject, getClassMetaForObject, getLocale, getMediaType, getNamePropertyName, getNotBeanClasses, getNotBeanPackagesNames, getNotBeanPackagesPrefixes, getPropertyNamer, getSwaps, getTimeZone, getTimeZoneId, isBean, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isFindFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnoreMissingSetters, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isSortProperties, isUseEnumNames, isUseInterfaceProxies, isUseJavaBeanIntrospector, newBean, newBean, newBeanMap, newBeanMap, newGenericMap, object, string, toArray, toBeanMap, toBeanMap, toBeanMap
Methods inherited from class org.apache.juneau.ContextSession
checkForWarnings, getContext, getSessionProperties, getWarnings, isDebug, toString
-
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.
-
createDefaultVarResolverSession
Description copied from class:SerializerSession
Adds a session object to theVarResolverSession
in this session.- Overrides:
createDefaultVarResolverSession
in classSerializerSession
- Returns:
- This object.
-
doSerialize
Description copied from class:SerializerSession
Serializes a POJO to the specified pipe.This method should NOT close the context object.
The default implementation of this method simply calls
Serializer.doSerialize(SerializerSession,SerializerPipe,Object)
.- Overrides:
doSerialize
in 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.
-
parentSerialize
Calls the parentdoSerialize(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.
-
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:
-
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:
-
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:
-
forEachWidget
Performs an action on all widgets defined in his session.- Parameters:
action
- The action to perform.- Returns:
- This object.
- See Also:
-
properties
Description copied from class:ContextSession
Returns the properties on this bean as a map for debugging.- Overrides:
properties
in classWriterSerializerSession
- Returns:
- The properties on this bean as a map for debugging.
-