xdc.services.spec
Class BrowserSession

java.lang.Object
  extended by xdc.services.spec.Session
      extended by xdc.services.spec.BrowserSession

public class BrowserSession
extends Session


Field Summary
 
Fields inherited from class xdc.services.spec.Session
msg
 
Constructor Summary
BrowserSession()
          Create a session to browse the current package path.
BrowserSession(xdc.services.global.Env env)
          Create a new session with a given environment
BrowserSession(xdc.services.global.Env env, Cache cache)
           
BrowserSession(java.lang.String[] dirs)
          Create a new session with a given package path
BrowserSession(java.lang.String[] dirs, xdc.services.global.Env env)
          Create a new session with a given package path and environment
 
Method Summary
 Pkg findPkg(java.lang.String qn)
           
 boolean getLoadDocs()
          Return whether documentation is available in this session.
 boolean isCurrentPkg(Pkg pkg)
           
 boolean isCurrentPkg(java.lang.String cpath, java.lang.String qn)
           
 java.lang.String isPkgDir(java.lang.String dir)
          Check whether the named directory contains a built package.
 Pkg loadPkg(java.lang.String dir, java.lang.String qn)
           
 Unit loadUnit(java.lang.String name)
          Load the named unit's spec object by searching the package path.
 java.util.Map<java.lang.String,java.lang.String> scanDirectories()
          Return a Map of package names indexed by the canonical path to the package's base.
 java.util.Map<java.lang.String,java.lang.String> scanRepositories()
          Return a Map all package base directories indexed by the package's name.
 void setLoadDocs(boolean loadDocs)
          Set whether this session should preserve docs in Nodes.
 
Methods inherited from class xdc.services.spec.Session
findDecl, findDecl, findUnit, findUnit, getEnv, getVers, setEnv, setErr, setWarnings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserSession

public BrowserSession()
Create a session to browse the current package path.


BrowserSession

public BrowserSession(xdc.services.global.Env env)
Create a new session with a given environment


BrowserSession

public BrowserSession(xdc.services.global.Env env,
                      Cache cache)

BrowserSession

public BrowserSession(java.lang.String[] dirs)
Create a new session with a given package path


BrowserSession

public BrowserSession(java.lang.String[] dirs,
                      xdc.services.global.Env env)
Create a new session with a given package path and environment

Method Detail

findPkg

public Pkg findPkg(java.lang.String qn)
Overrides:
findPkg in class Session

isCurrentPkg

public boolean isCurrentPkg(Pkg pkg)

isCurrentPkg

public boolean isCurrentPkg(java.lang.String cpath,
                            java.lang.String qn)

loadPkg

public Pkg loadPkg(java.lang.String dir,
                   java.lang.String qn)

isPkgDir

public java.lang.String isPkgDir(java.lang.String dir)
Check whether the named directory contains a built package.

Parameters:
dir - the pathname to the directory to check.
Returns:
the fully qualified package name, or else null if the directory is not recognizably a built package.

loadUnit

public Unit loadUnit(java.lang.String name)
Load the named unit's spec object by searching the package path.

Parameters:
name - Package-qualified name of the module or interface.
Returns:
unit, or null if not found.

scanDirectories

public java.util.Map<java.lang.String,java.lang.String> scanDirectories()
Return a Map of package names indexed by the canonical path to the package's base.


scanRepositories

public java.util.Map<java.lang.String,java.lang.String> scanRepositories()
Return a Map all package base directories indexed by the package's name.


setLoadDocs

public void setLoadDocs(boolean loadDocs)
Set whether this session should preserve docs in Nodes. If false, spec objects loaded by this session will not contain documentation. This is a Java heap memory optimization. Default is to load documentation.


getLoadDocs

public boolean getLoadDocs()
Return whether documentation is available in this session. Default is to load documentation.