info.simongibbs.scoof
Class Target

java.lang.Object
  extended byinfo.simongibbs.scoof.Target

public class Target
extends java.lang.Object

Represents a unit of code. Attrinutes include a source file, and the CodeBase object it is associated with.

Version:
$Revision: 1.2 $
Author:
simon

Constructor Summary
Target(CodeBase cb, java.io.File file, java.lang.String contents)
          Generate a new Target
 
Method Summary
static Target createTarget(CodeBase cb, java.io.File file)
          Convenience method for defining and populating a Target object.
 CodeBase getCodeBase()
          A reference to the CodeBAse in which this Target was located.
 java.lang.String getFileContents()
          A String representing the file contents.
 java.io.File getSourceFile()
          An abstract pathname to the target file.
 void setCodeBase(CodeBase base)
          Set the parent code base.
 void setFileContents(java.lang.String string)
          Set the file contents.
 void setSourceFile(java.io.File file)
          Set the abstract pathname which is the focus of this Target.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Target

public Target(CodeBase cb,
              java.io.File file,
              java.lang.String contents)
Generate a new Target

Method Detail

getCodeBase

public CodeBase getCodeBase()
A reference to the CodeBAse in which this Target was located.

Returns:
CodeBase the parent code base

getFileContents

public java.lang.String getFileContents()
A String representing the file contents.

Returns:
String some code

getSourceFile

public java.io.File getSourceFile()
An abstract pathname to the target file.

Returns:
File path and filename

setCodeBase

public void setCodeBase(CodeBase base)
Set the parent code base.

Parameters:
base -

setFileContents

public void setFileContents(java.lang.String string)
Set the file contents.

Parameters:
string -

setSourceFile

public void setSourceFile(java.io.File file)
Set the abstract pathname which is the focus of this Target.

Parameters:
file -

createTarget

public static Target createTarget(CodeBase cb,
                                  java.io.File file)
                           throws java.io.IOException
Convenience method for defining and populating a Target object.

Parameters:
cb - parent code base
file - the source file as spidered
Returns:
a target object.
Throws:
java.io.IOException