|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.mjc.CMember
org.multijava.mjc.CMethod
org.multijava.mjc.CSourceMethod
This class represents a method read from a source code (*.java) file. It stores the fully qualified type signature and the method body.
| Field Summary | |
private boolean |
_isTopLevelAbstractMethod
|
private JBlock |
body
|
private JMethodDeclaration |
declarationASTNode
The AST node corresponding to the declaration of this, may be null. |
private CSourceDispatcherMethod |
dispatcherMethod
|
private CMethodSet |
filteredDispatchers
Stores the filtered dispatcher methods for the external generic function whose top method is this. |
private int |
optimizingLevel
|
private boolean |
used
|
| Fields inherited from class org.multijava.mjc.CMethod |
declarationContext, generatefrom, needsPrivacyModifierRemoved, specArgs, synthetic, topConcreteMethod |
| Fields inherited from class org.multijava.mjc.CMember |
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
CSourceMethod(MemberAccess access,
String ident,
CType returnType,
CSpecializedType[] paramTypes,
CClassType[] exceptions,
CTypeVariable[] typevariables,
boolean deprecated,
JBlock body,
CContextType declarationContext,
JMethodDeclaration declarationASTNode)
Constructs a representation of the method as read from the source file including the type signature and the method body |
|
| Method Summary | |
protected void |
addFilteredDispatcher(CSourceFilteredDispatcherMethod fdm)
Stores a reference to the given filtered dispatcher method. |
CAmbiguousDispatcherClass |
ambiguousDispatcherClass()
Returns the ambiguous-method dispatcher class for this. |
CClass |
anchorClass()
Returns the $anchor class for this generic function. |
JBlock |
body()
Returns the body of this method |
protected MethodInfo |
createCMethodInfo(long modifiers,
String name,
String type,
String genericsignature,
String[] exceptions,
CSourceMethod method,
boolean deprecated,
boolean synthetic)
Creates a method info object. |
protected MethodInfo |
createMethodInfo(long modifiers,
String name,
String type,
String genericsignature,
String[] exceptions,
CodeInfo code,
boolean deprecated,
boolean synthetic)
Creates a method info object. |
JMemberDeclaration |
declarationASTNode()
Returns the AST node for the declaration corresponding to this signature. |
protected String |
dispatcherClassName()
Returns the name of the dispatcher class for this multimethod. |
protected CSourceDispatcherMethod |
dispatcherMethod()
Returns the dispatcher method for this multimethod. |
CDispatcherSignature |
dispatcherSignature()
Returns the $signature class for this. |
protected String[] |
exceptionsAsStringArray()
Returns a string array of the fully qualified names of the exceptions throwable by this. |
protected CMethodSet |
filteredDispatchers()
Returns the filtered dispatcher methods for the external generic function whose top method is this. |
int |
functionNumber()
Returns the function field number for this generic function within its $anchor class. |
CodeInfo |
genCode()
Generates the bytecode for this method |
GenericFunctionInfo |
genGenericFunctionInfo()
Generates the generic function information for this required when generating a class file, or returns null if this method requires no such information. |
ArrayList |
genMethodInfo()
Generate the method information for this for constructing a class file [JVM2 4.6]. |
protected JBlock |
getBody()
|
String |
getGenericSignature()
|
String |
getSignature()
Generates a string giving the type signature of this method. |
boolean |
isTopLevelAbstractMethod()
|
boolean |
isUsed()
Checks whether this method is used. |
void |
markAsTopLevelAbstractMethod()
|
protected MethodInfo |
nonEmptyMethodInfo(String id)
|
int |
optimizingLevel()
Returns the optimizing level of this. |
protected void |
plantBodyBytecode(CodeSequence code)
Plants the bytecode for the body of this method. |
void |
plantFunctionRef(CodeSequence code)
Generates bytecode to put a reference to the external function field for the external generic function
on the JVM stack. |
void |
plantOldFunctionRef(CodeSequence code,
boolean forSuper,
boolean fromOuter)
Generates bytecode to put a reference to the oldFunction field for the external generic function
on the JVM stack. |
protected void |
removePrivacyModifierIfNecessary()
|
protected void |
setDispatcherMethod(CSourceDispatcherMethod dispatcherMethod)
Sets the dispatcher method for this multimethod. |
protected CodeInfo |
setParmsAndOptimizeCode(CodeInfo info)
|
void |
setUsed()
Sets a flag indicating that this method is used |
String |
toString()
Return a string representation of this. |
| Methods inherited from class org.multijava.mjc.CMember |
access, addModifiers, deprecated, getCClass, getCCompilationUnit, getField, getIdent, getJavaName, getOwnerName, getQualNameWithSeparator, hasDefaultAccess, hasProtectedVisibilityIn, host, ident, isAccessibleFrom, isDeclaredNonNull, isDeprecated, isFinal, isLocalTo, isPrivate, isProtected, isPublic, isStatic, modifiers, owner, qualifiedName, setModifiers |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private JBlock body
private boolean used
private int optimizingLevel
private CSourceDispatcherMethod dispatcherMethod
private boolean _isTopLevelAbstractMethod
private CMethodSet filteredDispatchers
private JMethodDeclaration declarationASTNode
| Constructor Detail |
public CSourceMethod(MemberAccess access,
String ident,
CType returnType,
CSpecializedType[] paramTypes,
CClassType[] exceptions,
CTypeVariable[] typevariables,
boolean deprecated,
JBlock body,
CContextType declarationContext,
JMethodDeclaration declarationASTNode)
access - contains the info used to determine accessibility of this methodident - the ident of this methodreturnType - the return type of this methodparamTypes - the parameter types of this methodexceptions - a list of all exceptions in the throws listdeprecated - is this method deprecatedbody - the source codedeclarationContext - the context in which this method is declareddeclarationASTNode - the AST node corresponding to the
declaration of this, may be null| Method Detail |
public boolean isUsed()
public void setUsed()
public JBlock body()
public int optimizingLevel()
protected void setDispatcherMethod(CSourceDispatcherMethod dispatcherMethod)
dispatcherMethod - a CSourceDispatcherMethod valueprotected CSourceDispatcherMethod dispatcherMethod()
protected String dispatcherClassName()
requires topConcreteMethod.isExternal();
protected void addFilteredDispatcher(CSourceFilteredDispatcherMethod fdm)
protected CMethodSet filteredDispatchers()
public String toString()
toString in class CMethodpublic JMemberDeclaration declarationASTNode()
also ensures \result instanceof JMethodDeclaration;
declarationASTNode in interface SigSourceMemberpublic ArrayList genMethodInfo()
CMethod
genMethodInfo in class CMethodprotected MethodInfo nonEmptyMethodInfo(String id)
protected MethodInfo createCMethodInfo(long modifiers,
String name,
String type,
String genericsignature,
String[] exceptions,
CSourceMethod method,
boolean deprecated,
boolean synthetic)
protected MethodInfo createMethodInfo(long modifiers,
String name,
String type,
String genericsignature,
String[] exceptions,
CodeInfo code,
boolean deprecated,
boolean synthetic)
protected String[] exceptionsAsStringArray()
genMethodInfo.
genMethodInfo()public GenericFunctionInfo genGenericFunctionInfo()
genGenericFunctionInfo in class CMethodpublic void plantFunctionRef(CodeSequence code)
function field for the external generic function
on the JVM stack.
also requires topConcreteMethod == this; requires this.isExternal(); requires_redundantly dispatcherMethod != null;
public void plantOldFunctionRef(CodeSequence code,
boolean forSuper,
boolean fromOuter)
oldFunction field for the external generic function
on the JVM stack.
also requires this.isExternal();
code - the code sequence to add the bytecode toforSuper - if true, then this is for a super send, which,
under RMJ, should start from the oldSuperFunction
rather than oldFunctionfromOuter - if true, then generates a reference that works from the
outer class context, otherwise generates a reference that
works from within the dispatcher classpublic CDispatcherSignature dispatcherSignature()
also requires this.isExternal(); requires_redundantly dispatcherMethod != null;
public CAmbiguousDispatcherClass ambiguousDispatcherClass()
also requires this.isExternal(); requires_redundantly dispatcherMethod != null;
public CClass anchorClass()
also requires this.isExternal(); requires_redundantly dispatcherMethod != null;
public int functionNumber()
also requires this.isExternal(); requires_redundantly dispatcherMethod != null;
public String getSignature()
getSignature in class CMethodpublic String getGenericSignature()
getGenericSignature in class CMethodpublic CodeInfo genCode()
protected void plantBodyBytecode(CodeSequence code)
genCode() so subclasses my replace standard
body bytecode with specialized code.
genCode()protected CodeInfo setParmsAndOptimizeCode(CodeInfo info)
protected void removePrivacyModifierIfNecessary()
public boolean isTopLevelAbstractMethod()
public void markAsTopLevelAbstractMethod()
protected JBlock getBody()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||