package net.northking.cctp.element.core.keyword;

import net.northking.cctp.element.core.IExecuteContext;

import java.util.List;
import java.util.Map;

/**
 * Keyword interface
 *
 * @author fengxiang.zhang
 * @since 1.0
 */
public interface Keyword {

    /**
     * Get keyword name
     */
    String getName();

    /**
     * Get keyword alias
     *
     * @return
     */
    String getAlias();

    /**
     * Get keyword documentation
     *
     * @return
     */
    String getDocumentation();

    /**
     * Get keyword arguments as list
     *
     * @return
     */
    List<KeywordArgument> getArguments();

    /**
     * Get keyword arguments as map
     *
     * @return
     */
    Map<String, KeywordArgument> getArgumentMap();

    /**
     * Get keyword return
     *
     * @return
     */
    KeywordReturn getReturn();

    /**
     * Deprecated keyword
     *
     * @return
     */
    boolean isDeprecated();

    /**
     * Web page hidden
     *
     * @return
     */
    boolean isHidden();

    /**
     * Get keyword category
     *
     * @return
     */
    String getCategory();

    /**
     * Get keyword attributes
     *
     * @return
     */
    String getAttributes();

    boolean isCommonlyUse();

    /**
     * Run keyword
     *
     * @param arguments
     * @return
     */
    Object execute(Map<String, Object> arguments, IExecuteContext context) throws Exception;
}