001    /*
002     * 
003     * $Revision: 14003 $ $Date: 2008-09-16 11:45:07 +0200 (Di, 16 Sep 2008) $
004     *
005     * This file is part of ***  M y C o R e  ***
006     * See http://www.mycore.de/ for details.
007     *
008     * This program is free software; you can use it, redistribute it
009     * and / or modify it under the terms of the GNU General Public License
010     * (GPL) as published by the Free Software Foundation; either version 2
011     * of the License or (at your option) any later version.
012     *
013     * This program is distributed in the hope that it will be useful, but
014     * WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     * GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with this program, in a file called gpl.txt or license.txt.
020     * If not, write to the Free Software Foundation Inc.,
021     * 59 Temple Place - Suite 330, Boston, MA  02111-1307 USA
022     */
023    
024    package org.mycore.datamodel.metadata;
025    
026    import org.mycore.common.MCRException;
027    
028    /**
029     * This interface is designed to to have a general description of the common
030     * methode set of all metadata classes.
031     * 
032     * @author Jens Kupferschmidt
033     * @version $Revision: 14003 $ $Date: 2008-09-16 11:45:07 +0200 (Di, 16 Sep 2008) $
034     */
035    public interface MCRMetaInterface extends Cloneable {
036        /**
037         * This method get the inherited element.
038         * 
039         * @return the inherited flag as int
040         */
041        public int getInherited();
042    
043        /**
044         * This method get the inherited element.
045         * 
046         * @return the inherited value as string
047         */
048        public String getInheritedToString();
049    
050        /**
051         * This method get the language element.
052         * 
053         * @return the language
054         */
055        public String getLang();
056    
057        /**
058         * This method get the subtag element.
059         * 
060         * @return the subtag
061         */
062        public String getSubTag();
063    
064        /**
065         * This method get the type element.
066         * 
067         * @return the type
068         */
069        public String getType();
070    
071        /**
072         * This method set the inherited level. This can be 0 or an integer higher
073         * 0.
074         * 
075         * @param value
076         *            the inherited level value, if it is < 0, 0 was set
077         */
078        public void setInherited(int value);
079    
080        /**
081         * This method increments the inherited value with 1.
082         */
083        public void incrementInherited();
084    
085        /**
086         * This method decrements the inherited value with 1.
087         */
088        public void decrementInherited();
089    
090        /**
091         * This methode set the default language to the class.
092         * 
093         * @param default_lang
094         *            the default language
095         */
096        public void setLang(String default_lang);
097    
098        /**
099         * This method set the subtag element. If the value of <em>set_subtag</em>
100         * is null or empty an exception was throwed.
101         * 
102         * @param set_subtag
103         *            the subtag
104         * @exception MCRException
105         *                if the set_subtag value is null or empty
106         */
107        public void setSubTag(String set_subtag) throws MCRException;
108    
109        /**
110         * This method set the type element. If the value of <em>set_type</em> is
111         * null or empty nothing was changed.
112         * 
113         * @param set_type
114         *            the optional type
115         */
116        public void setType(String set_type);
117    
118        /**
119         * This methode read the XML input stream part from a DOM part for the
120         * metadata of the document.
121         * 
122         * @param element
123         *            a relevant JDOM element for the metadata
124         */
125        public void setFromDOM(org.jdom.Element element);
126    
127        /**
128         * This methode create a XML stream for a metadata part.
129         * 
130         * @exception MCRException
131         *                if the content of this class is not valid
132         * @return a JDOM Element with the XML data of the metadata part
133         */
134        public org.jdom.Element createXML() throws MCRException;
135    
136        /**
137         * This methode check the validation of the content of this class.
138         * 
139         * @return a boolean value
140         */
141        public boolean isValid();
142    
143        /**
144         * This method make a clone of this class.
145         */
146        public Object clone();
147        
148        /**
149         * This method put debug data to the logger (for the debug mode).
150         */
151        public void debug();
152    }