-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generated nodes: split into smaller files (#101)
- Loading branch information
1 parent
347e3ae
commit 5d6abc9
Showing
46 changed files
with
5,226 additions
and
5,025 deletions.
There are no files selected for viewing
309 changes: 147 additions & 162 deletions
309
domain-classes-generator/src/main/scala/io/joern/odb2/schemagen/DomainClassesGenerator.scala
Large diffs are not rendered by default.
Oops, something went wrong.
4,863 changes: 0 additions & 4,863 deletions
4,863
joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/v2/NodeTypes.scala
This file was deleted.
Oops, something went wrong.
124 changes: 124 additions & 0 deletions
124
...nerated/src/main/scala/io/shiftleft/codepropertygraph/generated/v2/nodes/Annotation.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
package io.shiftleft.codepropertygraph.generated.v2.nodes | ||
|
||
import io.joern.odb2 | ||
import io.shiftleft.codepropertygraph.generated.v2.Language.* | ||
import scala.collection.immutable.{IndexedSeq, ArraySeq} | ||
|
||
trait AnnotationEMT extends AnyRef with ExpressionEMT with HasFullNameEMT with HasNameEMT | ||
trait AnnotationBase extends AbstractNode with ExpressionBase with StaticType[AnnotationEMT] { | ||
|
||
override def propertiesMap: java.util.Map[String, Any] = { | ||
import io.shiftleft.codepropertygraph.generated.v2.accessors.Lang.* | ||
val res = new java.util.HashMap[String, Any]() | ||
res.put("ARGUMENT_INDEX", this.argumentIndex) | ||
this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } | ||
res.put("CODE", this.code) | ||
this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } | ||
res.put("FULL_NAME", this.fullName) | ||
this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } | ||
res.put("NAME", this.name) | ||
res.put("ORDER", this.order) | ||
res | ||
} | ||
} | ||
class Annotation(graph_4762: odb2.Graph, seq_4762: Int) | ||
extends StoredNode(graph_4762, 0.toShort, seq_4762) | ||
with AnnotationBase | ||
with Expression | ||
with StaticType[AnnotationEMT] { | ||
|
||
override def productElementName(n: Int): String = | ||
n match { | ||
case 0 => "argumentIndex" | ||
case 1 => "argumentName" | ||
case 2 => "code" | ||
case 3 => "columnNumber" | ||
case 4 => "fullName" | ||
case 5 => "lineNumber" | ||
case 6 => "name" | ||
case 7 => "order" | ||
case _ => "" | ||
} | ||
|
||
override def productElement(n: Int): Any = | ||
n match { | ||
case 0 => this.argumentIndex | ||
case 1 => this.argumentName | ||
case 2 => this.code | ||
case 3 => this.columnNumber | ||
case 4 => this.fullName | ||
case 5 => this.lineNumber | ||
case 6 => this.name | ||
case 7 => this.order | ||
case _ => null | ||
} | ||
|
||
override def productPrefix = "Annotation" | ||
override def productArity = 8 | ||
|
||
override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[Annotation] | ||
} | ||
object NewAnnotation { def apply(): NewAnnotation = new NewAnnotation } | ||
class NewAnnotation extends NewNode(0.toShort) with AnnotationBase { | ||
type RelatedStored = Annotation | ||
override def label: String = "ANNOTATION" | ||
var argumentIndex: Int = -1: Int | ||
var argumentName: Option[String] = None | ||
var code: String = "<empty>": String | ||
var columnNumber: Option[Int] = None | ||
var fullName: String = "<empty>": String | ||
var lineNumber: Option[Int] = None | ||
var name: String = "<empty>": String | ||
var order: Int = -1: Int | ||
def argumentIndex(value: Int): this.type = { this.argumentIndex = value; this } | ||
def argumentName(value: Option[String]): this.type = { this.argumentName = value; this } | ||
def argumentName(value: String): this.type = { this.argumentName = Option(value); this } | ||
def code(value: String): this.type = { this.code = value; this } | ||
def columnNumber(value: Int): this.type = { this.columnNumber = Option(value); this } | ||
def columnNumber(value: Option[Int]): this.type = { this.columnNumber = value; this } | ||
def fullName(value: String): this.type = { this.fullName = value; this } | ||
def lineNumber(value: Int): this.type = { this.lineNumber = Option(value); this } | ||
def lineNumber(value: Option[Int]): this.type = { this.lineNumber = value; this } | ||
def name(value: String): this.type = { this.name = value; this } | ||
def order(value: Int): this.type = { this.order = value; this } | ||
override def flattenProperties(interface: odb2.BatchedUpdateInterface): Unit = { | ||
interface.insertProperty(this, 1, Iterator(this.argumentIndex)) | ||
if (argumentName.nonEmpty) interface.insertProperty(this, 2, this.argumentName) | ||
interface.insertProperty(this, 10, Iterator(this.code)) | ||
if (columnNumber.nonEmpty) interface.insertProperty(this, 11, this.columnNumber) | ||
interface.insertProperty(this, 22, Iterator(this.fullName)) | ||
if (lineNumber.nonEmpty) interface.insertProperty(this, 34, this.lineNumber) | ||
interface.insertProperty(this, 39, Iterator(this.name)) | ||
interface.insertProperty(this, 41, Iterator(this.order)) | ||
} | ||
|
||
override def productElementName(n: Int): String = | ||
n match { | ||
case 0 => "argumentIndex" | ||
case 1 => "argumentName" | ||
case 2 => "code" | ||
case 3 => "columnNumber" | ||
case 4 => "fullName" | ||
case 5 => "lineNumber" | ||
case 6 => "name" | ||
case 7 => "order" | ||
case _ => "" | ||
} | ||
|
||
override def productElement(n: Int): Any = | ||
n match { | ||
case 0 => this.argumentIndex | ||
case 1 => this.argumentName | ||
case 2 => this.code | ||
case 3 => this.columnNumber | ||
case 4 => this.fullName | ||
case 5 => this.lineNumber | ||
case 6 => this.name | ||
case 7 => this.order | ||
case _ => null | ||
} | ||
|
||
override def productPrefix = "NewAnnotation" | ||
override def productArity = 8 | ||
override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[NewAnnotation] | ||
} |
116 changes: 116 additions & 0 deletions
116
.../src/main/scala/io/shiftleft/codepropertygraph/generated/v2/nodes/AnnotationLiteral.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
package io.shiftleft.codepropertygraph.generated.v2.nodes | ||
|
||
import io.joern.odb2 | ||
import io.shiftleft.codepropertygraph.generated.v2.Language.* | ||
import scala.collection.immutable.{IndexedSeq, ArraySeq} | ||
|
||
trait AnnotationLiteralEMT extends AnyRef with ExpressionEMT with HasNameEMT | ||
trait AnnotationLiteralBase extends AbstractNode with ExpressionBase with StaticType[AnnotationLiteralEMT] { | ||
|
||
override def propertiesMap: java.util.Map[String, Any] = { | ||
import io.shiftleft.codepropertygraph.generated.v2.accessors.Lang.* | ||
val res = new java.util.HashMap[String, Any]() | ||
res.put("ARGUMENT_INDEX", this.argumentIndex) | ||
this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } | ||
res.put("CODE", this.code) | ||
this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } | ||
this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } | ||
res.put("NAME", this.name) | ||
res.put("ORDER", this.order) | ||
res | ||
} | ||
} | ||
class AnnotationLiteral(graph_4762: odb2.Graph, seq_4762: Int) | ||
extends StoredNode(graph_4762, 1.toShort, seq_4762) | ||
with AnnotationLiteralBase | ||
with Expression | ||
with StaticType[AnnotationLiteralEMT] { | ||
|
||
override def productElementName(n: Int): String = | ||
n match { | ||
case 0 => "argumentIndex" | ||
case 1 => "argumentName" | ||
case 2 => "code" | ||
case 3 => "columnNumber" | ||
case 4 => "lineNumber" | ||
case 5 => "name" | ||
case 6 => "order" | ||
case _ => "" | ||
} | ||
|
||
override def productElement(n: Int): Any = | ||
n match { | ||
case 0 => this.argumentIndex | ||
case 1 => this.argumentName | ||
case 2 => this.code | ||
case 3 => this.columnNumber | ||
case 4 => this.lineNumber | ||
case 5 => this.name | ||
case 6 => this.order | ||
case _ => null | ||
} | ||
|
||
override def productPrefix = "AnnotationLiteral" | ||
override def productArity = 7 | ||
|
||
override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[AnnotationLiteral] | ||
} | ||
object NewAnnotationLiteral { def apply(): NewAnnotationLiteral = new NewAnnotationLiteral } | ||
class NewAnnotationLiteral extends NewNode(1.toShort) with AnnotationLiteralBase { | ||
type RelatedStored = AnnotationLiteral | ||
override def label: String = "ANNOTATION_LITERAL" | ||
var argumentIndex: Int = -1: Int | ||
var argumentName: Option[String] = None | ||
var code: String = "<empty>": String | ||
var columnNumber: Option[Int] = None | ||
var lineNumber: Option[Int] = None | ||
var name: String = "<empty>": String | ||
var order: Int = -1: Int | ||
def argumentIndex(value: Int): this.type = { this.argumentIndex = value; this } | ||
def argumentName(value: Option[String]): this.type = { this.argumentName = value; this } | ||
def argumentName(value: String): this.type = { this.argumentName = Option(value); this } | ||
def code(value: String): this.type = { this.code = value; this } | ||
def columnNumber(value: Int): this.type = { this.columnNumber = Option(value); this } | ||
def columnNumber(value: Option[Int]): this.type = { this.columnNumber = value; this } | ||
def lineNumber(value: Int): this.type = { this.lineNumber = Option(value); this } | ||
def lineNumber(value: Option[Int]): this.type = { this.lineNumber = value; this } | ||
def name(value: String): this.type = { this.name = value; this } | ||
def order(value: Int): this.type = { this.order = value; this } | ||
override def flattenProperties(interface: odb2.BatchedUpdateInterface): Unit = { | ||
interface.insertProperty(this, 1, Iterator(this.argumentIndex)) | ||
if (argumentName.nonEmpty) interface.insertProperty(this, 2, this.argumentName) | ||
interface.insertProperty(this, 10, Iterator(this.code)) | ||
if (columnNumber.nonEmpty) interface.insertProperty(this, 11, this.columnNumber) | ||
if (lineNumber.nonEmpty) interface.insertProperty(this, 34, this.lineNumber) | ||
interface.insertProperty(this, 39, Iterator(this.name)) | ||
interface.insertProperty(this, 41, Iterator(this.order)) | ||
} | ||
|
||
override def productElementName(n: Int): String = | ||
n match { | ||
case 0 => "argumentIndex" | ||
case 1 => "argumentName" | ||
case 2 => "code" | ||
case 3 => "columnNumber" | ||
case 4 => "lineNumber" | ||
case 5 => "name" | ||
case 6 => "order" | ||
case _ => "" | ||
} | ||
|
||
override def productElement(n: Int): Any = | ||
n match { | ||
case 0 => this.argumentIndex | ||
case 1 => this.argumentName | ||
case 2 => this.code | ||
case 3 => this.columnNumber | ||
case 4 => this.lineNumber | ||
case 5 => this.name | ||
case 6 => this.order | ||
case _ => null | ||
} | ||
|
||
override def productPrefix = "NewAnnotationLiteral" | ||
override def productArity = 7 | ||
override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[NewAnnotationLiteral] | ||
} |
91 changes: 91 additions & 0 deletions
91
...rc/main/scala/io/shiftleft/codepropertygraph/generated/v2/nodes/AnnotationParameter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package io.shiftleft.codepropertygraph.generated.v2.nodes | ||
|
||
import io.joern.odb2 | ||
import io.shiftleft.codepropertygraph.generated.v2.Language.* | ||
import scala.collection.immutable.{IndexedSeq, ArraySeq} | ||
|
||
trait AnnotationParameterEMT extends AnyRef with AstNodeEMT | ||
trait AnnotationParameterBase extends AbstractNode with AstNodeBase with StaticType[AnnotationParameterEMT] { | ||
|
||
override def propertiesMap: java.util.Map[String, Any] = { | ||
import io.shiftleft.codepropertygraph.generated.v2.accessors.Lang.* | ||
val res = new java.util.HashMap[String, Any]() | ||
res.put("CODE", this.code) | ||
this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } | ||
this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } | ||
res.put("ORDER", this.order) | ||
res | ||
} | ||
} | ||
class AnnotationParameter(graph_4762: odb2.Graph, seq_4762: Int) | ||
extends StoredNode(graph_4762, 2.toShort, seq_4762) | ||
with AnnotationParameterBase | ||
with AstNode | ||
with StaticType[AnnotationParameterEMT] { | ||
|
||
override def productElementName(n: Int): String = | ||
n match { | ||
case 0 => "code" | ||
case 1 => "columnNumber" | ||
case 2 => "lineNumber" | ||
case 3 => "order" | ||
case _ => "" | ||
} | ||
|
||
override def productElement(n: Int): Any = | ||
n match { | ||
case 0 => this.code | ||
case 1 => this.columnNumber | ||
case 2 => this.lineNumber | ||
case 3 => this.order | ||
case _ => null | ||
} | ||
|
||
override def productPrefix = "AnnotationParameter" | ||
override def productArity = 4 | ||
|
||
override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[AnnotationParameter] | ||
} | ||
object NewAnnotationParameter { def apply(): NewAnnotationParameter = new NewAnnotationParameter } | ||
class NewAnnotationParameter extends NewNode(2.toShort) with AnnotationParameterBase { | ||
type RelatedStored = AnnotationParameter | ||
override def label: String = "ANNOTATION_PARAMETER" | ||
var code: String = "<empty>": String | ||
var columnNumber: Option[Int] = None | ||
var lineNumber: Option[Int] = None | ||
var order: Int = -1: Int | ||
def code(value: String): this.type = { this.code = value; this } | ||
def columnNumber(value: Int): this.type = { this.columnNumber = Option(value); this } | ||
def columnNumber(value: Option[Int]): this.type = { this.columnNumber = value; this } | ||
def lineNumber(value: Int): this.type = { this.lineNumber = Option(value); this } | ||
def lineNumber(value: Option[Int]): this.type = { this.lineNumber = value; this } | ||
def order(value: Int): this.type = { this.order = value; this } | ||
override def flattenProperties(interface: odb2.BatchedUpdateInterface): Unit = { | ||
interface.insertProperty(this, 10, Iterator(this.code)) | ||
if (columnNumber.nonEmpty) interface.insertProperty(this, 11, this.columnNumber) | ||
if (lineNumber.nonEmpty) interface.insertProperty(this, 34, this.lineNumber) | ||
interface.insertProperty(this, 41, Iterator(this.order)) | ||
} | ||
|
||
override def productElementName(n: Int): String = | ||
n match { | ||
case 0 => "code" | ||
case 1 => "columnNumber" | ||
case 2 => "lineNumber" | ||
case 3 => "order" | ||
case _ => "" | ||
} | ||
|
||
override def productElement(n: Int): Any = | ||
n match { | ||
case 0 => this.code | ||
case 1 => this.columnNumber | ||
case 2 => this.lineNumber | ||
case 3 => this.order | ||
case _ => null | ||
} | ||
|
||
override def productPrefix = "NewAnnotationParameter" | ||
override def productArity = 4 | ||
override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[NewAnnotationParameter] | ||
} |
Oops, something went wrong.