org.prorefactor.refactor.source
Class IncludeExpansion

java.lang.Object
  extended by org.prorefactor.refactor.source.Expansion
      extended by org.prorefactor.refactor.source.IncludeExpansion
All Implemented Interfaces:
TETNode

public class IncludeExpansion
extends Expansion

Represents a curly reference to an include file. Note that for any one curly that expands to an include file, it is possible (but uncommon) to have multiple expansions. That only happens when the filename itself is a curly expansion with multiple possible values.

Note that this model will also allow for multiple possible expansions due to multiple possible PROPATH configurations. We have no short term plans to implement support for this, but it is an important consideration in the design of this model.


Method Summary
 java.util.Map getArgsByName()
          The map from an argument name to the argument Declaration object.
 java.util.ArrayList getArgsByNumber()
          The list of argument Declaration objects that we can refer to by number.
 CompileUnit getCompileUnit()
          Mostly null, except for the main.p expansion.
 java.lang.String getFilenameRefText()
          The text used for refering to an include file, in other words, the first token that came after the opening curly.
 SourceFile getSourceFile()
           
 java.io.File nearestEnclosingFile()
          Find the nearest enclosing File, ignoring that the *actual* text for the Token may have come from a Declaration some number of layers higher.
 void setSourceFile(SourceFile file)
           
 java.lang.String toStringSub()
          Use this method to display the subclass's attributes in XML subnode text (will be subnodes of an node).
 
Methods inherited from class org.prorefactor.refactor.source.Expansion
getDerivation, getFirstToken, isParsed, isPrimary, setParsed, setPrimary, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getArgsByName

public java.util.Map getArgsByName()
The map from an argument name to the argument Declaration object. Is null if there were no args or if numbered (not named) arguments were used. The key is a String, the value is a List of Declaration objects. Each named arg may have multiple possible values due to nested curlies.


getArgsByNumber

public java.util.ArrayList getArgsByNumber()
The list of argument Declaration objects that we can refer to by number. Is null if there were no arguments. Each entry is itself a List, because each argument may itself have multiple possible expansions due to nested curlies.


getCompileUnit

public CompileUnit getCompileUnit()
Mostly null, except for the main.p expansion. Only has a value when parentToken==null;


getFilenameRefText

public java.lang.String getFilenameRefText()
The text used for refering to an include file, in other words, the first token that came after the opening curly.


getSourceFile

public SourceFile getSourceFile()

nearestEnclosingFile

public java.io.File nearestEnclosingFile()
Description copied from interface: TETNode
Find the nearest enclosing File, ignoring that the *actual* text for the Token may have come from a Declaration some number of layers higher. Useful for reporting errors.


setSourceFile

public void setSourceFile(SourceFile file)

toStringSub

public java.lang.String toStringSub()
Description copied from class: Expansion
Use this method to display the subclass's attributes in XML subnode text (will be subnodes of an node).

Specified by:
toStringSub in class Expansion


Copyright © 2008 Joanju Software. All Rights Reserved.