com.metamatrix.cdk.api
Class TranslationUtility

java.lang.Object
  extended by com.metamatrix.cdk.api.TranslationUtility

public class TranslationUtility
extends java.lang.Object

This translation utility can be used to translate sql strings into Connector API language interfaces for testing purposes. The utility requires a metadata .vdb file in order to resolve references in the SQL.

This utility class can also be used to obtain a RuntimeMetadata implementation based on the VDB file, which is sometimes handy when writing unit tests.


Constructor Summary
TranslationUtility(QueryMetadataInterface metadata)
           
TranslationUtility(java.lang.String vdbFile)
          Construct a utility instance with a given vdb file.
TranslationUtility(java.net.URL url)
           
 
Method Summary
 RuntimeMetadata createRuntimeMetadata()
          Create a RuntimeMetadata that can be used for testing a connector.
 ICommand parseCommand(java.lang.String sql)
          Parse a SQL command and return an ICommand object.
 ICommand parseCommand(java.lang.String sql, boolean generateAliases, boolean supportsGroupAliases)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslationUtility

public TranslationUtility(java.lang.String vdbFile)
Construct a utility instance with a given vdb file.

Parameters:
vdbFile - The .vdb file name representing metadata for the connector

TranslationUtility

public TranslationUtility(java.net.URL url)

TranslationUtility

public TranslationUtility(QueryMetadataInterface metadata)
Method Detail

parseCommand

public ICommand parseCommand(java.lang.String sql,
                             boolean generateAliases,
                             boolean supportsGroupAliases)

parseCommand

public ICommand parseCommand(java.lang.String sql)
Parse a SQL command and return an ICommand object.

Parameters:
sql -
Returns:
Command using the language interfaces

createRuntimeMetadata

public RuntimeMetadata createRuntimeMetadata()
Create a RuntimeMetadata that can be used for testing a connector. This RuntimeMetadata instance will be backed by the metadata from the vdbFile this translation utility instance was created with.

Returns:
RuntimeMetadata for testing


Copyright © 2009. All Rights Reserved.