Class MediaRule

java.lang.Object
org.jsonschema2pojo.rules.MediaRule
All Implemented Interfaces:
Rule<com.sun.codemodel.JType,com.sun.codemodel.JType>

public class MediaRule extends Object implements Rule<com.sun.codemodel.JType,com.sun.codemodel.JType>

Applies the "media" hyper schema rule.

Since:
0.4.2
Author:
Christian Trimble
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a new media rule.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.sun.codemodel.JType
    apply(String nodeName, com.fasterxml.jackson.databind.JsonNode mediaNode, com.fasterxml.jackson.databind.JsonNode parent, com.sun.codemodel.JType baseType, Schema schema)
    Applies this schema rule.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MediaRule

      protected MediaRule()

      Constructs a new media rule.

      Since:
      0.4.2
  • Method Details

    • apply

      public com.sun.codemodel.JType apply(String nodeName, com.fasterxml.jackson.databind.JsonNode mediaNode, com.fasterxml.jackson.databind.JsonNode parent, com.sun.codemodel.JType baseType, Schema schema)

      Applies this schema rule.

      Specified by:
      apply in interface Rule<com.sun.codemodel.JType,com.sun.codemodel.JType>
      Parameters:
      nodeName - the name of the property.
      mediaNode - the media node
      parent - the parent node
      baseType - the type with the media node. This must be java.lang.String.
      schema - the schema containing the property.
      Returns:
      byte[] when a binary encoding is specified, baseType otherwise.
      Since:
      0.4.2