Interface JConstructorSymbol
- All Superinterfaces:
AnnotableSymbol,JAccessibleElementSymbol,JElementSymbol,JExecutableSymbol,JTypeParameterOwnerSymbol
Represents a constructor declaration.
- Since:
- 7.0.0
-
Field Summary
FieldsFields inherited from interface net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol
PRIMITIVE_PACKAGE -
Method Summary
Modifier and TypeMethodDescriptiondefault <R,P> R acceptVisitor(SymbolVisitor<R, P> visitor, P param) Dispatch to the appropriate visit method of the visitor and returns its result.default JTypeMirrorgetReturnType(Substitution subst) Return the return type under the given substitution.default StringFor constructors, this returns the special name "new".default ASTConstructorDeclarationReturns the node that declares this symbol.Methods inherited from interface net.sourceforge.pmd.lang.java.symbols.AnnotableSymbol
getDeclaredAnnotation, getDeclaredAnnotations, isAnnotationPresentMethods inherited from interface net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol
getModifiers, isStaticMethods inherited from interface net.sourceforge.pmd.lang.java.symbols.JElementSymbol
equals, getTypeSystem, isUnresolved, nameEqualsMethods inherited from interface net.sourceforge.pmd.lang.java.symbols.JExecutableSymbol
getAnnotatedReceiverType, getArity, getEnclosingClass, getFormalParameters, getFormalParameterTypes, getGenericSignature, getPackageName, getThrownExceptionTypes, hasReceiver, isDefaultMethod, isVarargsMethods inherited from interface net.sourceforge.pmd.lang.java.symbols.JTypeParameterOwnerSymbol
getEnclosingTypeParameterOwner, getLexicalScope, getTypeParameterCount, getTypeParameters, isGeneric
-
Field Details
-
CTOR_NAME
Common dummy name for constructor symbols.- See Also:
-
-
Method Details
-
getSimpleName
For constructors, this returns the special name "new".- Specified by:
getSimpleNamein interfaceJElementSymbol- Returns:
- the name
-
getReturnType
Description copied from interface:JExecutableSymbolReturn the return type under the given substitution. For a constructor, return the type of the owner. This type may be annotated.- Specified by:
getReturnTypein interfaceJExecutableSymbol- See Also:
-
acceptVisitor
Description copied from interface:JElementSymbolDispatch to the appropriate visit method of the visitor and returns its result.- Specified by:
acceptVisitorin interfaceJElementSymbol
-
tryGetNode
Description copied from interface:JElementSymbolReturns 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:
tryGetNodein interfaceJElementSymbol
-