001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021
022package org.biojava.utils.net;
023
024import java.net.URL;
025
026/**
027 * <p><code>URLFactory</code> defines a means of obtaining a URL
028 * associated with an object. The URL returned may be based on any
029 * property of the object, for example its Java class, methods or
030 * fields or its <code>Annotation</code>. As the criteria by which the
031 * URL are created will be highly variable it is left to the
032 * implementation to cast the <code>Object</code> argument and perform
033 * any necessary checks. An implementation may make any additional
034 * checks such as applying <code>PropertyConstraint</code>s or
035 * checking an <code>AnnotationType</code>.</p>
036 *
037 * <p>An example use case is in obtaining hyperlink target to
038 * associate with a sequence hit in a database search which will then
039 * be placed in an image map.</p>
040 *
041 * @author <a href="mailto:kdj@sanger.ac.uk">Keith James</a>
042 */
043public interface URLFactory
044{
045    /**
046     * <code>createURL</code> returns a URL which is relevant to the
047     * object in a way specified by the implementation.
048     *
049     * @param object an <code>Object</code>.
050     *
051     * @return a <code>URL</code>.
052     */
053    public URL createURL(Object object);
054}