001    package railo.runtime.text.xml.storage;
002    
003    import railo.runtime.type.dt.Date;
004    import railo.runtime.type.dt.DateTime;
005    import railo.runtime.type.dt.Time;
006    
007    /**
008     * A Object to store to XML File
009     */
010    public abstract class StorageItem {
011        
012        /**
013         * gets a value from the storage item as String
014         * @param key key of the value to get
015         * @return matching value
016         * @throws StorageException
017         */
018        public String getString(String key) throws StorageException {
019            throw new StorageException("there is no value with the key "+key);
020        }
021        
022        /**
023         * gets a value from the storage item as int
024         * @param key key of the value to get
025         * @return matching value
026         * @throws StorageException
027         */
028        public int getInt(String key) throws StorageException {
029            throw new StorageException("there is no value with the key "+key);
030        }
031        
032        /**
033         * gets a value from the storage item as Date Object
034         * @param key key of the value to get
035         * @return matching value
036         * @throws StorageException
037         */
038        public Date getDate(String key) throws StorageException {
039            throw new StorageException("there is no value with the key "+key);
040        }
041        
042        /**
043         * gets a value from the storage item as Time Object
044         * @param key key of the value to get
045         * @return matching value
046         * @throws StorageException
047         */
048        public Time getTime(String key) throws StorageException {
049            throw new StorageException("there is no value with the key "+key);
050        }
051        
052        /**
053         * gets a value from the storage item as Date Object
054         * @param key key of the value to get
055         * @return matching value
056         * @throws StorageException
057         */
058        public DateTime getDateTime(String key) throws StorageException {
059            throw new StorageException("there is no value with the key "+key);
060        }
061        
062        /**
063         * sets a value to the storage item as String
064         * @param key key of the value to set
065         * @param value value to set
066         * @throws StorageException
067         */
068        public void setString(String key,String value) throws StorageException {
069            throw new StorageException("key "+key+" is not supported for this item");
070        }
071        
072        /**
073         * sets a value to the storage item as int
074         * @param key key of the value to set
075         * @param value value to set
076         * @throws StorageException
077         */
078        public void setInt(String key,int value) throws StorageException {
079            throw new StorageException("key "+key+" is not supported for this item");
080        }
081        
082        /**
083         * sets a value to the storage item as Date Object
084         * @param key key of the value to set
085         * @param value value to set
086         * @throws StorageException
087         */
088        public void setDate(String key,Date value) throws StorageException {
089            throw new StorageException("key "+key+" is not supported for this item");
090        }
091        
092        /**
093         * sets a value to the storage item as Time Object
094         * @param key key of the value to set
095         * @param value value to set
096         * @throws StorageException
097         */
098        public void setTime(String key,Time value) throws StorageException {
099            throw new StorageException("key "+key+" is not supported for this item");
100        }
101        
102        /**
103         * sets a value to the storage item as DateTime Object
104         * @param key key of the value to set
105         * @param value value to set
106         * @throws StorageException
107         */
108        public void setDateTime(String key,DateTime value) throws StorageException {
109            throw new StorageException("key "+key+" is not supported for this item");
110        }
111    }