Class LocalizedStringLoadingOptions.Builder
java.lang.Object
com.lokalized.LocalizedStringLoadingOptions.Builder
- Enclosing class:
LocalizedStringLoadingOptions
Builder for
LocalizedStringLoadingOptions.- Since:
- 3.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds immutable loading options.exhaustiveClasspathSearch(@NonNull Boolean exhaustiveClasspathSearch) Controls whether classpath loading should inspect every filesystem and JAR root visible to the classloader when ordinary package-resource discovery is insufficient.maximumDiscoveryEntries(@NonNull Integer maximumDiscoveryEntries) Sets the maximum number of entries examined while discovering filesystem or classpath resources.maximumInputBytes(@NonNull Integer maximumInputBytes) Sets the maximum bytes accepted from a path or input stream.maximumJsonNestingDepth(@NonNull Integer maximumJsonNestingDepth) Sets the maximum JSON object/array nesting depth.maximumLocalizedStringsFiles(@NonNull Integer maximumLocalizedStringsFiles) Sets the maximum localized strings files accepted by one load.maximumReaderCharacters(@NonNull Integer maximumReaderCharacters) Sets the maximum UTF-16 code units accepted from a reader.maximumTotalInputBytes(@NonNull Long maximumTotalInputBytes) Sets the maximum total bytes accepted by one filesystem, classpath, path, or input-stream load.maximumTranslationNodes(@NonNull Integer maximumTranslationNodes) Sets the maximum translation nodes accepted by one load.maximumWarnings(@NonNull Integer maximumWarnings) Sets the maximum warnings emitted by one load.
-
Method Details
-
maximumInputBytes
public @NonNull LocalizedStringLoadingOptions.Builder maximumInputBytes(@NonNull Integer maximumInputBytes) Sets the maximum bytes accepted from a path or input stream.- Parameters:
maximumInputBytes- positive byte limit, at mostInteger.MAX_VALUE- 1- Returns:
- this builder, not null
-
maximumReaderCharacters
public @NonNull LocalizedStringLoadingOptions.Builder maximumReaderCharacters(@NonNull Integer maximumReaderCharacters) Sets the maximum UTF-16 code units accepted from a reader.- Parameters:
maximumReaderCharacters- positive UTF-16 code-unit limit- Returns:
- this builder, not null
-
maximumJsonNestingDepth
public @NonNull LocalizedStringLoadingOptions.Builder maximumJsonNestingDepth(@NonNull Integer maximumJsonNestingDepth) Sets the maximum JSON object/array nesting depth.- Parameters:
maximumJsonNestingDepth- nesting limit from 1 throughLocalizedStringLoadingOptions.MAXIMUM_JSON_NESTING_DEPTH- Returns:
- this builder, not null
-
exhaustiveClasspathSearch
public @NonNull LocalizedStringLoadingOptions.Builder exhaustiveClasspathSearch(@NonNull Boolean exhaustiveClasspathSearch) Controls whether classpath loading should inspect every filesystem and JAR root visible to the classloader when ordinary package-resource discovery is insufficient. This is disabled by default to avoid sweeping unrelated dependencies. It is primarily useful for JARs that omit directory entries.- Parameters:
exhaustiveClasspathSearch- true to enable exhaustive classpath-root searching- Returns:
- this builder, not null
-
maximumTotalInputBytes
public @NonNull LocalizedStringLoadingOptions.Builder maximumTotalInputBytes(@NonNull Long maximumTotalInputBytes) Sets 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.- Parameters:
maximumTotalInputBytes- positive aggregate byte limit, not null- Returns:
- this builder, not null
-
maximumLocalizedStringsFiles
public @NonNull LocalizedStringLoadingOptions.Builder maximumLocalizedStringsFiles(@NonNull Integer maximumLocalizedStringsFiles) Sets the maximum localized strings files accepted by one load.- Parameters:
maximumLocalizedStringsFiles- positive localized strings file limit, not null- Returns:
- this builder, not null
-
maximumTranslationNodes
public @NonNull LocalizedStringLoadingOptions.Builder maximumTranslationNodes(@NonNull Integer maximumTranslationNodes) Sets the maximum translation nodes accepted by one load. Translation nodes comprise root entries, whole-message alternatives, placeholder definitions, and expression-fragment alternatives.- Parameters:
maximumTranslationNodes- nonnegative translation-node limit, not null- Returns:
- this builder, not null
-
maximumWarnings
public @NonNull LocalizedStringLoadingOptions.Builder maximumWarnings(@NonNull Integer maximumWarnings) Sets the maximum warnings emitted by one load.- Parameters:
maximumWarnings- nonnegative warning limit, not null- Returns:
- this builder, not null
-
maximumDiscoveryEntries
public @NonNull LocalizedStringLoadingOptions.Builder maximumDiscoveryEntries(@NonNull Integer maximumDiscoveryEntries) Sets the maximum number of entries examined while discovering filesystem or classpath resources. This budget is charged before filename and package filtering so irrelevant entries cannot cause unbounded discovery work.- Parameters:
maximumDiscoveryEntries- positive discovery-entry limit, at mostLocalizedStringLoadingOptions.MAXIMUM_DISCOVERY_ENTRIES- Returns:
- this builder, not null
-
build
Builds immutable loading options.- Returns:
- immutable loading options, not null
-