001    package org.opencfml.cfx;
002    
003    /**
004     * Alternative Implementation of Jeremy Allaire's Request Interface
005     */
006    public interface Request {
007    
008            /**
009             * checks if attribute with this key exists
010             * @param key key to check
011             * @return has key or not
012             */
013            public boolean attributeExists(String key);
014            
015            /**
016             * @return if tags has set [debug] attribute
017             */
018            public boolean debug();
019            
020            /**
021             * returns attribute matching key
022             * @param key key to get
023             * @return value to key
024             */
025            public String getAttribute(String key);
026            
027            /**
028             * returns attribute matching key
029             * @param key key to get
030             * @param defaultValue return this value if key not exist
031             * @return value to key
032             */
033            public String getAttribute(String key, String defaultValue);
034            
035            /**
036             * return all sattribute keys
037             * @return all keys
038             */
039            public String[] getAttributeList();
040            
041            /**
042             * returns attribute as int matching key
043             * @param key key to get
044             * @return value to key
045             * @throws NumberFormatException
046             */
047            public int getIntAttribute(String key) throws NumberFormatException;
048            
049            /**
050             * returns attribute as int matching key
051             * @param key key to get
052             * @param defaultValue return this value if key not exist
053             * @return value to key
054             */
055            public int getIntAttribute(String key, int defaultValue);
056            
057            /**
058             * return given query
059             * @return return given query
060             */
061            public Query getQuery();
062    
063            /**
064             * returns all the settings
065             * @param key
066             * @return settings
067             */
068            public String getSetting(String key);
069    
070    }