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
    void addDeclaration​(@NonNull Declaration declaration)
    Adds the specified declaration to this declaration holder.
    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)  
    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
    default <N extends Declaration>
    void
    addIfNotContains​(java.util.Collection<N> collection, N declaration)  
    @NonNull java.util.List<Declaration> getDeclarations()  
  • Method Details

    • addDeclaration

      void addDeclaration​(@NonNull Declaration declaration)
      Adds the specified declaration to this declaration holder. Ideally, the declaration holder should use the addIfNotContains(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 collection
      declaration - the declaration
      outgoing - whether the property is outgoing
    • getDeclarations

      @NonNull java.util.List<Declaration> getDeclarations()