public class XmlObjectBuilder extends Object
Constructor and Description |
---|
XmlObjectBuilder() |
Modifier and Type | Method and Description |
---|---|
XmlObject |
build() |
XmlObjectBuilder |
withAttribute(boolean attribute) |
XmlObjectBuilder |
withName(String name) |
XmlObjectBuilder |
withNamespace(URI namespace) |
XmlObjectBuilder |
withPrefix(String prefix) |
XmlObjectBuilder |
withWrapped(boolean wrapped) |
static XmlObjectBuilder |
xmlObject()
Creates a builder for a
XmlObject |
public XmlObjectBuilder withName(String name)
name
- Replaces the name of the element/attribute used for the described schema property. When defined within items
, it will affect the name of the individual XML elements within the list. When defined alongside type
being array
(outside the items
), it will affect the wrapping element and only if wrapped
is true
. If wrapped
is false
, it will be ignored.public XmlObjectBuilder withNamespace(URI namespace)
namespace
- The URI of the namespace definition. Value MUST be in the form of an absolute URI.public XmlObjectBuilder withPrefix(String prefix)
prefix
- The prefix to be used for the name.public XmlObjectBuilder withAttribute(boolean attribute)
attribute
- Declares whether the property definition translates to an attribute instead of an element. Default value is false.public XmlObjectBuilder withWrapped(boolean wrapped)
wrapped
- MAY be used only for an array definition. Signifies whether the array is wrapped (for example,
<books><book/><book/></books>
) or unwrapped
(<book/><book/>
). Default value is false
. The definition takes
effect only when defined alongside type
being array
(outside the items
).public XmlObject build()
public static XmlObjectBuilder xmlObject()
XmlObject
Copyright © 2017–2019. All rights reserved.