All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jflux.spec.messaging.DestinationSpecBuilder Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package org.jflux.spec.messaging;

import com.hp.hpl.jena.assembler.Assembler;
import com.hp.hpl.jena.assembler.Mode;
import org.appdapter.bind.rdf.jena.assembly.CachingComponentAssembler;
import org.appdapter.bind.rdf.jena.assembly.ItemAssemblyReader;
import org.appdapter.core.item.Item;
import org.appdapter.core.name.Ident;
import com.hp.hpl.jena.rdf.model.Resource;

/**
 *
 * @author Amy Jessica Book 
 * @author Jason R. Eads 
 */

public class DestinationSpecBuilder
    extends CachingComponentAssembler {
    private final static String theDestinationName = "http://www.friedularity.org/Connection#destinationName";
    private final static String theNodeType = "http://www.friedularity.org/Connection#nodeType";
    private final static String prefix="http://www.friedularity.org/Connection#";
    
    public DestinationSpecBuilder( Resource builderConfRes ) {
        super(builderConfRes);
    }
    
    @Override
    protected Class decideComponentClass(
            Ident ident, Item item) {
        return DestinationSpec.class;
    }

    @Override
    protected void initExtendedFieldsAndLinks(
            DestinationSpec mkc, Item item, Assembler asmblr, Mode mode) {
        ItemAssemblyReader reader = getReader();
        mkc.setName(reader.readConfigValString(
                item.getIdent(), theDestinationName, item, ""));

        mkc.setType(prefix+reader.readConfigValString(item.getIdent(), theNodeType, item,""));
//        Ident nodePropId = ItemFuncs.getNeighborIdent(
//                item,theNodeType);
//        Item nodeTypeItem = item.getSingleLinkedItem(nodePropId, Item.LinkDirection.FORWARD);
     //   mkc.setType(nodeTypeItem.getIdent().getAbsUriString());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy