Package de.fraunhofer.aisec.cpg.graph
Interface DeclarationHolder
- All Known Implementing Classes:
ArrayCreationExpression,ArrayRangeExpression,ArraySubscriptionExpression,ASMDeclarationStatement,AssertStatement,BinaryOperator,BreakStatement,CallExpression,CaseStatement,CastExpression,CatchClause,ClassTemplateDeclaration,CompoundStatement,CompoundStatementExpression,ConditionalExpression,ConstructorDeclaration,ContinueStatement,DeclarationSequence,DeclarationStatement,DeclaredReferenceExpression,DefaultStatement,DeleteExpression,DesignatedInitializerExpression,DoStatement,EmptyStatement,ExplicitConstructorInvocation,Expression,ExpressionList,ForEachStatement,ForStatement,FunctionDeclaration,FunctionTemplateDeclaration,GotoStatement,IfStatement,InitializerListExpression,LabelStatement,Literal,MemberCallExpression,MemberExpression,MethodDeclaration,NamespaceDeclaration,NewExpression,RecordDeclaration,ReturnStatement,Statement,StaticCallExpression,SwitchStatement,SynchronizedStatement,TemplateDeclaration,TranslationUnitDeclaration,TryStatement,TypeExpression,TypeIdExpression,UnaryOperator,UninitializedValue,WhileStatement
public interface DeclarationHolder
-
Method Summary
Modifier and Type Method Description voidaddDeclaration(@NonNull Declaration declaration)Adds the specified declaration to this declaration holder.default <T extends de.fraunhofer.aisec.cpg.graph.Node>
voidaddIfNotContains(java.util.Collection<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<T>> collection, T declaration)default <T extends de.fraunhofer.aisec.cpg.graph.Node>
voidaddIfNotContains(java.util.Collection<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<T>> collection, T declaration, boolean outgoing)Adds a declaration to a collection of property edges, which contain the declarationsdefault <N extends Declaration>
voidaddIfNotContains(java.util.Collection<N> collection, N declaration)@NonNull java.util.List<Declaration>getDeclarations()
-
Method Details
-
addDeclaration
Adds the specified declaration to this declaration holder. Ideally, the declaration holder should use theaddIfNotContains(Collection, Declaration)method to consistently add declarations.- Parameters:
declaration- the declaration
-
addIfNotContains
default <N extends Declaration> void addIfNotContains(java.util.Collection<N> collection, N declaration) -
addIfNotContains
default <T extends de.fraunhofer.aisec.cpg.graph.Node> void addIfNotContains(java.util.Collection<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<T>> collection, T declaration) -
addIfNotContains
default <T extends de.fraunhofer.aisec.cpg.graph.Node> void addIfNotContains(java.util.Collection<de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge<T>> collection, T declaration, boolean outgoing)Adds a declaration to a collection of property edges, which contain the declarations- Type Parameters:
T- the type of the declaration- Parameters:
collection- the collectiondeclaration- the declarationoutgoing- whether the property is outgoing
-
getDeclarations
@NonNull java.util.List<Declaration> getDeclarations()
-