openjava.ptree.util
Class TypeNameQualifier

java.lang.Object
  |
  +--openjava.ptree.util.ParseTreeVisitor
        |
        +--openjava.ptree.util.EvaluationShuttle
              |
              +--openjava.ptree.util.ScopeHandler
                    |
                    +--openjava.ptree.util.TypeNameQualifier

public class TypeNameQualifier
extends ScopeHandler

The class TypeNameQualifier is a utility class to be usede for making a copy of ptree work well without import statements.

Since:
%SOFTWARE% 1.0
Version:
1.0
Author:
Michiaki Tatsubori
See Also:
Object

Field Summary
private  String newName
           
 
Fields inherited from class openjava.ptree.util.ScopeHandler
 
Fields inherited from class openjava.ptree.util.EvaluationShuttle
 
Constructor Summary
TypeNameQualifier(Environment env)
          Constructs a new visitor for parse tree for qualifying each type name appearing there.
TypeNameQualifier(Environment env, String newClassName)
          Constructs a new visitor for parse tree for qualifying each type name appearing there.
 
Method Summary
private  String qualify(String org)
           
private  TypeName qualifyName(TypeName name)
           
private  TypeName[] qualifyNames(TypeName[] names)
           
 void visit(ClassDeclaration c)
           
 void visit(ClassLiteral clit)
          This is needed because of a bug.
 void visit(ConstructorDeclaration c)
           
 void visit(MethodDeclaration m)
           
 void visit(TypeName tname)
           
 
Methods inherited from class openjava.ptree.util.ScopeHandler
evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, pop, push, pushClosedEnvironment
 
Methods inherited from class openjava.ptree.util.EvaluationShuttle
evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, getEnvironment, setEnvironment, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class openjava.ptree.util.ParseTreeVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newName

private String newName
Constructor Detail

TypeNameQualifier

public TypeNameQualifier(Environment env)
Constructs a new visitor for parse tree for qualifying each type name appearing there.

Parameters:
env - environment for qualifying type names.

TypeNameQualifier

public TypeNameQualifier(Environment env,
                         String newClassName)
Constructs a new visitor for parse tree for qualifying each type name appearing there.

Parameters:
env - environment for qualifying type names.
newClassName - the class name for constructors. If null is specified, the name for constructors will remain as is.
Method Detail

qualify

private String qualify(String org)

qualifyName

private TypeName qualifyName(TypeName name)

qualifyNames

private TypeName[] qualifyNames(TypeName[] names)

visit

public void visit(ClassDeclaration c)
           throws ParseTreeException
Overrides:
visit in class EvaluationShuttle
ParseTreeException

visit

public void visit(ConstructorDeclaration c)
           throws ParseTreeException
Overrides:
visit in class EvaluationShuttle
ParseTreeException

visit

public void visit(MethodDeclaration m)
           throws ParseTreeException
Overrides:
visit in class EvaluationShuttle
ParseTreeException

visit

public void visit(TypeName tname)
           throws ParseTreeException
Overrides:
visit in class EvaluationShuttle
ParseTreeException

visit

public void visit(ClassLiteral clit)
           throws ParseTreeException
This is needed because of a bug.

Overrides:
visit in class EvaluationShuttle
ParseTreeException

SourceForge.net_Logo