Class LocalizedStringLoadingOptions
The byte limit applies to Path and InputStream inputs. The UTF-16 code-unit
limit applies to Reader inputs, whose original byte representation is not available to Lokalized. The
localized strings file-count, translation-node, and warning limits apply to every load, including single-resource
parse(...) operations. The discovery-entry limit separately bounds resources, filesystem children, JAR
entries, and classpath roots examined before candidate resources are parsed; it does not apply to explicit
single-resource parsing or explicit locale-to-resource maps, which enumerate no candidates. The aggregate byte
limit also applies to path and input-stream parsing; it cannot apply to a Reader because the original
byte representation is unavailable.
The translation-node limit bounds parsed model structure; the byte and character limits separately bound the
localized strings file text containing that structure.
Exhaustive classpath searching is disabled by default because it inspects every filesystem and JAR root visible to
a classloader. Enable it only when localized strings are packaged in a JAR that omits directory entries and ordinary
ClassLoader.getResources(String) discovery therefore cannot find the requested package.
- Since:
- 3.0.0
- Author:
- Mark Allen
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionWhether exhaustive classpath-root searching is enabled by default: false.Default maximum number of discovery entries examined by one filesystem or classpath load: 100,000.Default maximum read from one localized strings resource: 8,388,608 bytes (8 MiB).Default maximum JSON object/array nesting depth: 64.Default maximum number of localized strings files accepted by one load: 256.Default maximum read from oneReader: 8,388,608 UTF-16 code units.Default maximum total read by one load: 33,554,432 bytes (32 MiB).Default maximum translation nodes accepted by one load: 100,000.Default maximum number of warnings emitted by one load: 1,000.Highest configurable discovery-entry limit supported by the loader: 1,000,000.Highest configurable JSON nesting depth supported by the loader: 128. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder initialized with the default limits.defaults()Gets the default loading options.booleanGets the maximum number of entries examined while discovering filesystem or classpath resources.Gets the maximum bytes accepted from a path or input stream.Gets the maximum JSON object/array nesting depth.Gets the maximum localized strings files accepted by one load.Gets the maximum UTF-16 code units accepted from a reader.Gets the maximum total bytes accepted by one filesystem, classpath, path, or input-stream load.Gets the maximum translation nodes accepted by one load.Gets the maximum warnings emitted by one load.inthashCode()Reports whether classpath loading should inspect every filesystem and JAR root visible to the classloader after ordinary package-resource discovery.Creates a builder initialized from this instance.toString()
-
Field Details
-
DEFAULT_MAXIMUM_INPUT_BYTES
Default maximum read from one localized strings resource: 8,388,608 bytes (8 MiB). -
DEFAULT_MAXIMUM_READER_CHARACTERS
Default maximum read from oneReader: 8,388,608 UTF-16 code units. -
DEFAULT_MAXIMUM_JSON_NESTING_DEPTH
Default maximum JSON object/array nesting depth: 64. -
DEFAULT_EXHAUSTIVE_CLASSPATH_SEARCH
Whether exhaustive classpath-root searching is enabled by default: false. -
MAXIMUM_JSON_NESTING_DEPTH
Highest configurable JSON nesting depth supported by the loader: 128. -
DEFAULT_MAXIMUM_TOTAL_INPUT_BYTES
Default maximum total read by one load: 33,554,432 bytes (32 MiB). -
DEFAULT_MAXIMUM_LOCALIZED_STRINGS_FILES
Default maximum number of localized strings files accepted by one load: 256. -
DEFAULT_MAXIMUM_TRANSLATION_NODES
Default maximum translation nodes accepted by one load: 100,000. Translation nodes comprise root entries, whole-message alternatives, placeholder definitions, and expression-fragment alternatives. -
DEFAULT_MAXIMUM_WARNINGS
Default maximum number of warnings emitted by one load: 1,000. -
DEFAULT_MAXIMUM_DISCOVERY_ENTRIES
Default maximum number of discovery entries examined by one filesystem or classpath load: 100,000. -
MAXIMUM_DISCOVERY_ENTRIES
Highest configurable discovery-entry limit supported by the loader: 1,000,000.
-
-
Method Details
-
defaults
Gets the default loading options.- Returns:
- the default immutable options, not null
-
builder
Creates a builder initialized with the default limits.- Returns:
- a new builder, not null
-
toBuilder
Creates a builder initialized from this instance.- Returns:
- a builder initialized from this instance, not null
-
getMaximumInputBytes
Gets the maximum bytes accepted from a path or input stream.- Returns:
- the maximum bytes accepted from a path or input stream
-
getMaximumReaderCharacters
Gets the maximum UTF-16 code units accepted from a reader.- Returns:
- the maximum UTF-16 code units accepted from a reader
-
getMaximumJsonNestingDepth
Gets the maximum JSON object/array nesting depth.- Returns:
- the maximum JSON object/array nesting depth
-
isExhaustiveClasspathSearchEnabled
Reports whether classpath loading should inspect every filesystem and JAR root visible to the classloader after ordinary package-resource discovery.- Returns:
- true when exhaustive classpath-root searching is enabled
-
getMaximumTotalInputBytes
Gets the maximum total bytes accepted by one filesystem, classpath, path, or input-stream load. This limit does not apply to reader input because its original byte representation is unavailable.- Returns:
- the aggregate byte limit, not null
-
getMaximumLocalizedStringsFiles
Gets the maximum localized strings files accepted by one load.- Returns:
- the maximum localized strings files accepted by one load, not null
-
getMaximumTranslationNodes
Gets the maximum translation nodes accepted by one load. Translation nodes comprise root entries, whole-message alternatives, placeholder definitions, and expression-fragment alternatives.- Returns:
- the aggregate translation-node limit, not null
-
getMaximumWarnings
Gets the maximum warnings emitted by one load.- Returns:
- the maximum warnings emitted by one load, not null
-
getMaximumDiscoveryEntries
Gets the maximum number of entries examined while discovering filesystem or classpath resources. Entries include direct filesystem children, package-resource locations, physical JAR entries, classpath-root candidates, and manifestClass-Pathentries. This budget is independent of parsed-resource and input-size limits.- Returns:
- the discovery-entry limit, not null
-
equals
-
hashCode
-
toString
-