 # @class Postprocessor
 #
 class Postprocessor
+    @supportedRules = ['definition', 'enumeration', 'index', 'attribute', 'relation', 'link']
+
     #
     # @param [Object] parser
     #

        index.key = index.key.map (field) =>
            # Save keys as properties if they specified in extended format
            if field.type?
                utils.addAsObjectMember(ctx, 'properties', field.name, @processProperty(field))
            # We need only attribute names here
            field.name


    # Converts property definition to JSON Schema entry.
    #
    # @param [Object] property raw definition of property
    # @param [Object] ctx context for property
    # @return [Object] property context JSON Schema definition
    #
    processAttribute: (property, ctx={}) ->
        # Add property to context and return context
        utils.addAsObjectMember(ctx, 'properties', property.attribute.name, property.attribute)
        ctx

    #
    # Converts relation definition to JSON Schema entry.
    #
    # @param [Object] relation raw definition of relation
    # @param [Object] ctx context for relation
    # @return [Object] relation context JSON Schema definition
    #
    processRelation: (relation, ctx={}) ->
        # Add relation to context and return context
        utils.addAsObjectMember(ctx, 'relations', relation.attribute.name, relation)
        ctx

    #
    # Converts link definition to JSON Schema entry.
    #
    # @param [Object] link raw definition of link
    # @param [Object] ctx context for link
    # @return [Object] link context JSON Schema definition
    #
    processLink: (link, ctx={}) ->
        # Add link to context and return context
        utils.addAsObjectMember(ctx, 'links', link.attribute.name, link)
        ctx


module.exports = Postprocessor
