com.ontotext.wsmo4j.examples
Class LocatorExample

java.lang.Object
  extended by com.ontotext.wsmo4j.examples.LocatorExample
All Implemented Interfaces:
org.wsmo.locator.Locator

public class LocatorExample
extends Object
implements org.wsmo.locator.Locator

Title:

Description:

Copyright: Copyright (c) 2004-2005

Company: Ontotext Lab., Sirma AI

Version:
1.0
Author:
not attributable

Field Summary
static String FILE
           
 
Fields inherited from interface org.wsmo.locator.Locator
URI_MAPPING
 
Constructor Summary
LocatorExample(Map<String,File> map)
          Constructor of InstanceLocator.
 
Method Summary
 Set<org.wsmo.common.Entity> lookup(org.wsmo.common.Identifier id)
          Method to retrieve Entity based on Identifier; It's supposed that the Entity is located in a file with name corresponding to it's namespace.
 org.wsmo.common.Entity lookup(org.wsmo.common.Identifier id, Class clazz)
          Method to retrieve Entity based on Identifier; It's supposed that the Entity is located in a file with name corresponding to it's namespace.
static void main(String[] args)
          Runs the example
static void test(File wsmlFile, String lacateIRI)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE

public static final String FILE
See Also:
Constant Field Values
Constructor Detail

LocatorExample

public LocatorExample(Map<String,File> map)
               throws FileNotFoundException,
                      IOException,
                      org.wsmo.wsml.ParserException,
                      org.wsmo.common.exception.InvalidModelException
Constructor of InstanceLocator.

Parameters:
map - map containing the directory to be used
Throws:
org.wsmo.common.exception.InvalidModelException
org.wsmo.wsml.ParserException
IOException
FileNotFoundException
Method Detail

lookup

public org.wsmo.common.Entity lookup(org.wsmo.common.Identifier id,
                                     Class clazz)
                              throws org.wsmo.common.exception.SynchronisationException
Method to retrieve Entity based on Identifier; It's supposed that the Entity is located in a file with name corresponding to it's namespace.

Specified by:
lookup in interface org.wsmo.locator.Locator
Parameters:
id - the id to search for
Returns:
instance or null if the identifier was not found in the directory
Throws:
org.wsmo.common.exception.SynchronisationException

lookup

public Set<org.wsmo.common.Entity> lookup(org.wsmo.common.Identifier id)
                                   throws org.wsmo.common.exception.SynchronisationException
Method to retrieve Entity based on Identifier; It's supposed that the Entity is located in a file with name corresponding to it's namespace.

Specified by:
lookup in interface org.wsmo.locator.Locator
Parameters:
id - the id to search for
Returns:
instance or null if the identifier was not found in the directory
Throws:
org.wsmo.common.exception.SynchronisationException

main

public static void main(String[] args)
Runs the example

Parameters:
args[0] - - path to a wsml file, args[1] an identifier IRI of and instance

test

public static void test(File wsmlFile,
                        String lacateIRI)


Copyright © 2004-2008 Ontotext Lab.. All Rights Reserved.