001    /*
002     * $Revision: 1 $ $Date: 08.05.2009 11:51:35 $
003     *
004     * This file is part of ***  M y C o R e  ***
005     * See http://www.mycore.de/ for details.
006     *
007     * This program is free software; you can use it, redistribute it
008     * and / or modify it under the terms of the GNU General Public License
009     * (GPL) as published by the Free Software Foundation; either version 2
010     * of the License or (at your option) any later version.
011     *
012     * This program is distributed in the hope that it will be useful, but
013     * WITHOUT ANY WARRANTY; without even the implied warranty of
014     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015     * GNU General Public License for more details.
016     *
017     * You should have received a copy of the GNU General Public License
018     * along with this program, in a file called gpl.txt or license.txt.
019     * If not, write to the Free Software Foundation Inc.,
020     * 59 Temple Place - Suite 330, Boston, MA  02111-1307 USA
021     */
022    
023    package org.mycore.datamodel.metadata.validator;
024    
025    import org.jdom.Element;
026    
027    /**
028     * Validates the output of the Editor framework.
029     * Implementors have to be thread safe.
030     * @author Thomas Scheffler (yagee)
031     * @version $Revision: 1 $ $Date: 08.05.2009 11:51:35 $
032     */
033    public interface MCREditorMetadataValidator {
034    
035        /**
036         * Gives hints to the editor form developer.
037         * 
038         * If an element is not valid it is removed from the JDOM document.
039         * The returned String then can give a hint to the form developer, why it is removed.
040         * This method may throw a {@link RuntimeException} in which case the whole validation process will fail.
041         * @param datasubtag
042         * @return 
043         *  null, everything is OK
044         *  validation error message
045         */
046        public String checkDataSubTag(Element datasubtag);
047    }