Class SwaggerElement

java.lang.Object
org.apache.juneau.dto.swagger.SwaggerElement
Direct Known Subclasses:
Contact, ExternalDocumentation, HeaderInfo, Info, Items, License, Operation, ParameterInfo, ResponseInfo, SchemaInfo, SecurityScheme, Swagger, Tag, Xml

public abstract class SwaggerElement extends Object
Root class for all Swagger beans.
See Also:
  • Method Details

    • isStrict

      protected boolean isStrict()
      Returns true if contents should be validated per the Swagger spec.
      Returns:
      true if contents should be validated per the Swagger spec.
    • strict

      protected SwaggerElement strict()
      Sets strict mode on this bean.
      Returns:
      This object.
    • strict

      protected SwaggerElement strict(Object value)
      Sets strict mode on this bean.
      Parameters:
      value - The new value for this property.
      Non-boolean values will be converted to boolean using Boolean.valueOf(value.toString()).
      Can be null (interpreted as false).
      Returns:
      This object.
    • get

      public <T> T get(String property, Class<T> type)
      Generic property getter.

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

      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.
    • get

      @Beanp("*") public Object get(String property)
      Generic property getter.

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

      Parameters:
      property - The property name to retrieve.
      Returns:
      The property value, or null if the property does not exist or is not set.
    • set

      @Beanp("*") public SwaggerElement set(String property, Object value)
      Generic property setter.

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

      Parameters:
      property - The property name to set.
      value - The new value for the property.
      Returns:
      This object.
    • extraKeys

      @Beanp("*") public Set<String> extraKeys()
      Generic property keyset.
      Returns:
      All the non-standard keys on this element.
      Never null.
    • keySet

      public Set<String> keySet()
      Returns all the keys on this element.
      Returns:
      All the keys on this element.
      Never null.
    • asMap

      public JsonMap asMap()
      Returns a copy of this swagger element as a modifiable map.

      Each call produces a new map.

      Returns:
      A map containing all the values in this swagger element.
    • toString

      public String toString()
      Overrides:
      toString in class Object