FeedLimits

The bounds a FeedParser applies to a document. Stable Core. Built with FeedLimits { maxEntries = 200 }, or derived with FeedLimits(from) { … }; every member can only be tightened: a value above its default or below its floor is refused when the limits are built, so the generous side stays the safe one and a default can be relied on as an upper bound.

MemberDefaultFloorExceeding it
maxEntries1,0001the parse fails with LimitExceeded(Entries)
maxTextChars262,14416text is cut at that many UTF-16 units, never inside a surrogate pair
maxIdChars2,04850an id falls back from the guid to the link to the digest; the digest id is always 50 characters
maxLinkChars8,00032the link is null
maxCategoriesPerEntry320further categories are dropped
maxEnclosuresPerEntry80further enclosures are dropped
maxDepth2564the parse fails with LimitExceeded(Depth)
maxAttributesPerElement1004the parse fails with LimitExceeded(Attributes); namespace declarations count as attributes
maxElements100,00016the parse fails with LimitExceeded(Elements)
maxNamespaceUris642the parse fails with LimitExceeded(NamespaceUris); it counts distinct URIs, not declarations

A floor keeps a setting from disabling the parser by mistake; it does not promise that any document parses. The document itself is bounded by the transport's decoded-body cap (2 MiB under an Untrusted policy). Equality is on all ten members; toString() prints them.

Types

Link copied to clipboard

Collects the members of a FeedLimits, seeded from the value the factory was given. Not thread-safe; use it only inside the factory's lambda.

Link copied to clipboard
object Companion

The defaults, as constants and as a value.

Properties

Link copied to clipboard

The most attributes on one element, namespace declarations included; more fail the parse.

Link copied to clipboard

The most categories kept per entry.

Link copied to clipboard

The deepest element nesting; deeper fails the parse.

Link copied to clipboard

The most elements in a document; more fail the parse.

Link copied to clipboard

The most enclosures kept per entry.

Link copied to clipboard

The most entries a document may hold; more fail the parse.

Link copied to clipboard

The most UTF-16 units of a guid or link for it to serve as the id; a longer one falls back.

Link copied to clipboard

The most UTF-16 units of a link; a longer one is null.

Link copied to clipboard

The most distinct namespace URIs in a document; more fail the parse.

Link copied to clipboard

The most UTF-16 units of any text field; longer text is cut.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code consistent with equals: it is computed from the same properties.

Link copied to clipboard
open override fun toString(): String

A diagnostic string for logs: all ten limits. Its format is not part of the API and may change.