Class ValueDeclaration
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.graph.Node
-
- de.fraunhofer.aisec.cpg.graph.declarations.Declaration
-
- de.fraunhofer.aisec.cpg.graph.declarations.ValueDeclaration
-
- All Implemented Interfaces:
HasType,Persistable,IVisitable<Node>
- 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()TypegetPropagationType()There is no case in which we would want to propagate a referenceType as in this case always the underlying ObjectType should be propagatedTypegetType()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)voidupdatePossibleSubtypes(java.util.Set<Type> types)voidupdateType(Type type)Sideeffect free type modification WARNING: This should only be used by the TypeSystem Pass-
Methods inherited from class de.fraunhofer.aisec.cpg.graph.Node
addAnnotations, addNextCFG, addNextCFG, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, getAnnotations, getArgumentIndex, getCode, getFile, getId, getLocation, getName, getNextCFG, getNextDFG, getNextEOG, getNextEOGProperties, getNextEOGPropertyEdge, getPrevDFG, getPrevEOG, getPrevEOGProperties, getTypedefs, isDummy, isImplicit, removeNextDFG, removePrevDFG, removePrevEOGEntries, removePrevEOGEntry, setArgumentIndex, setCode, setComment, setDummy, setFile, setImplicit, setLocation, setName, setNextDFG, setNextEOG, setPrevDFG, setPrevEOG, setPrevEOGProperties, setTypedefs
-
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
-
Methods inherited from interface de.fraunhofer.aisec.cpg.processing.IVisitable
accept
-
-
-
-
Method Detail
-
getPropagationType
public Type getPropagationType()
There is no case in which we would want to propagate a referenceType as in this case always the underlying ObjectType should be propagated- Specified by:
getPropagationTypein interfaceHasType- Returns:
- Type that should be propagated
-
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 interfaceHasType- Parameters:
type- new typeroot- 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
-
updateType
public void updateType(Type type)
Description copied from interface:HasTypeSideeffect free type modification WARNING: This should only be used by the TypeSystem Pass- Specified by:
updateTypein interfaceHasType- Parameters:
type- new type
-
updatePossibleSubtypes
public void updatePossibleSubtypes(java.util.Set<Type> types)
- Specified by:
updatePossibleSubtypesin interfaceHasType
-
-