org.mod4j.crossx.broker
Class CrossxEnvironment

java.lang.Object
  extended by org.mod4j.crossx.broker.CrossxEnvironment

public class CrossxEnvironment
extends java.lang.Object

This class is a singleton with static members only. It keeps all CrossX information for DSL models

Author:
Jos Warmer

Method Summary
static void addModelInfo(java.lang.String location, ModelInfo modelinfo)
          Add 'modelinfo' to the location named 'location' in the current environment
static java.util.List<Symbol> findAllEverywhere(java.lang.String symbolType)
          Find all symbols of type 'elemType' in all models in the environment
static java.util.List<Symbol> findAllFromModel(java.lang.String modelname, java.lang.String elemType)
          Find all symbols of type 'elemType' in model named 'modelname' in all locations.
static java.util.List<ModelInfo> findAllModels()
          Find all models in the current environment.
static java.util.List<ModelInfo> findAllModelsInProject(java.lang.String project)
          Find all models in project named 'project'
static java.util.List<Symbol> findAllSymbols(java.lang.String projectLocation, java.lang.String elemType)
          Find all symbols of type 'elemType'.
static java.util.List<Symbol> findAllSymbolsFromModelInProject(java.lang.String project, java.lang.String modelname, java.lang.String elemType)
          Find all symbols of type 'elemType' in model named 'modelname' in project named 'project'.
static java.util.Map<java.lang.String,CrossxLocation> getAll()
          A collection of all locations in this environment.
static boolean isStarted()
          Has the environment been started yet?
static Symbol lookupSymbol(java.lang.String model, java.lang.String symbolname, java.lang.String elemType)
          Lookup a symbol in a model of a certain type
static void removeModelInfo(java.lang.String location, java.lang.String resource)
          Remove'modelinfo' to the location named 'location' in the current environment
static void setPrintStream(java.io.OutputStream s)
          sets the error stream to 's;'
static void setStarted(boolean started)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isStarted

public static boolean isStarted()
Has the environment been started yet?

Returns:

setStarted

public static void setStarted(boolean started)

getAll

public static java.util.Map<java.lang.String,CrossxLocation> getAll()
A collection of all locations in this environment. This is intended to be used for e.g. displaying a tree of all CrossX information.

Returns:

addModelInfo

public static void addModelInfo(java.lang.String location,
                                ModelInfo modelinfo)
Add 'modelinfo' to the location named 'location' in the current environment

Parameters:
location - the name of the location to add to
modelinfo - the ModelInfo to add

removeModelInfo

public static void removeModelInfo(java.lang.String location,
                                   java.lang.String resource)
Remove'modelinfo' to the location named 'location' in the current environment

Parameters:
location - the name of the location to add to
modelinfo - the ModelInfo to add

lookupSymbol

public static Symbol lookupSymbol(java.lang.String model,
                                  java.lang.String symbolname,
                                  java.lang.String elemType)
Lookup a symbol in a model of a certain type

Parameters:
model - The model in which to look for the symbol
symbolname - The name of the symbol to find
elemType - The type of the symbol to find
Returns:
the symbol found, or null if no such symbol could be found

findAllSymbols

public static java.util.List<Symbol> findAllSymbols(java.lang.String projectLocation,
                                                    java.lang.String elemType)
Find all symbols of type 'elemType'.

Parameters:
elemType -
Returns:
The list of names (String) of all found symbols. If there is no such symbol, an empty list.

findAllFromModel

public static java.util.List<Symbol> findAllFromModel(java.lang.String modelname,
                                                      java.lang.String elemType)
Find all symbols of type 'elemType' in model named 'modelname' in all locations.

Parameters:
elemType -
Returns:
The list of names (String) of all found symbols. If there is no such symbol, an empty list.

findAllSymbolsFromModelInProject

public static java.util.List<Symbol> findAllSymbolsFromModelInProject(java.lang.String project,
                                                                      java.lang.String modelname,
                                                                      java.lang.String elemType)
Find all symbols of type 'elemType' in model named 'modelname' in project named 'project'.

Parameters:
project -
modelname -
elemType -
Returns:

findAllModels

public static java.util.List<ModelInfo> findAllModels()
Find all models in the current environment.

Returns:
a list of names of all of the models

findAllModelsInProject

public static java.util.List<ModelInfo> findAllModelsInProject(java.lang.String project)
Find all models in project named 'project'

Parameters:
project -
Returns:
a list of names of the models

findAllEverywhere

public static java.util.List<Symbol> findAllEverywhere(java.lang.String symbolType)
Find all symbols of type 'elemType' in all models in the environment

Parameters:
symbolType -
Returns:
a list of names of all symbols found

setPrintStream

public static void setPrintStream(java.io.OutputStream s)
sets the error stream to 's;'

Parameters:
s -


Copyright © 2010 Mod4j. All Rights Reserved.