Class Xml


@Bean(properties="name,namespace,prefix,attribute,wrapped,*") public class Xml extends OpenApiElement
A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are not inferred (for singular/plural forms) and the name property should be used to add that information.
  • Constructor Details

    • Xml

      public Xml()
      Default constructor.
    • Xml

      public Xml(Xml copyFrom)
      Copy constructor.
      Parameters:
      copyFrom - The object to copy.
  • Method Details

    • copy

      public Xml copy()
      Make a deep copy of this object.
      Returns:
      A deep copy of this object.
    • getName

      public String getName()
      Bean property getter: name.

      Replaces the name of the element/attribute used for the described schema property.

      When defined within the Items Object (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.

      Returns:
      The property value, or null if it is not set.
    • setName

      public Xml setName(String value)
      Bean property setter: name.

      Replaces the name of the element/attribute used for the described schema property.

      When defined within the Items Object (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.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • getNamespace

      public String getNamespace()
      Bean property getter: namespace.

      The URL of the namespace definition. Value SHOULD be in the form of a URL.

      Returns:
      The property value, or null if it is not set.
    • setNamespace

      public Xml setNamespace(String value)
      Bean property setter: namespace.

      The URL of the namespace definition. Value SHOULD be in the form of a URL.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • getPrefix

      public String getPrefix()
      Bean property getter: prefix.

      The prefix to be used for the name.

      Returns:
      The property value, or null if it is not set.
    • setPrefix

      public Xml setPrefix(String value)
      Bean property setter: prefix.

      The prefix to be used for the name.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • getAttribute

      Bean property getter: attribute.

      Declares whether the property definition translates to an attribute instead of an element.

      Returns:
      The property value, or null if it is not set.
    • setAttribute

      public Xml setAttribute(Boolean value)
      Bean property setter: attribute.

      Declares whether the property definition translates to an attribute instead of an element.

      Parameters:
      value - The new value for this property.
      Default value is false.
      Can be null to unset the property.
      Returns:
      This object
    • getWrapped

      public Boolean getWrapped()
      Bean property getter: 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/>).
      The definition takes effect only when defined alongside type being array (outside the items).

      Returns:
      The property value, or null if it is not set.
    • setWrapped

      public Xml setWrapped(Boolean value)
      Bean property setter: 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/>).
      The definition takes effect only when defined alongside type being array (outside the items).

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • get

      public <T> T get(String property, Class<T> type)
      Description copied from class: OpenApiElement
      Generic property getter.

      Can be used to retrieve non-standard Swagger fields such as "$ref".

      Overrides:
      get in class OpenApiElement
      Type Parameters:
      T - The datatype to cast the value to.
      Parameters:
      property - The property name to retrieve.
      type - The datatype to cast the value to.
      Returns:
      The property value, or null if the property does not exist or is not set.
    • set

      public Xml set(String property, Object value)
      Description copied from class: OpenApiElement
      Generic property setter.

      Can be used to set non-standard Swagger fields such as "$ref".

      Overrides:
      set in class OpenApiElement
      Parameters:
      property - The property name to set.
      value - The new value for the property.
      Returns:
      This object
    • keySet

      public Set<String> keySet()
      Description copied from class: OpenApiElement
      Returns all the keys on this element.
      Overrides:
      keySet in class OpenApiElement
      Returns:
      All the keys on this element.
      Never null.