public class JConstructor extends JMethod
isJsProperty
JMethod.Specialization
HasName.Util
BY_SIGNATURE_COMPARATOR, NULL_METHOD, signature
BY_NAME_COMPARATOR
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 |
isDefaultConstructor()
True if the constructor is default, auto-synthesized.
|
boolean |
isEmpty()
Returns
true if this constructor does no real work. |
boolean |
needsVtable()
Returns
true if this method can participate in instance
dispatch. |
void |
setDefaultConstructor() |
void |
traverse(JVisitor visitor,
Context ctx)
Causes this object to have the visitor visit itself and its children.
|
protected Object |
writeReplace() |
addOverriddenMethod, addParam, addThrownException, addThrownExceptions, exposesOverriddenPackagePrivateMethod, freezeParamTypes, getAccess, getExportName, getExternalizedMethod, getJsniSignature, getName, getOriginalParamTypes, getOriginalReturnType, getOverriddenMethods, getParams, getQualifiedExportName, getSignature, getSpecialization, getThrownExceptions, getType, isAbstract, isDefault, isExternal, isFinal, isInliningAllowed, isJsProperty, isNative, isNoExport, isPrivate, isStatic, isSynthetic, isTrace, removeParam, removeSpecialization, resolve, setAbstract, setBody, setExportName, setFinal, setInliningAllowed, setJsProperty, setNoExport, setOriginalTypes, setSpecialization, setSynthetic, setTrace, setType, traceAfter, traceBefore, visitChildren
getSourceInfo, setSourceInfo, toSource, toString
public JConstructor(SourceInfo info, JClassType enclosingType)
public void setDefaultConstructor()
public boolean isDefaultConstructor()
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.