Package de.fraunhofer.aisec.cpg.graph
Class ValueDeclaration
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.graph.Node
-
- de.fraunhofer.aisec.cpg.graph.Declaration
-
- de.fraunhofer.aisec.cpg.graph.ValueDeclaration
-
- All Implemented Interfaces:
HasType
- Direct Known Subclasses:
EnumConstantDeclaration,FieldDeclaration,FunctionDeclaration,ParamVariableDeclaration,VariableDeclaration
public abstract class ValueDeclaration extends Declaration implements HasType
A declaration who has a type.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.fraunhofer.aisec.cpg.graph.HasType
HasType.TypeListener
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<Type>possibleSubTypesprotected Typetype
-
Constructor Summary
Constructors Constructor Description ValueDeclaration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.util.Set<Type>getPossibleSubTypes()TypegetType()java.util.Set<HasType.TypeListener>getTypeListeners()inthashCode()voidrefreshType()voidregisterTypeListener(HasType.TypeListener listener)voidresetTypes(Type type)Used to set the type and clear the possible subtypes list for when a type is more precise than the current.voidsetPossibleSubTypes(java.util.Set<Type> possibleSubTypes, HasType root)Set the node's possible subtypes.voidsetType(Type type, HasType root)Set the node's type.java.lang.StringtoString()voidunregisterTypeListener(HasType.TypeListener listener)-
Methods inherited from class de.fraunhofer.aisec.cpg.graph.Node
addNextDFG, addPrevDFG, disconnectFromGraph, getArgumentIndex, getCode, getFile, getId, getName, getNextCFG, getNextDFG, getNextEOG, getPrevDFG, getPrevEOG, getRegion, isDummy, isImplicit, removeNextDFG, removePrevDFG, setArgumentIndex, setCode, setComment, setDummy, setFile, setImplicit, setName, setNextDFG, setNextEOG, setPrevDFG, setPrevEOG, setRegion
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.fraunhofer.aisec.cpg.graph.HasType
setPossibleSubTypes, setType
-
-
-
-
Method Detail
-
setType
public void setType(Type type, HasType root)
Description copied from interface:HasTypeSet the node's type. This may start a chain of type listener notifications- Specified by:
setTypein interfaceHasTyperoot- The node that initiated the type change chain. When a node receives a type setting command where root == this, we know that we have a type listener circle and can abort. If root == null, the type change is seen as an externally triggered event and subsequent type listeners receive the current node as their root.
-
resetTypes
public void resetTypes(Type type)
Description copied from interface:HasTypeUsed to set the type and clear the possible subtypes list for when a type is more precise than the current.- Specified by:
resetTypesin interfaceHasType- Parameters:
type- the more precise type
-
registerTypeListener
public void registerTypeListener(HasType.TypeListener listener)
- Specified by:
registerTypeListenerin interfaceHasType
-
unregisterTypeListener
public void unregisterTypeListener(HasType.TypeListener listener)
- Specified by:
unregisterTypeListenerin interfaceHasType
-
getTypeListeners
public java.util.Set<HasType.TypeListener> getTypeListeners()
- Specified by:
getTypeListenersin interfaceHasType
-
getPossibleSubTypes
public java.util.Set<Type> getPossibleSubTypes()
- Specified by:
getPossibleSubTypesin interfaceHasType
-
setPossibleSubTypes
public void setPossibleSubTypes(java.util.Set<Type> possibleSubTypes, HasType root)
Description copied from interface:HasTypeSet the node's possible subtypes. Listener circle detection works the same way as withHasType.setType(Type, HasType)- Specified by:
setPossibleSubTypesin interfaceHasType
-
refreshType
public void refreshType()
- Specified by:
refreshTypein interfaceHasType
-
toString
public java.lang.String toString()
- Overrides:
toStringin classDeclaration
-
-