net.sf.plb4jedit.plb
Class ResourceManager

java.lang.Object
  extended bynet.sf.plb4jedit.plb.ResourceManager

public class ResourceManager
extends Object

Description: manages Plb includes of a program to access all interesting resources of a program (other includes, variable declaration, label definitions).
Notice that on an include not everything may be resolved because the resources are always relative to the source-file and contain everything defined in the souce file and its includes (recursively).

Version:
$Header: /cvsroot/plb4jedit/plb4jedit/Plb/src/java/net/sf/plb4jedit/plb/ResourceManager.java,v 1.1 2003/11/04 17:40:31 skopp Exp $
Author:
Peter Schaefer

Constructor Summary
ResourceManager(String plbPath, PlbSource program)
          constructs a ResourceManager from a PlbSource and a PLB_PATH.
 
Method Summary
 Set getIncludes()
           
 TreeMap getLabels()
           
 TreeMap getVariables()
           
 Label searchLabel(String label)
          searches for a label name and returns a label object, which gives access to the source file and line number where this label is defined.
 Variable searchVariable(String varname)
          searches for a Variable name and returns a Variable object which gives access to the source file and line-number where this variable is defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager(String plbPath,
                       PlbSource program)
                throws FileNotFoundException,
                       IOException
constructs a ResourceManager from a PlbSource and a PLB_PATH. This path is used to resolve all includes found in the source.

Parameters:
plbPath - PLB_PATH to search for includes.
program - absolute path of the source file name.
Throws:
FileNotFoundException - if source can not be resolved or an include is not found in the path
IOException - if source can not be resolved or an include is not found in the path
Method Detail

searchVariable

public Variable searchVariable(String varname)
searches for a Variable name and returns a Variable object which gives access to the source file and line-number where this variable is defined.

Parameters:
varname - to search for
Returns:
the variable with the name varname or null if varname is not found.

searchLabel

public Label searchLabel(String label)
searches for a label name and returns a label object, which gives access to the source file and line number where this label is defined.

Parameters:
label - to search for
Returns:
the Label with the given name or null if the label cann't be found.

getIncludes

public Set getIncludes()
Returns:
a set of inlcudes includes by this file.

getLabels

public TreeMap getLabels()
Returns:
containing all labels defined in the source file and its includes

getVariables

public TreeMap getVariables()
Returns:
containing all variables defined in the source file and its includes


Copyright © 2003 Riege Software Internationl. All Rights Reserved.