org.apache.juneau.dto.swagger.Xml Maven / Gradle / Ivy
// ***************************************************************************************************************************
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
package org.apache.juneau.dto.swagger;
import org.apache.juneau.annotation.*;
/**
* 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.
*
*
Additional Information
*
* -
* Juneau Data Transfer Objects
* (org.apache.juneau.dto)
*
* -
* Swagger
*
*
* -
* org.apache.juneau.dto.swagger
*
*
*/
@Bean(properties="name,namespace,prefix,attribute,wrapped")
public class Xml extends SwaggerElement {
private String name;
private String namespace;
private String prefix;
private Boolean attribute;
private Boolean wrapped;
/**
* 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.
*
* @return The value of the name property on this bean, or null if it is not set.
*/
public String getName() {
return name;
}
/**
* 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.
*
* @param name The new value for the name property on this bean.
* @return This object (for method chaining).
*/
public Xml setName(String name) {
this.name = name;
return this;
}
/**
* Synonym for {@link #setName(String)}.
*
* @param name The new value for the name property on this bean.
* @return This object (for method chaining).
*/
public Xml name(String name) {
return setName(name);
}
/**
* Bean property getter: namespace .
*
*
* The URL of the namespace definition. Value SHOULD be in the form of a URL.
*
* @return The value of the namespace property on this bean, or null if it is not set.
*/
public String getNamespace() {
return namespace;
}
/**
* Bean property setter: namespace .
*
*
* The URL of the namespace definition. Value SHOULD be in the form of a URL.
*
* @param namespace The new value for the namespace property on this bean.
* @return This object (for method chaining).
*/
public Xml setNamespace(String namespace) {
this.namespace = namespace;
return this;
}
/**
* Synonym for {@link #setNamespace(String)}.
*
* @param namespace The new value for the namespace property on this bean.
* @return This object (for method chaining).
*/
public Xml namespace(String namespace) {
return setNamespace(namespace);
}
/**
* Bean property getter: prefix .
*
*
* The prefix to be used for the name.
*
* @return The value of the prefix property on this bean, or null if it is not set.
*/
public String getPrefix() {
return prefix;
}
/**
* Bean property setter: prefix .
*
*
* The prefix to be used for the name.
*
* @param prefix The new value for the prefix property on this bean.
* @return This object (for method chaining).
*/
public Xml setPrefix(String prefix) {
this.prefix = prefix;
return this;
}
/**
* Synonym for {@link #setPrefix(String)}.
*
* @param prefix The new value for the prefix property on this bean.
* @return This object (for method chaining).
*/
public Xml prefix(String prefix) {
return setPrefix(prefix);
}
/**
* Bean property getter: attribute .
*
*
* Declares whether the property definition translates to an attribute instead of an element.
*
*
* Default value is false .
*
* @return The value of the attribute property on this bean, or null if it is not set.
*/
public Boolean getAttribute() {
return attribute;
}
/**
* Bean property setter: attribute .
*
*
* Declares whether the property definition translates to an attribute instead of an element.
*
*
* Default value is false .
*
* @param attribute The new value for the attribute property on this bean.
* @return This object (for method chaining).
*/
public Xml setAttribute(Boolean attribute) {
this.attribute = attribute;
return this;
}
/**
* Synonym for {@link #setAttribute(Boolean)}.
*
* @param attribute The new value for the attribute property on this bean.
* @return This object (for method chaining).
*/
public Xml attribute(Boolean attribute) {
return setAttribute(attribute);
}
/**
* 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/>
).
* Default value is false .
* The definition takes effect only when defined alongside type
being array
* (outside the items
).
*
* @return The value of the wrapped property on this bean, or null if it is not set.
*/
public Boolean getWrapped() {
return wrapped;
}
/**
* 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/>
).
* Default value is false .
* The definition takes effect only when defined alongside type
being array
* (outside the items
).
*
* @param wrapped The new value for the wrapped property on this bean.
* @return This object (for method chaining).
*/
public Xml setWrapped(Boolean wrapped) {
this.wrapped = wrapped;
return this;
}
/**
* Synonym for {@link #setWrapped(Boolean)}.
*
* @param wrapped The new value for the wrapped property on this bean.
* @return This object (for method chaining).
*/
public Xml wrapped(Boolean wrapped) {
return setWrapped(wrapped);
}
}