public class JConstructor extends JMethod
HasName.Util
NULL_METHOD, signature
Constructor and Description |
---|
JConstructor(SourceInfo info,
JClassType enclosingType) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBePolymorphic()
Returns true if this method can participate in virtual dispatch.
|
JMethodBody |
getBody() |
JClassType |
getEnclosingType() |
JNonNullType |
getNewType() |
boolean |
isConstructor() |
boolean |
isEmpty()
Returns
true if this constructor does no real work. |
boolean |
needsVtable()
Returns
true if this method can participate in instance
dispatch. |
void |
traverse(JVisitor visitor,
Context ctx)
Causes this object to have the visitor visit itself and its children.
|
protected Object |
writeReplace() |
addOverride, addOverrides, addParam, addThrownException, addThrownExceptions, freezeParamTypes, getAccess, getExternalizedMethod, getName, getOriginalParamTypes, getOriginalReturnType, getOverrides, getParams, getSignature, getThrownExceptions, getType, isAbstract, isDefault, isExternal, isFinal, isNative, isPrivate, isStatic, isSynthetic, isTrace, removeParam, resolve, setAbstract, setBody, setFinal, setOriginalTypes, setSynthetic, setTrace, setType, traceAfter, traceBefore, visitChildren
getSourceInfo, setSourceInfo, toSource, toString
public JConstructor(SourceInfo info, JClassType enclosingType)
public boolean canBePolymorphic()
JMethod
canBePolymorphic
in class JMethod
public JMethodBody getBody()
public JClassType getEnclosingType()
getEnclosingType
in interface HasEnclosingType
getEnclosingType
in class JMethod
public JNonNullType getNewType()
public boolean isConstructor()
isConstructor
in class JMethod
public boolean isEmpty()
true
if this constructor does no real work.
NOTE: this method does NOT account for any clinits that would be triggered
if this constructor is the target of a new instance operation from an
external class.
TODO(scottb): make this method less expensive by computing in an external
visitor.public boolean needsVtable()
JMethod
true
if this method can participate in instance
dispatch.needsVtable
in class JMethod
public void traverse(JVisitor visitor, Context ctx)
JVisitable
traverse
in interface JVisitable
traverse
in class JMethod
visitor
- the visitor that should traverse this nodectx
- the context of an existing traversalprotected Object writeReplace()
writeReplace
in class JMethod
Copyright © 2018. All rights reserved.