Class CborParser.Builder
- Enclosing class:
- CborParser
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor, default settings.protectedBuilder(CborParser copyFrom) Copy constructor.protectedBuilder(CborParser.Builder copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the object.copy()Copy creator.hashKey()Returns the hashkey of this builder.maxLength(int value) The maximum allowed wire-declared length for CBOR byte/text strings and array/map element counts.Surfaces CBOR semantic tags and simple values as token-level metadata onTokenReadercursors returned byCborParserSession.readTokens(Object).nativeMode(boolean value) Same asnativeMode()but allows you to explicitly specify the value.Methods inherited from class org.apache.juneau.marshall.parser.Parser.Builder
autoCloseStreams, autoCloseStreams, consumes, debugOutputLines, getConsumes, getNulls, listener, nulls, trimStrings, trimStrings, unbuffered, unbufferedMethods 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 parser to copy from.
-
-
Method Details
-
nativeMode
Surfaces CBOR semantic tags and simple values as token-level metadata onTokenReadercursors returned byCborParserSession.readTokens(Object).When enabled, tags accumulate on the cursor's tag stack (visible via
TokenReader.getTagCount()/TokenReader.getTag(int)) and simple values surface their int viaTokenReader.getSimpleValue()onTokenType.VALUE_NULLtokens. When disabled (default), tags are silently unwrapped and simple values collapse toTokenType.VALUE_NULLwith no metadata.This is a token-cursor-level setting and does not affect the high-level POJO databind path (
Parser.read(Object, Class)); that path always discards tags.- Returns:
- This object.
-
nativeMode
Same asnativeMode()but allows you to explicitly specify the value.- Parameters:
value- The value for this setting.- Returns:
- This object.
-
maxLength
The maximum allowed wire-declared length for CBOR byte/text strings and array/map element counts.Guards against malformed or adversarial input where a small payload declares a huge length or element count, which would otherwise trigger
OutOfMemoryError. Malformed lengths are reported as a clean parse error instead.- Parameters:
value- The maximum length. Default is 16 MiB. Values ≤ 0 disable the cap.- Returns:
- This object.
-
build
Description copied from class:Context.BuilderBuild the object.- Overrides:
buildin classInputStreamParser.Builder<CborParser.Builder>- Returns:
- The built object.
-
copy
Description copied from class:Context.BuilderCopy creator.- Specified by:
copyin classInputStreamParser.Builder<CborParser.Builder>- Returns:
- A new mutable copy of this builder.
-
hashKey
Description copied from class:Context.BuilderReturns the hashkey of this builder.Used to return previously instantiated context beans that have matching hashkeys. The
HashKeyobject is suitable for use as a hashmap key of a map of context beans. A context bean is considered equivalent if theHashKey.equals(Object)method is the same.- Overrides:
hashKeyin classParser.Builder<CborParser.Builder>- Returns:
- The hashkey of this builder.
-