Class XmlParser.Builder<SELF extends XmlParser.Builder<SELF>>
- Direct Known Subclasses:
HtmlParser.Builder,XmlParser.DefaultBuilder
- Enclosing class:
- XmlParser
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor, default settings.protectedCopy constructor.protectedBuilder(XmlParser.Builder<?> copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the object.abstract SELFcopy()Copy creator.eventAllocator(Class<? extends XMLEventAllocator> value) XML event allocator.hashKey()Returns the hashkey of this builder.Preserve root element during generalized parsing.preserveRootElement(boolean value) Same aspreserveRootElement()but allows you to explicitly specify the value.reporter(Class<? extends XMLReporter> value) XML reporter.resolver(Class<? extends XMLResolver> value) XML resolver.Enable validation.validating(boolean value) Same asvalidating()but allows you to explicitly specify the value.Methods inherited from class org.apache.juneau.marshall.parser.ReaderParser.Builder
streamCharsetMethods 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.
Cannot benull .
-
Builder
Copy constructor.- Parameters:
copyFrom- The bean to copy from.
Cannot benull .
-
-
Method Details
-
build
Description copied from class:Context.BuilderBuild the object.- Overrides:
buildin classReaderParser.Builder<SELF extends XmlParser.Builder<SELF>>- Returns:
- The built object.
-
copy
Description copied from class:Context.BuilderCopy creator.- Specified by:
copyin classReaderParser.Builder<SELF extends XmlParser.Builder<SELF>>- Returns:
- A new mutable copy of this builder.
-
eventAllocator
XML event allocator.Associates an
XMLEventAllocatorwith this parser.- Parameters:
value- The new value for this property.
Can benull (no event allocator will be used).- Returns:
- This object.
-
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 classReaderParser.Builder<SELF extends XmlParser.Builder<SELF>>- Returns:
- The hashkey of this builder.
-
preserveRootElement
Preserve root element during generalized parsing.When enabled, when parsing into a generic
JsonMap, the map will contain a single entry whose key is the root element name.Example:
// Parser with preserve-root-element. ReaderParserparser1 = XmlParser .create () .preserveRootElement() .build();// Parser without preserve-root-element (the default behavior). ReaderParserparser2 = XmlParser .create () .build(); Stringxml ="<root><a>foobar</a></root>" ;// Produces: "{ root: { a:'foobar' }}" JsonMapmap1 =parser1 .read(xml , JsonMap.class );// Produces: "{ a:'foobar' }" JsonMapmap2 =parser2 .read(xml , JsonMap.class );- Returns:
- This object.
-
preserveRootElement
Same aspreserveRootElement()but allows you to explicitly specify the value.- Parameters:
value- The value for this setting.- Returns:
- This object.
-
reporter
XML reporter.Associates an
XMLReporterwith this parser.- Parameters:
value- The new value for this property.
Can benull (no reporter will be used).- Returns:
- This object.
-
resolver
XML resolver.Associates an
XMLResolverwith this parser.- Parameters:
value- The new value for this property.
Can benull (no resolver will be used).- Returns:
- This object.
-
validating
Enable validation.If
true , XML document will be validated.See
XMLInputFactory.IS_VALIDATINGfor more info.- Returns:
- This object.
-
validating
Same asvalidating()but allows you to explicitly specify the value.- Parameters:
value- The value for this setting.- Returns:
- This object.
-