org.mesopotamia
Class SourceUnit

java.lang.Object
  extended by VisitableBase
      extended by org.mesopotamia.SourceUnit
Direct Known Subclasses:
AstSourceUnit

public class SourceUnit
extends VisitableBase

Represents source unit, e.g. java source file

Author:
Pavel Vlasov

Constructor Summary
protected SourceUnit(org.mesopotamia.sql.SourceUnit dbData, Scan scan, RepositoryLanguage repoLanguage, java.util.Collection<java.lang.Number> loadLevels)
          Instances of SourceUnit shall be created only by repository
 
Method Summary
 java.lang.Object getAttribute(java.lang.Object key)
           
 java.lang.String getDigest()
           
 java.util.Collection<LoadError> getErrors()
           
 int getId()
           
 RepositoryLanguage getLanguage()
           
 java.lang.Object getLevelData(java.lang.String levelName)
           
 java.util.Collection<java.lang.Number> getLoadLevels()
           
 java.lang.String getName()
           
 Namespace getNamespace()
          Namespace shall be retrieved from repository
 java.lang.String getPath()
           
 HtmlRenderer getRenderer(Context context)
          Returns renderer to render this source unit to HTML.
 Scan getScan()
           
 java.lang.String getSignature()
          Returns signature, which is path.
 java.lang.Long getSize()
           
 java.lang.Object removeAttribute(java.lang.Object key)
           
 void setAttribute(java.lang.Object key, java.lang.Object value)
           
 void show()
          Shows source unit in browser.
 void toDom(org.w3c.dom.Element holder)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SourceUnit

protected SourceUnit(org.mesopotamia.sql.SourceUnit dbData,
                     Scan scan,
                     RepositoryLanguage repoLanguage,
                     java.util.Collection<java.lang.Number> loadLevels)
              throws MesopotamiaException
Instances of SourceUnit shall be created only by repository

Throws:
java.sql.SQLException
MesopotamiaException
Method Detail

getId

public int getId()

getName

public java.lang.String getName()

getNamespace

public Namespace getNamespace()
Namespace shall be retrieved from repository

Returns:

getPath

public java.lang.String getPath()

getDigest

public java.lang.String getDigest()

getSize

public java.lang.Long getSize()

getLanguage

public RepositoryLanguage getLanguage()

getScan

public Scan getScan()

toDom

public void toDom(org.w3c.dom.Element holder)

getSignature

public java.lang.String getSignature()
Returns signature, which is path.


getLoadLevels

public java.util.Collection<java.lang.Number> getLoadLevels()
Returns:
load levels of this source unit. Elements are of type org.mesopotamia.sql.SourceUnitSuccessfulLoadLevels

toString

public java.lang.String toString()

getErrors

public java.util.Collection<LoadError> getErrors()

getLevelData

public java.lang.Object getLevelData(java.lang.String levelName)
Parameters:
levelName -
Returns:
Load level data for given source unit. This method returns only scan-independent data.
Throws:
MesopotamiaException

show

public void show()
Shows source unit in browser. Use it for debugging.


getAttribute

public java.lang.Object getAttribute(java.lang.Object key)

removeAttribute

public java.lang.Object removeAttribute(java.lang.Object key)

setAttribute

public void setAttribute(java.lang.Object key,
                         java.lang.Object value)

getRenderer

public HtmlRenderer getRenderer(Context context)
Returns renderer to render this source unit to HTML.

Parameters:
context - Renderer configuration parameters.
Returns:
renderer or null if source unit does not support rendering.


Copyright © 2005 Hammurapi Group. All Rights Reserved.