entities
Class Variable

java.lang.Object
  extended byentities.Variable

public class Variable
extends java.lang.Object

The Variable class represents the information regarding a generic variable declaration.


Field Summary
static int FIELD
           
static int GLOBAL
           
static int LOCAL
           
static java.lang.String PRIVATE
           
static java.lang.String PROTECTED
           
static java.lang.String PUBLIC
           
 
Constructor Summary
Variable(ScopeManager parentScope, java.lang.String name, java.lang.String file, int position, boolean staticFlag, int depth, java.lang.String type)
          Construct a new Variable (type normal)
Variable(ScopeManager parentScope, java.lang.String name, java.lang.String file, int position, boolean staticFlag, int depth, java.lang.String accessType, java.lang.String type)
          Construct a new Variable (type field)
 
Method Summary
 void addContainedObjectType(java.lang.String type)
          Executed after container analysis has been run, it adds the type of a contained object to the list of types contained inside the container associated with the current variable
static void createTable(java.sql.Connection dbConnection)
           
static void delete(java.sql.Connection dbConnection, int id)
           
 java.lang.String getAccessType()
           
 java.lang.String getClassName()
           
 java.util.HashSet getContainedObjectTypes()
           
 java.lang.String getFile()
           
 java.lang.String getName()
           
 ScopeManager getParent()
           
 int getPosition()
           
 int getScope()
           
 java.lang.String getType()
           
 void insert(java.sql.Connection dbConnection, int sourceId, int sourceType)
           
 boolean isConst()
           
 boolean isStatic()
           
 void print(java.lang.String indentation)
          Print all information in a Variable object
 void setClassName(java.lang.String className)
          Set the name of the class in which the variable is declared
 void setParentScope(ScopeManager parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL

public static final int GLOBAL
See Also:
Constant Field Values

FIELD

public static final int FIELD
See Also:
Constant Field Values

LOCAL

public static final int LOCAL
See Also:
Constant Field Values

PRIVATE

public static final java.lang.String PRIVATE
See Also:
Constant Field Values

PROTECTED

public static final java.lang.String PROTECTED
See Also:
Constant Field Values

PUBLIC

public static final java.lang.String PUBLIC
See Also:
Constant Field Values
Constructor Detail

Variable

public Variable(ScopeManager parentScope,
                java.lang.String name,
                java.lang.String file,
                int position,
                boolean staticFlag,
                int depth,
                java.lang.String accessType,
                java.lang.String type)
Construct a new Variable (type field)

Parameters:
parentScope - Parent entity object
name - Name of the variable
file - Name of the file containing the variable
position - Position of the variable in the file
staticFlag - Flag that says if a variable is static
accessType - Type of access
type - Type of the variable

Variable

public Variable(ScopeManager parentScope,
                java.lang.String name,
                java.lang.String file,
                int position,
                boolean staticFlag,
                int depth,
                java.lang.String type)
Construct a new Variable (type normal)

Parameters:
parentScope - Parent entity object
name - Name of the variable
file - Name of the file containing the variable
position - Position of the variable in the file
staticFlag - Flag that says if a variable is static
type - Type of the variable
Method Detail

getName

public java.lang.String getName()
Returns:
the string corresponding to the name of the variable

getFile

public java.lang.String getFile()
Returns:
the string corresponding to the file in which the variable is

getPosition

public int getPosition()
Returns:
an integer corresponding to the position (of the name) in the file

getClassName

public java.lang.String getClassName()
Returns:
the string corresponding to the name of the class in which the variable is declared or null if the variable is declared outside (at global level or in a function)

getAccessType

public java.lang.String getAccessType()
Returns:
the string corresponding to the access type of the variable if it is a field and null otherwise

getType

public java.lang.String getType()
Returns:
the string corresponding to the type of the variable

getParent

public ScopeManager getParent()
Returns:
the parent ScopeManager

getScope

public int getScope()
Returns:
the scope of the Variable (GLOBAL, FIELD, LOCAL)

getContainedObjectTypes

public java.util.HashSet getContainedObjectTypes()
Returns:
If the variable is a container field and the container analysis is ON it returns the set of types the variable can contain.

isConst

public boolean isConst()
Returns:
true if the variable is constant

isStatic

public boolean isStatic()
Returns:
true if the variable is static

setClassName

public void setClassName(java.lang.String className)
Set the name of the class in which the variable is declared


addContainedObjectType

public void addContainedObjectType(java.lang.String type)
Executed after container analysis has been run, it adds the type of a contained object to the list of types contained inside the container associated with the current variable


print

public void print(java.lang.String indentation)
Print all information in a Variable object


setParentScope

public void setParentScope(ScopeManager parent)
Parameters:
parent - represents the scope inside which the variable is declared

delete

public static void delete(java.sql.Connection dbConnection,
                          int id)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

createTable

public static void createTable(java.sql.Connection dbConnection)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

insert

public void insert(java.sql.Connection dbConnection,
                   int sourceId,
                   int sourceType)
            throws java.sql.SQLException
Throws:
java.sql.SQLException