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 ClassesNested 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
ConstructorsModifierConstructorDescriptionprotectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptioncreate(HtmlDocSerializer ctx) Creates a new builder for this object.protected VarResolverSessionAdds a session object to theVarResolverSessionin this session.protected voiddoSerialize(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.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 parentdoSerialize(SerializerPipe, Object)method which invokes just the HTML serializer.Returns the properties on this bean as a map for debugging.Methods inherited from class org.apache.juneau.html.HtmlStrippedDocSerializerSession
createMethods inherited from class org.apache.juneau.html.HtmlSerializerSession
create, getAnchorText, getHtmlBeanPropertyMeta, getHtmlClassMeta, getHtmlWriter, getLabelParameter, getUriAnchorText, isAddBeanTypes, isAddKeyValueTableHeaders, isDetectLabelParameters, isDetectLinksInStrings, isHtmlMode, isUri, serializeAnything, serializeAnythingMethods inherited from class org.apache.juneau.xml.XmlSerializerSession
create, findNsfMappings, getDefaultNamespace, getNamespaces, getXmlBeanMeta, getXmlBeanPropertyMeta, getXmlClassMeta, getXmlWriter, isAddJsonTags, isAddNamespaceUrisToRoot, isAutoDetectNamespaces, isEnableNamespacesMethods inherited from class org.apache.juneau.serializer.WriterSerializerSession
create, createPipe, getFileCharset, getMaxIndent, getQuoteChar, getStreamCharset, isUseWhitespace, isWriterSerializer, serialize, serializeToStringMethods 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, trimMethods inherited from class org.apache.juneau.BeanTraverseSession
getInitialDepth, getLastLocation, getMaxDepth, getOptionalType, getOptionalValue, getStack, isDetectRecursions, isIgnoreRecursions, isOptional, isRoot, pop, push, setCurrentClass, setCurrentProperty, willExceedDepth, willRecurseMethods inherited from class org.apache.juneau.BeanSession
addWarning, convertToMemberType, convertToMemberType, convertToType, convertToType, convertToType, create, getAnnotationProvider, getArgsClassMeta, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionary, getBeanFieldVisibility, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getBeanTypePropertyName, getClassMeta, getClassMeta, getClassMetaForObject, getClassMetaForObject, getLocale, getMediaType, getNamePropertyName, getNotBeanClasses, getNotBeanPackagesNames, 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, toBeanMapMethods 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.
-
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.
-
createDefaultVarResolverSession
Description copied from class:SerializerSessionAdds a session object to theVarResolverSessionin this session.- Overrides:
createDefaultVarResolverSessionin classSerializerSession- Returns:
- This object.
-
doSerialize
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.doSerialize(SerializerSession,SerializerPipe,Object).- Overrides:
doSerializein 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:
-
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.
-