Skip to main content
Version: 2.22

Structure 数据结构

结构声明

interface Structure {
"concept": "Structure", // 产品概念
"name": string, // 数据结构名称
"description": string, // 数据结构描述
"origin": "CallQueryComponent", // 数据结构来源
"compilerInfoMap": { java?: { packageName: string, className: string } }, // 编译器信息,目前仅在后端扩展模块中使用。
"typeParams": Array<TypeParam>, // 类型参数列表
"properties": Array<StructureProperty>, // 数据结构属性列表
}

示例

简单示例

{
"concept": "Structure",
"name": "CustomDetail",
"description": "自定义详情数据结构",
"origin": "CallQueryComponent",
"compilerInfoMap": null,
"typeParams": null,
"properties": []
}

带普通属性

{
"concept": "Structure",
"name": "StudentResult",
"typeParams": [],
"properties": [{
"concept": "StructureProperty",
"name": "name",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"typeArguments": null
}
}, {
"concept": "StructureProperty",
"name": "age",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}]
}

泛型数据结构

目前仅用于定义官方数据结构,暂不对用户开放编辑。

List

{
"concept": "Structure",
"name": "List",
"typeParams": [{
"concept": "TypeParam",
"name": "T"
}],
"properties": [{
"concept": "StructureProperty",
"name": "length",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}]
}

ScopeOf

{
"concept": "Structure",
"name": "ScopeOf",
"typeParams": [{
"concept": "TypeParam",
"name": "T"
}],
"properties": [{
"concept": "StructureProperty",
"name": "item",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "typeParam",
"typeNamespace": null,
"typeName": "T",
"typeArguments": null
}
}, {
"concept": "StructureProperty",
"name": "index",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}, {
"concept": "StructureProperty",
"name": "rowIndex",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}, {
"concept": "StructureProperty",
"name": "columnIndex",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}, {
"concept": "StructureProperty",
"name": "value",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "String",
"typeArguments": null
}
}]
}

PageOf

{
"concept": "Structure",
"name": "PageOf",
"typeParams": [{
"concept": "TypeParam",
"name": "T"
}],
"properties": [{
"concept": "StructureProperty",
"name": "content",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "generic",
"typeNamespace": "nasl.collection",
"typeName": "List",
"typeArguments": [{
"concept": "TypeAnnotation",
"typeKind": "typeParam",
"typeNamespace": null,
"typeName": "T",
"typeArguments": null
}]
}
}, {
"concept": "StructureProperty",
"name": "number",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}, {
"concept": "StructureProperty",
"name": "size",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}, {
"concept": "StructureProperty",
"name": "totalPages",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}, {
"concept": "StructureProperty",
"name": "totalElements",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Integer",
"typeArguments": null
}
}]
}