org.xces.graf.uima.example
Class Example

java.lang.Object
  extended by org.xces.graf.uima.example.Example

public class Example
extends Object

This class is an example of how one can use the CASFactory class to convert a Graph to a CAS: updated to work with xmlns="http://www.xces.org/ns/GrAF/1.0/

Version:
1.1
Author:
Madhav Krishna

Constructor Summary
Example()
           
 
Method Summary
 org.apache.uima.cas.CAS convertGraphToCas(org.xces.graf.api.IGraph graph, org.xces.graf.util.NameMap map)
          Converts a Graph to a CAS
 void dumpCasToXmi(org.apache.uima.cas.CAS aCas, File file)
          Serializes a CAS to XMI -- its representation in XML
static String getContents(String file)
          Returns the contents of a file in the form of a String object
static void main(String[] args)
           
 void run()
          Runs the example
 void saveTypeSystem(org.apache.uima.cas.CAS aCas, File destination)
          Creates an ECORE file for the type system used for a CAS object
 org.xces.graf.api.IGraph toyGraph()
          Returns a "Hello World." toy graph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Example

public Example()
Method Detail

convertGraphToCas

public org.apache.uima.cas.CAS convertGraphToCas(org.xces.graf.api.IGraph graph,
                                                 org.xces.graf.util.NameMap map)
                                          throws TypeSystemException,
                                                 org.apache.uima.resource.ResourceInitializationException,
                                                 SAXException,
                                                 IOException
Converts a Graph to a CAS

Parameters:
graph -
Returns:
Throws:
IOException
SAXException
TypeSystemException
org.apache.uima.resource.ResourceInitializationException

dumpCasToXmi

public void dumpCasToXmi(org.apache.uima.cas.CAS aCas,
                         File file)
                  throws org.apache.uima.resource.ResourceProcessException,
                         IOException
Serializes a CAS to XMI -- its representation in XML

Parameters:
aCas -
Throws:
org.apache.uima.resource.ResourceProcessException
IOException

saveTypeSystem

public void saveTypeSystem(org.apache.uima.cas.CAS aCas,
                           File destination)
                    throws IOException,
                           SAXException
Creates an ECORE file for the type system used for a CAS object

Parameters:
aCas -
Throws:
SAXException
IOException

toyGraph

public org.xces.graf.api.IGraph toyGraph()
                                  throws org.xces.graf.api.GrafException
Returns a "Hello World." toy graph

Returns:
Throws:
org.xces.graf.api.GrafException

run

public void run()
         throws org.xces.graf.api.GrafException,
                org.apache.uima.resource.ResourceInitializationException,
                TypeSystemException
Runs the example

Throws:
org.xces.graf.api.GrafException
org.apache.uima.resource.ResourceInitializationException
TypeSystemException

getContents

public static String getContents(String file)
                          throws Exception
Returns the contents of a file in the form of a String object

Parameters:
file -
Returns:
Throws:
IOException
Exception

main

public static void main(String[] args)


Copyright © 2012 American National Corpus. All Rights Reserved.