Interface JConstructorSymbol
-
- All Superinterfaces:
AnnotableSymbol
,JAccessibleElementSymbol
,JElementSymbol
,JExecutableSymbol
,JTypeParameterOwnerSymbol
public interface JConstructorSymbol extends JExecutableSymbol
Represents a constructor declaration.- Since:
- 7.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
CTOR_NAME
Common dummy name for constructor symbols.-
Fields inherited from interface net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol
PRIMITIVE_PACKAGE
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <R,P>
RacceptVisitor(SymbolVisitor<R,P> visitor, P param)
Dispatch to the appropriate visit method of the visitor and returns its result.default JTypeMirror
getReturnType(Substitution subst)
Return the return type under the given substitution.default String
getSimpleName()
For constructors, this returns the special name "new".default @Nullable N
tryGetNode()
Returns the node that declares this symbol.-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.AnnotableSymbol
getDeclaredAnnotation, getDeclaredAnnotations, isAnnotationPresent
-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol
getModifiers, isStatic
-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.JElementSymbol
equals, getTypeSystem, isUnresolved, nameEquals
-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.JExecutableSymbol
getAnnotatedReceiverType, getArity, getEnclosingClass, getFormalParameters, getFormalParameterTypes, getGenericSignature, getPackageName, getThrownExceptionTypes, hasReceiver, isDefaultMethod, isVarargs
-
Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.JTypeParameterOwnerSymbol
getEnclosingTypeParameterOwner, getLexicalScope, getTypeParameterCount, getTypeParameters, isGeneric
-
-
-
-
Field Detail
-
CTOR_NAME
static final String CTOR_NAME
Common dummy name for constructor symbols.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSimpleName
default String getSimpleName()
For constructors, this returns the special name "new".- Specified by:
getSimpleName
in interfaceJElementSymbol
- Returns:
- the name
-
getReturnType
default JTypeMirror getReturnType(Substitution subst)
Description copied from interface:JExecutableSymbol
Return the return type under the given substitution. For a constructor, return the type of the owner. This type may be annotated.- Specified by:
getReturnType
in interfaceJExecutableSymbol
- See Also:
JConstructorSymbol
-
acceptVisitor
default <R,P> R acceptVisitor(SymbolVisitor<R,P> visitor, P param)
Description copied from interface:JElementSymbol
Dispatch to the appropriate visit method of the visitor and returns its result.- Specified by:
acceptVisitor
in interfaceJElementSymbol
-
tryGetNode
default @Nullable N tryGetNode()
Description copied from interface:JElementSymbol
Returns the node that declares this symbol. Eg forJMethodSymbol
, it's anASTMethodDeclaration
. Will only return non-null if the symbol is declared in the file currently being analysed.- Specified by:
tryGetNode
in interfaceJElementSymbol
-
-