Class SeoMixin.Builder
java.lang.Object
org.apache.juneau.rest.server.AbstractRestBuilder<R,SELF>
org.apache.juneau.rest.server.servlet.RestMixin.Builder<SeoMixin,SeoMixin.Builder>
org.apache.juneau.rest.server.convention.SeoMixin.Builder
- All Implemented Interfaces:
RestBuilder<SeoMixin.Builder>
- Enclosing class:
- SeoMixin
Builder for
SeoMixin instances.
Extends RestMixin.Builder so the mixin's bespoke robots/sitemap setters chain
with true covariant returns alongside the inherited RestBuildersurface (e.g. path,
roleGuard).
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor — package access forSeoMixin.create(). -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aSeoMixininstance.robotsAllow(String userAgent, String... paths) Adds anAllowrule to the robots policy.robotsDisallow(String userAgent, String... paths) Adds aDisallowrule to the robots policy.Sets a fully-formedrobots.txtbody, overriding any rule-builder calls.sitemapEntry(String url) Adds a sitemap entry with only thelocURL.sitemapEntry(String url, ZonedDateTime lastmod, String changefreq, Double priority) Adds a sitemap entry with optionallastmod,changefreq, andprioritycomponents.Methods inherited from class org.apache.juneau.rest.server.AbstractRestBuilder
allowedHeaderParams, allowedMethodHeaders, allowedMethodParams, allowedParserOptions, allowedSerializerOptions, asyncCompletionExecutor, asyncTimeoutMillis, children, clientVersionHeader, config, consumes, converters, createResource, debugMarshalling, defaultAccept, defaultCharset, defaultContentType, defaultRequestAttributes, defaultRequestHeaders, defaultResponseHeaders, description, disableContentParam, eagerInit, encoders, getExtras, getMdcAsyncPropagation, getResourceType, guards, lazyChildren, maxInput, mdcAsyncPropagation, messages, mixinDefs, mixins, noInherit, observability, openApiProvider, parsers, partParser, partSerializer, path, paths, problemDetails, produces, renderResponseStackTraces, responseProcessors, restOpArgs, roleGuard, rolesDeclared, self, serializers, set, siteName, staticFiles, swaggerProvider, title, toRestAnnotation, uriAuthority, uriContext, uriRelativity, uriResolution, virtualThreads
-
Constructor Details
-
Builder
protected Builder()Constructor — package access forSeoMixin.create().
-
-
Method Details
-
robotsAllow
Adds anAllowrule to the robots policy.Multiple invocations append rules in order. The first call to either
robotsAllow(...)orrobotsDisallow(...)replaces the deny-all default; subsequent calls continue to append.- Parameters:
userAgent- The user agent (e.g."*"or"Googlebot"). Must not benull or blank.paths- Allowed path prefixes (e.g."/"). At least one path is required.- Returns:
- This object.
-
robotsDisallow
Adds aDisallowrule to the robots policy.- Parameters:
userAgent- The user agent (e.g."*"). Must not benull or blank.paths- Disallowed path prefixes. At least one path is required.- Returns:
- This object.
-
robotsTxt
Sets a fully-formedrobots.txtbody, overriding any rule-builder calls.Useful when the desired policy doesn't fit the simple
allow/disallow/per-user-agent shape ofrobotsAllow(...)/robotsDisallow(...)(e.g. when includingSitemap:orCrawl-delay:directives).- Parameters:
value- The fullrobots.txtbody. Must not benull .- Returns:
- This object.
-
sitemapEntry
Adds a sitemap entry with only thelocURL.- Parameters:
url- The fully-qualified URL.- Returns:
- This object.
-
sitemapEntry
public SeoMixin.Builder sitemapEntry(String url, ZonedDateTime lastmod, String changefreq, Double priority) Adds a sitemap entry with optionallastmod,changefreq, andprioritycomponents.- Parameters:
url- The fully-qualified URL.lastmod- The last-modified instant (ornull to omit).changefreq- Change-frequency hint (e.g."weekly","daily"; ornull to omit).priority- Priority value 0.0..1.0 (ornull to omit).- Returns:
- This object.
-
build
Builds aSeoMixininstance.- Overrides:
buildin classRestMixin.Builder<SeoMixin,SeoMixin.Builder> - Returns:
- A configured instance.
-