Class TitleRule

java.lang.Object
org.jsonschema2pojo.rules.TitleRule
All Implemented Interfaces:
Rule<com.sun.codemodel.JDocCommentable,com.sun.codemodel.JDocComment>

public class TitleRule extends Object implements Rule<com.sun.codemodel.JDocCommentable,com.sun.codemodel.JDocComment>
Applies the "title" property property.
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.sun.codemodel.JDocComment
    apply(String nodeName, com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode parent, com.sun.codemodel.JDocCommentable generatableType, Schema schema)
    Applies this schema rule to take the required code generation steps.

    Methods inherited from class java.lang.Object

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

    • TitleRule

      protected TitleRule()
  • Method Details

    • apply

      public com.sun.codemodel.JDocComment apply(String nodeName, com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode parent, com.sun.codemodel.JDocCommentable generatableType, Schema schema)
      Applies this schema rule to take the required code generation steps.

      When a title node is found and applied with this rule, the value of the title is added as a JavaDoc comment. This rule is typically applied to the generated field, generated getter and generated setter for the property.

      Note that the title is always inserted at the top of the JavaDoc comment.

      Specified by:
      apply in interface Rule<com.sun.codemodel.JDocCommentable,com.sun.codemodel.JDocComment>
      Parameters:
      nodeName - the name of the property to which this title applies
      node - the "title" schema node
      parent - the parent node
      generatableType - comment-able code generation construct, usually a field or method, which should have this title applied
      schema - the schema to which this schema rule (and the given node) belongs.
      Returns:
      the JavaDoc comment created to contain the title