@Override
  public JType apply(String nodeName,
                     JsonNode node,
                     JsonNode parent,
                     JPackage _package,
                     Schema schema) {
    JsonNode isInterface = node.get("javaInterface");
    if (isInterface != null && isInterface.asBoolean(false)) {
      JDefinedClass jInterface;
      try {
        jInterface = createInterface(nodeName, node, _package);
        registerImplementation(jInterface, nodeName, node, schema);
      }
      catch (ClassAlreadyExistsException e) {
        JType result = e.getExistingClass();
        if (result instanceof JDefinedClass && ((JDefinedClass)result).isInterface()) {
          registerImplementation((JDefinedClass)result, nodeName, node, schema);
        }
        return result;
      }

      addImplements(jInterface, nodeName, node, _package, schema);
      schema.setJavaTypeIfEmpty(jInterface);

      if (node.has("title")) {
        ruleFactory.getTitleRule().apply(nodeName, node.get("title"), node, jInterface, schema);
      }

      if (node.has("description")) {
        ruleFactory.getDescriptionRule().apply(nodeName, node.get("description"), node, jInterface, schema);
      }
      ruleFactory.getPropertiesRule().apply(nodeName, node.get("properties"), node, jInterface, schema);
      if (node.has("patternProperties")) {
        ruleFactory.getPatternPropertiesRule().apply(nodeName, node.get("patternProperties"), node, jInterface, schema);
      }
      else {
        ruleFactory.getAdditionalPropertiesRule().apply(nodeName, node.get("additionalProperties"), node, jInterface, schema);
      }

      if (node.has("javaInterfaces")) {
        addInterfaces(jInterface, node.get("javaInterfaces"));
      }

      new ArrayList<>(jInterface.fields().values()).forEach(field -> jInterface.removeField(field));
      jInterface.methods().forEach(method -> removeBody(method));
    }
    JType result = super.apply(nodeName, node, parent, _package, schema);
    if (result instanceof JDefinedClass) {
      JDefinedClass jClass = (JDefinedClass)result;
      addImplements(jClass, nodeName, node, _package, schema);
      if (node.has("patternProperties")) {
        removeAdditionalProperties(jClass);
        ruleFactory.getPatternPropertiesRule().apply(nodeName, node.get("patternProperties"), node, jClass, schema);
      }
      JsonNode isAbstract = node.get("javaAbstract");
      if (isAbstract != null && isAbstract.isBoolean() && isAbstract.asBoolean()) {
        setAbstract(jClass.mods());
        removeAdditionalProperties(jClass);
      }
    }
    return result;
  }
@Override
  public JType apply(String nodeName,
                     JsonNode node,
                     JsonNode parent,
                     JPackage _package,
                     Schema schema)