Annotation Type XmlConfig
XmlSerializer
, XmlDocSerializer
, and XmlParser
.
Used primarily for specifying bean configuration properties on REST classes and methods.
See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionAdd"_type" properties when needed.Add namespace URLs to the root element.Default namespace.Don't auto-detect namespace usage.Enable support for XML namespaces.Class<? extends XMLEventAllocator>
XML event allocator.String[]
Default namespaces.Preserve root element during generalized parsing.int
Optional rank for this config.Class<? extends XMLReporter>
XML reporter.Class<? extends XMLResolver>
XML resolver.Enable validation.
-
Element Details
-
rank
int rankOptional rank for this config.Can be used to override default ordering and application of config annotations.
- Returns:
- The annotation value.
- Default:
- 0
-
eventAllocator
Class<? extends XMLEventAllocator> eventAllocatorXML event allocator.Associates an
XMLEventAllocator
with this parser.See Also:
- Returns:
- The annotation value.
- Default:
- org.apache.juneau.xml.XmlEventAllocator.Void.class
-
preserveRootElement
Preserve root element during generalized parsing.If
"true" , when parsing into a genericJsonMap
, the map will contain a single entry whose key is the root element name."true" "false" (default)
Notes:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
reporter
Class<? extends XMLReporter> reporterXML reporter.Associates an
XMLReporter
with this parser.Notes:
- Reporters are not copied to new parsers during a clone.
See Also:
- Returns:
- The annotation value.
- Default:
- org.apache.juneau.xml.XmlReporter.Void.class
-
resolver
Class<? extends XMLResolver> resolverXML resolver.Associates an
XMLResolver
with this parser.See Also:
- Returns:
- The annotation value.
- Default:
- org.apache.juneau.xml.XmlResolver.Void.class
-
validating
Enable validation.If
"true" , XML document will be validated.See
XMLInputFactory.IS_VALIDATING
for more info."true" "false" (default)
Notes:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
addBeanTypes
Add"_type" properties when needed.If
"true" , then"_type" properties will be added to beans if their type cannot be inferred through reflection.When present, this value overrides the
Serializer.Builder.addBeanTypes()
setting and is provided to customize the behavior of specific serializers in aSerializerSet
."true" "false" (default)
Notes:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
addNamespaceUrisToRoot
Add namespace URLs to the root element.Use this setting to add
xmlns:x
attributes to the root element for the default and all mapped namespaces."true" "false" (default)
Notes:
-
This setting is ignored if
XmlSerializer.Builder.enableNamespaces()
is not enabled. -
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
disableAutoDetectNamespaces
Don't auto-detect namespace usage.Don't detect namespace usage before serialization.
Used in conjunction with
XmlSerializer.Builder.addNamespaceUrisToRoot()
to reduce the list of namespace URLs appended to the root element to only those that will be used in the resulting document.If disabled, then the data structure will first be crawled looking for namespaces that will be encountered before the root element is serialized.
This setting is ignored if
XmlSerializer.Builder.enableNamespaces()
is not enabled."true" "false" (default)
Notes:
-
Auto-detection of namespaces can be costly performance-wise.
In high-performance environments, it's recommended that namespace detection be disabled, and that namespaces be manually defined through theXmlSerializer.Builder.namespaces(Namespace...)
property. -
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
defaultNamespace
Default namespace.Specifies the default namespace URI for this document.
Notes:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
Supports VarResolver.DEFAULT (e.g.
-
enableNamespaces
Enable support for XML namespaces.If not enabled, XML output will not contain any namespaces regardless of any other settings.
"true" "false" (default)
Notes:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- ""
-
namespaces
Default namespaces.The default list of namespaces associated with this serializer.
Notes:
-
Supports VarResolver.DEFAULT (e.g.
"$C{myConfigVar}" ).
See Also:
- Returns:
- The annotation value.
- Default:
- {}
-
Supports VarResolver.DEFAULT (e.g.
-