Class HtmlSchemaDocSerializer.Builder
- Enclosing class:
- HtmlSchemaDocSerializer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor, default settings.protectedBuilder(HtmlSchemaDocSerializer copyFrom) Copy constructor.protectedBuilder(HtmlSchemaDocSerializer.Builder copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddDescriptionsTo(TypeCategory... values) HtmlSchemaSerializer configuration property: Add descriptions.addExamplesTo(TypeCategory... values) HtmlSchemaSerializer configuration property: Add examples.HtmlSchemaSerializer configuration property: Allow nested descriptions.HtmlSchemaSerializer configuration property: Allow nested examples.beanDefMapper(Class<? extends MarshallingDefMapper> value) HtmlSchemaSerializer configuration property: Schema definition mapper.build()Build the object.copy()Copy creator.HtmlSchemaSerializer configuration property: Use bean definitions.widgets(Class<? extends HtmlWidget>... values) HTML Widgets.Methods inherited from class org.apache.juneau.marshall.html.HtmlDocSerializer.Builder
aside, aside, asideFloat, footer, footer, hashKey, head, head, header, header, nav, nav, navlinks, navlinks, noResultsMessage, nowrap, nowrap, resolveBodyVars, resolveBodyVars, script, script, style, style, stylesheet, stylesheet, template, widgetsMethods inherited from class org.apache.juneau.marshall.html.HtmlSerializer.Builder
addBeanTypesHtml, addBeanTypesHtml, addKeyValueTableHeaders, addKeyValueTableHeaders, disableDetectLabelParameters, disableDetectLabelParameters, disableDetectLinksInStrings, disableDetectLinksInStrings, labelParameter, uriAnchorTextMethods inherited from class org.apache.juneau.marshall.xml.XmlSerializer.Builder
addBeanTypesXml, addBeanTypesXml, addNamespaceUrisToRoot, addNamespaceUrisToRoot, defaultNamespace, disableAutoDetectNamespaces, disableAutoDetectNamespaces, disableJsonTags, disableJsonTags, enableNamespaces, enableNamespaces, namespaces, ns, textNodeDelimiterMethods inherited from class org.apache.juneau.marshall.serializer.WriterSerializer.Builder
maxIndent, quoteChar, quoteCharOverride, sq, streamCharset, useWhitespace, useWhitespace, wsMethods inherited from class org.apache.juneau.marshall.serializer.Serializer.Builder
accept, addBeanTypes, addBeanTypes, addRootType, addRootType, getAccept, getProduces, keepNullProperties, keepNullProperties, listener, nonDefault, nonDefault, produces, sortCollections, sortCollections, sortMaps, sortMaps, trimEmptyCollections, trimEmptyCollections, trimEmptyMaps, trimEmptyMaps, trimStrings, trimStrings, uriContext, uriRelativity, uriResolutionMethods inherited from class org.apache.juneau.marshall.MarshallingTraverseContext.Builder
detectRecursions, detectRecursions, ignoreRecursions, ignoreRecursions, initialDepth, maxDepthMethods inherited from class org.apache.juneau.marshall.MarshallingContextable.Builder
activeView, annotations, beanClassVisibility, beanConstructorVisibility, beanDictionary, beanFieldVisibility, beanInterceptor, beanMapPutReturnsOldValue, beanMethodVisibility, beanProperties, beanProperties, beanProperties, beanPropertiesExcludes, beanPropertiesExcludes, beanPropertiesExcludes, beanPropertiesReadOnly, beanPropertiesReadOnly, beanPropertiesReadOnly, beanPropertiesWriteOnly, beanPropertiesWriteOnly, beanPropertiesWriteOnly, beansRequireDefaultConstructor, beansRequireSerializable, beansRequireSettersForGetters, bigNumberFormat, binaryFormat, bitSetFormat, booleanFormat, calendarFormat, classFormat, classLoader, currencyFormat, dateFormat, debug, dictionaryOn, disableBeansRequireSomeProperties, disableDefaultViewInclusion, disableIgnoreMissingSetters, disableIgnoreTransientFields, disableIgnoreUnknownNullBeanProperties, disableInterfaceProxies, durationFormat, enumFormat, example, example, findFluentSetters, findFluentSetters, floatFormat, ignoreInvocationExceptionsOnGetters, ignoreInvocationExceptionsOnSetters, ignoreUnknownBeanProperties, ignoreUnknownEnumValues, implClass, implClasses, interfaceClass, interfaces, locale, localeFormat, marshallingContext, marshallingContext, marshallingContext, marshallingContext, mediaType, notBeanClasses, notBeanPackages, periodFormat, propertyNamer, propertyNamer, recordComponentOrder, stopClass, swap, swap, swaps, swaps, temporalFormat, timeZone, timeZoneFormat, typeName, typePropertyName, typePropertyName, unsortedProperties, unsortedProperties, useJavaBeanIntrospector, uuidFormat, validateSchema, validateSchemaMethods inherited from class org.apache.juneau.marshall.Context.Builder
annotations, apply, applyAnnotations, applyAnnotations, asSubtype, build, cache, canApply, copyOrNull, debug, getApplied, getType, impl, isDebug, registerBuilders, self, type
-
Constructor Details
-
Builder
protected Builder()Constructor, default settings. -
Builder
Copy constructor.- Parameters:
copyFrom- The builder to copy from.
-
Builder
Copy constructor.- Parameters:
copyFrom- The bean to copy from.
-
-
Method Details
-
addDescriptionsTo
HtmlSchemaSerializer configuration property: Add descriptions.Identifies which categories of types that descriptions should be automatically added to generated schemas.
The description is the result of calling
ClassInfo.getName().See Also:
- Parameters:
values- The values to add to this setting.
The default is an empty string.- Returns:
- This object.
-
addExamplesTo
HtmlSchemaSerializer configuration property: Add examples.Identifies which categories of types that examples should be automatically added to generated schemas.
The examples come from calling
ClassMeta.getExample(MarshallingSession,JsonParserSession)which in turn gets examples from the following:See Also:
- Parameters:
values- The values to add to this setting.
The default is an empty string.- Returns:
- This object.
-
allowNestedDescriptions
HtmlSchemaSerializer configuration property: Allow nested descriptions.Identifies whether nested descriptions are allowed in schema definitions.
See Also:
- Returns:
- This object.
-
allowNestedExamples
HtmlSchemaSerializer configuration property: Allow nested examples.Identifies whether nested examples are allowed in schema definitions.
See Also:
- Returns:
- This object.
-
beanDefMapper
HtmlSchemaSerializer configuration property: Schema definition mapper.Interface to use for converting Bean classes to definition IDs and URIs.
Used primarily for defining common definition sections for beans in Swagger JSON.
This setting is ignored if
JsonSchemaGenerator.Builder#useBeanDefs()is not enabled.See Also:
- Parameters:
value- The new value for this property.
The default isBasicBeanDefMapper.- Returns:
- This object.
-
build
Description copied from class:Context.BuilderBuild the object.- Overrides:
buildin classHtmlDocSerializer.Builder<HtmlSchemaDocSerializer.Builder>- Returns:
- The built object.
-
copy
Description copied from class:Context.BuilderCopy creator.- Specified by:
copyin classHtmlDocSerializer.Builder<HtmlSchemaDocSerializer.Builder>- Returns:
- A new mutable copy of this builder.
-
useBeanDefs
HtmlSchemaSerializer configuration property: Use bean definitions.When enabled, schemas on beans will be serialized as the following:
{ type:
'object' ,'$ref' :'#/definitions/TypeId' }- Returns:
- This object.
-
widgets
Description copied from class:HtmlDocSerializer.BuilderHTML Widgets.Defines widgets that can be used in conjunction with string variables of the form
"$W{name}" to quickly generate arbitrary replacement text. Widgets resolve the following variables:"$W{name}" - Contents returned byHtmlWidget.getHtml(VarResolverSession)."$W{name.script}" - Contents returned byHtmlWidget.getScript(VarResolverSession).
The script contents are automatically inserted into the<head/script> section in the HTML page."$W{name.style}" - Contents returned byHtmlWidget.getStyle(VarResolverSession).
The styles contents are automatically inserted into the<head/style> section in the HTML page.
The following examples shows how to associate a widget with a REST method and then have it rendered in the links and aside section of the page:
WriterSerializer
serializer = HtmlDocSerializer .create () .widgets( MyWidget.class ) .navlinks("$W{MyWidget}" ) .aside("Check out this widget: $W{MyWidget}" ) .build();Notes:
- Widgets are inherited from super classes, but can be overridden by reusing the widget name.
See Also:
- Overrides:
widgetsin classHtmlDocSerializer.Builder<HtmlSchemaDocSerializer.Builder>- Parameters:
values- The values to add to this setting.- Returns:
- This object.
-