Package net.sf.sitstart.dto

Examples of net.sf.sitstart.dto.Link


    /**
     * @see net.sf.sitstart.svc.internal.LinkFactory#create(net.sf.sitstart.dto.Asset, java.lang.String)
     */
    public Link create(Asset source, String targetLinkTag)
    {
        Link             result      = null;
        Asset            target      = null;
        URI              targetURI   = null;
        Link.LinkTagType linkTagType = null;

       
        // PRECONDITIONS
        assert source        != null             : "source must not be null.";
        assert targetLinkTag != null             : "targetLinkTag must not be null.";
        assert targetLinkTag.trim().length() > 0 : "targetLinkTag must not be empty or blank.";
       
        // Body
        targetURI = parseLinkTag(targetLinkTag);
        target    = assetRetriever.retrieve(targetURI).getAsset();
       
        try
        {
            result = linkClass.newInstance();
        }
        catch (RuntimeException re)
        {
            throw re;
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
       
        result.setSource(source);
        result.setTarget(target);
        result.setLinkTag(targetLinkTag.trim());
        result.setLinkTagType(linkTagType);

        // Don't forget to link everything up
        target.addIncomingLink(result);
        source.addIncomingLink(result);
       
View Full Code Here

TOP

Related Classes of net.sf.sitstart.dto.Link

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.