001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.runtime.text.xml.storage;
020
021import lucee.runtime.type.dt.Date;
022import lucee.runtime.type.dt.DateTime;
023import lucee.runtime.type.dt.Time;
024
025/**
026 * A Object to store to XML File
027 */
028public abstract class StorageItem {
029    
030    /**
031     * gets a value from the storage item as String
032     * @param key key of the value to get
033     * @return matching value
034     * @throws StorageException
035     */
036    public String getString(String key) throws StorageException {
037        throw new StorageException("there is no value with the key "+key);
038    }
039    
040    /**
041     * gets a value from the storage item as int
042     * @param key key of the value to get
043     * @return matching value
044     * @throws StorageException
045     */
046    public int getInt(String key) throws StorageException {
047        throw new StorageException("there is no value with the key "+key);
048    }
049    
050    /**
051     * gets a value from the storage item as Date Object
052     * @param key key of the value to get
053     * @return matching value
054     * @throws StorageException
055     */
056    public Date getDate(String key) throws StorageException {
057        throw new StorageException("there is no value with the key "+key);
058    }
059    
060    /**
061     * gets a value from the storage item as Time Object
062     * @param key key of the value to get
063     * @return matching value
064     * @throws StorageException
065     */
066    public Time getTime(String key) throws StorageException {
067        throw new StorageException("there is no value with the key "+key);
068    }
069    
070    /**
071     * gets a value from the storage item as Date Object
072     * @param key key of the value to get
073     * @return matching value
074     * @throws StorageException
075     */
076    public DateTime getDateTime(String key) throws StorageException {
077        throw new StorageException("there is no value with the key "+key);
078    }
079    
080    /**
081     * sets a value to the storage item as String
082     * @param key key of the value to set
083     * @param value value to set
084     * @throws StorageException
085     */
086    public void setString(String key,String value) throws StorageException {
087        throw new StorageException("key "+key+" is not supported for this item");
088    }
089    
090    /**
091     * sets a value to the storage item as int
092     * @param key key of the value to set
093     * @param value value to set
094     * @throws StorageException
095     */
096    public void setInt(String key,int value) throws StorageException {
097        throw new StorageException("key "+key+" is not supported for this item");
098    }
099    
100    /**
101     * sets a value to the storage item as Date Object
102     * @param key key of the value to set
103     * @param value value to set
104     * @throws StorageException
105     */
106    public void setDate(String key,Date value) throws StorageException {
107        throw new StorageException("key "+key+" is not supported for this item");
108    }
109    
110    /**
111     * sets a value to the storage item as Time Object
112     * @param key key of the value to set
113     * @param value value to set
114     * @throws StorageException
115     */
116    public void setTime(String key,Time value) throws StorageException {
117        throw new StorageException("key "+key+" is not supported for this item");
118    }
119    
120    /**
121     * sets a value to the storage item as DateTime Object
122     * @param key key of the value to set
123     * @param value value to set
124     * @throws StorageException
125     */
126    public void setDateTime(String key,DateTime value) throws StorageException {
127        throw new StorageException("key "+key+" is not supported for this item");
128    }
129}