Class RecordDeclaration
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.graph.Node
-
- de.fraunhofer.aisec.cpg.graph.declarations.Declaration
-
- de.fraunhofer.aisec.cpg.graph.declarations.RecordDeclaration
-
- All Implemented Interfaces:
DeclarationHolder,Persistable,IVisitable<Node>
public class RecordDeclaration extends Declaration implements DeclarationHolder
Represents a C++ union/struct/class or Java class
-
-
Constructor Summary
Constructors Constructor Description RecordDeclaration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConstructor(ConstructorDeclaration constructorDeclaration)voidaddDeclaration(@NonNull Declaration declaration)Adds the specified declaration to this declaration holder.voidaddField(FieldDeclaration fieldDeclaration)voidaddMethod(MethodDeclaration methodDeclaration)booleanequals(java.lang.Object o)java.util.List<ConstructorDeclaration>getConstructors()java.util.List<PropertyEdge<ConstructorDeclaration>>getConstructorsPropertyEdge()@Nullable FieldDeclarationgetField(java.lang.String name)java.util.List<FieldDeclaration>getFields()java.util.List<PropertyEdge<FieldDeclaration>>getFieldsPropertyEdge()java.util.List<Type>getImplementedInterfaces()Interfaces implemented by this class.java.util.Set<Declaration>getImports()java.util.List<java.lang.String>getImportStatements()java.lang.StringgetKind()java.util.List<MethodDeclaration>getMethods()java.util.List<PropertyEdge<MethodDeclaration>>getMethodsPropertyEdge()java.util.List<RecordDeclaration>getRecords()java.util.List<PropertyEdge<RecordDeclaration>>getRecordsPropertyEdge()java.util.Set<ValueDeclaration>getStaticImports()java.util.List<java.lang.String>getStaticImportStatements()java.util.List<Type>getSuperClasses()The classes that are extended by this one.java.util.Set<RecordDeclaration>getSuperTypeDeclarations()java.util.List<Type>getSuperTypes()Combines both implemented interfaces and extended classes.FieldDeclarationgetThis()inthashCode()voidremoveConstructor(ConstructorDeclaration constructorDeclaration)voidremoveField(FieldDeclaration fieldDeclaration)voidremoveMethod(MethodDeclaration methodDeclaration)voidremoveRecord(RecordDeclaration recordDeclaration)voidsetConstructors(java.util.List<ConstructorDeclaration> constructors)voidsetFields(java.util.List<FieldDeclaration> fields)voidsetImplementedInterfaces(java.util.List<Type> implementedInterfaces)voidsetImports(java.util.Set<Declaration> imports)voidsetImportStatements(java.util.List<java.lang.String> importStatements)voidsetKind(java.lang.String kind)voidsetMethods(java.util.List<MethodDeclaration> methods)voidsetName(@NonNull java.lang.String name)voidsetRecords(java.util.List<RecordDeclaration> records)voidsetStaticImports(java.util.Set<ValueDeclaration> staticImports)voidsetStaticImportStatements(java.util.List<java.lang.String> staticImportStatements)voidsetSuperClasses(java.util.List<Type> superClasses)voidsetSuperTypeDeclarations(java.util.Set<RecordDeclaration> superTypeDeclarations)java.lang.StringtoString()-
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, 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.DeclarationHolder
addIfNotContains, addIfNotContains, addIfNotContains
-
Methods inherited from interface de.fraunhofer.aisec.cpg.processing.IVisitable
accept
-
-
-
-
Method Detail
-
getKind
public java.lang.String getKind()
-
setKind
public void setKind(java.lang.String kind)
-
getFields
public java.util.List<FieldDeclaration> getFields()
-
getFieldsPropertyEdge
public java.util.List<PropertyEdge<FieldDeclaration>> getFieldsPropertyEdge()
-
addField
public void addField(FieldDeclaration fieldDeclaration)
-
removeField
public void removeField(FieldDeclaration fieldDeclaration)
-
getField
public @Nullable FieldDeclaration getField(java.lang.String name)
-
setFields
public void setFields(java.util.List<FieldDeclaration> fields)
-
getThis
public FieldDeclaration getThis()
-
getMethods
public java.util.List<MethodDeclaration> getMethods()
-
getMethodsPropertyEdge
public java.util.List<PropertyEdge<MethodDeclaration>> getMethodsPropertyEdge()
-
addMethod
public void addMethod(MethodDeclaration methodDeclaration)
-
removeMethod
public void removeMethod(MethodDeclaration methodDeclaration)
-
setMethods
public void setMethods(java.util.List<MethodDeclaration> methods)
-
getConstructors
public java.util.List<ConstructorDeclaration> getConstructors()
-
getConstructorsPropertyEdge
public java.util.List<PropertyEdge<ConstructorDeclaration>> getConstructorsPropertyEdge()
-
setConstructors
public void setConstructors(java.util.List<ConstructorDeclaration> constructors)
-
addConstructor
public void addConstructor(ConstructorDeclaration constructorDeclaration)
-
removeConstructor
public void removeConstructor(ConstructorDeclaration constructorDeclaration)
-
getRecords
public java.util.List<RecordDeclaration> getRecords()
-
getRecordsPropertyEdge
public java.util.List<PropertyEdge<RecordDeclaration>> getRecordsPropertyEdge()
-
setRecords
public void setRecords(java.util.List<RecordDeclaration> records)
-
removeRecord
public void removeRecord(RecordDeclaration recordDeclaration)
-
getSuperTypes
public java.util.List<Type> getSuperTypes()
Combines both implemented interfaces and extended classes. This is most commonly what you are looking for when looking for method call targets etc.- Returns:
- concatenation of
getSuperClasses()andgetImplementedInterfaces()
-
getSuperClasses
public java.util.List<Type> getSuperClasses()
The classes that are extended by this one. Usually zero or one, but in C++ this can contain multiple classes- Returns:
- extended classes
-
setSuperClasses
public void setSuperClasses(java.util.List<Type> superClasses)
-
getImplementedInterfaces
public java.util.List<Type> getImplementedInterfaces()
Interfaces implemented by this class. This concept is not present in C++- Returns:
- the list of implemented interfaces
-
setImplementedInterfaces
public void setImplementedInterfaces(java.util.List<Type> implementedInterfaces)
-
getSuperTypeDeclarations
public java.util.Set<RecordDeclaration> getSuperTypeDeclarations()
-
setSuperTypeDeclarations
public void setSuperTypeDeclarations(java.util.Set<RecordDeclaration> superTypeDeclarations)
-
getImports
public java.util.Set<Declaration> getImports()
-
setImports
public void setImports(java.util.Set<Declaration> imports)
-
getStaticImports
public java.util.Set<ValueDeclaration> getStaticImports()
-
setStaticImports
public void setStaticImports(java.util.Set<ValueDeclaration> staticImports)
-
getImportStatements
public java.util.List<java.lang.String> getImportStatements()
-
setImportStatements
public void setImportStatements(java.util.List<java.lang.String> importStatements)
-
getStaticImportStatements
public java.util.List<java.lang.String> getStaticImportStatements()
-
setStaticImportStatements
public void setStaticImportStatements(java.util.List<java.lang.String> staticImportStatements)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classDeclaration
-
addDeclaration
public void addDeclaration(@NonNull Declaration declaration)
Description copied from interface:DeclarationHolderAdds the specified declaration to this declaration holder. Ideally, the declaration holder should use theDeclarationHolder.addIfNotContains(Collection, Declaration)method to consistently add declarations.- Specified by:
addDeclarationin interfaceDeclarationHolder- Parameters:
declaration- the declaration
-
-