public class ParameterDefinition extends VariableDefinition implements IParameterDefinition
After a parameter definition is in the symbol table, it should always be
accessed through the read-only IParameterDefinition
interface.
IVariableDefinition.VariableClassification
initValue
FLAG_CAST_FUNCTION, FLAG_CONSTRUCTOR, FLAG_CONTINGENT, FLAG_DECLARED_IN_CONTROL_FLOW, FLAG_DEFAULT, FLAG_DEPRECATED, FLAG_DYNAMIC, FLAG_FINAL, FLAG_GENERATED_EMBED_CLASS, FLAG_HAS_INIT, FLAG_IMPLICIT, FLAG_NATIVE, FLAG_OVERRIDE, FLAG_REST, FLAG_STATIC, flags, nodeRef, singletonEmptyMetaTags
Constructor and Description |
---|
ParameterDefinition(String name) |
Modifier and Type | Method and Description |
---|---|
void |
buildInnerString(StringBuilder sb)
For debugging only.
|
IParameterNode |
getNode()
Returns the
IDefinitionNode from which this definition was
created, if the definition came from the AST for a source file. |
protected DependencyType |
getTypeDependencyType()
Gets the
DependencyType that should be used when resolving the
type of this variable definition. |
IVariableDefinition.VariableClassification |
getVariableClassification()
Get the classification for this variable (local, parameter, class member,
etc)
|
boolean |
hasDefaultValue() |
boolean |
isRest()
Returns true if this argument is a rest-style argument, signified by ...
|
boolean |
matches(DefinitionBase node) |
Object |
resolveDefaultValue(ICompilerProject project)
Attempt to resolve the default value assigned to this parameter.
|
void |
setDefaultValue(Object value) |
void |
setHasDefault() |
void |
setRest() |
declaredInControlFlow, getInitExpression, getVariableNode, isRequiredSkinPart, isSkinPart, resolveInitialValue, setDeclaredInControlFlow, setInitializer
addMetaTag, buildString, getAbsoluteEnd, getAbsoluteStart, getAllMetaTags, getAncestorOfType, getArrayElementType, getBaseName, getBindableEventNames, getColumn, getContainingASScope, getContainingFilePath, getContainingScope, getContainingSourceFilePath, getDefinition, getDeprecationInfo, getEnd, getExplicitSourceComment, getFileScope, getFileSpecification, getInstanceType, getLine, getLocationString, getMaxSize, getMetaTagByName, getMetaTagsByName, getMName, getModifiers, getNameColumn, getNameEnd, getNameLine, getNamespaceReference, getNamespaceReferenceAsString, getNameStart, getPackageName, getParent, getPercentProxy, getQualifiedName, getSize, getSkinPart, getSourcePath, getStart, getStorageName, getTypeAsDisplayString, getTypeReference, hasCollapseWhiteSpace, hasExplicitComment, hasMetaTagByName, hasModifier, hasNamespace, hasRichTextContent, inPackageNamespace, isBindable, isBindableStyle, isColor, isContingent, isContingentNeeded, isDeprecated, isDynamic, isEmpty, isFinal, isGeneratedEmbedClass, isImplicit, isInProject, isInternal, isNative, isOverride, isPrivate, isProtected, isPublic, isRequiredSkinPart, isStatic, isTopLevelDefinition, resolveNamespace, resolveType, resolveType, resolveType, resolveType, resolveType, setBindable, setContainingScope, setContingent, setDynamic, setFinal, setGeneratedEmbedClass, setImplicit, setLocation, setMetaTags, setModifier, setNameLocation, setNamespaceReference, setNative, setNode, setOverride, setPublic, setStatic, setTypeReference, toStorageName, toString, unsetOverride, verify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getArrayElementType, getInstanceType, getPercentProxy, getVariableNode, hasCollapseWhiteSpace, hasRichTextContent, isColor, isRequiredSkinPart, isSkinPart, resolveInitialValue
getExplicitSourceComment, hasExplicitComment
getAbsoluteEnd, getAbsoluteStart, getAllMetaTags, getAncestorOfType, getBaseName, getBindableEventNames, getColumn, getContainingFilePath, getContainingScope, getContainingSourceFilePath, getDeprecationInfo, getEnd, getLine, getMetaTagByName, getMetaTagsByName, getModifiers, getNameColumn, getNameEnd, getNameLine, getNamespaceReference, getNameStart, getPackageName, getParent, getQualifiedName, getSourcePath, getStart, getTypeAsDisplayString, getTypeReference, hasMetaTagByName, hasModifier, hasNamespace, isBindable, isBindableStyle, isContingent, isContingentNeeded, isDeprecated, isDynamic, isFinal, isGeneratedEmbedClass, isImplicit, isInProject, isInternal, isNative, isOverride, isPrivate, isProtected, isPublic, isStatic, resolveNamespace, resolveType
public ParameterDefinition(String name)
public boolean isRest()
IParameterDefinition
isRest
in interface IParameterDefinition
public void setRest()
public boolean hasDefaultValue()
hasDefaultValue
in interface IParameterDefinition
public void setHasDefault()
public void setDefaultValue(Object value)
public Object resolveDefaultValue(ICompilerProject project)
IParameterDefinition
resolveDefaultValue
in interface IParameterDefinition
project
- the Project to resolve things inprotected DependencyType getTypeDependencyType()
VariableDefinition
DependencyType
that should be used when resolving the
type of this variable definition.
This method is intended to be overridden by sub-classes.
getTypeDependencyType
in class VariableDefinition
DependencyType
that should be used when resolving the
type of this variable definitionpublic IParameterNode getNode()
IDefinition
IDefinitionNode
from which this definition was
created, if the definition came from the AST for a source file.
This method may require the AST to be reloaded or regenerated and therefore may be slow.
More specific definition interfaces such as IClassDefinition
redeclare this method to return a more specific node interface such as
IClassNode
.
getNode
in interface IDefinition
getNode
in interface IParameterDefinition
getNode
in class VariableDefinition
public boolean matches(DefinitionBase node)
matches
in class VariableDefinition
public void buildInnerString(StringBuilder sb)
buildInnerString
in class VariableDefinition
public final IVariableDefinition.VariableClassification getVariableClassification()
IVariableDefinition
getVariableClassification
in interface IVariableDefinition
getVariableClassification
in class VariableDefinition
Copyright © 2016 The Apache Software Foundation. All rights reserved.