001    // This file is part of AceWiki.
002    // Copyright 2008-2012, AceWiki developers.
003    // 
004    // AceWiki is free software: you can redistribute it and/or modify it under the terms of the GNU
005    // Lesser General Public License as published by the Free Software Foundation, either version 3 of
006    // the License, or (at your option) any later version.
007    // 
008    // AceWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
009    // even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
010    // Lesser General Public License for more details.
011    // 
012    // You should have received a copy of the GNU Lesser General Public License along with AceWiki. If
013    // not, see http://www.gnu.org/licenses/.
014    
015    package ch.uzh.ifi.attempto.acewiki.core;
016    
017    import java.util.List;
018    
019    /**
020     * This interface represents an object that knows how to create and change words in the form of
021     * ontology elements and how this should be presented to the user.
022     * 
023     * @author Tobias Kuhn
024     */
025    public interface LexiconChanger {
026            
027            /**
028             * Returns the description of the given word type to be shown to the user.
029             * 
030             * @return The description.
031             */
032            public String getDescription();
033            
034            /**
035             * Returns a list of lexical details for the given ontology element.
036             * 
037             * @param el The ontology element.
038             * @return A list of lexical details.
039             */
040            public List<LexiconDetail> getDetails(OntologyElement el);
041            
042            /**
043             * Tries to save a modification on an ontology element. An exception is thrown if the
044             * modification is not possible, e.g. because of name conflicts.
045             * 
046             * @param el The ontology element to be modified.
047             * @param wordNumber The word number to be used right after a successful modification.
048             * @param newValues The new values corresponding to the list of lexical details.
049             * @param ontology The ontology.
050             * @throws InvalidWordException If the modification is not possible.
051             */
052            public void save(OntologyElement el, int wordNumber, List<Object> newValues, Ontology ontology)
053                            throws InvalidWordException;
054    
055    }