Skip to main content
Version: 3.5

MetadataType 元数据类型

1. 结构声明

class MetadataType extends BaseNode {
name: string = '';
label: string = '元数据';
description?: string;
typeAnnotation: TypeAnnotation;
rules: Array<ValidationRule>;
playground: Array<LogicItem>;
uuid: uuid;
}

2. 节点示例

(1) 示例

AST 如下:

{
"concept": "MetadataType",
"name": "Currency",
"label": "货币",
"uuid": "83450632af284642ab5c967e82d49be4",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Decimal",
"inferred": false,
"ruleMap": {}
},
"rules": [
{
"concept": "ValidationRule",
"calleeNamespace": "nasl.validation",
"calleeName": "min",
"arguments": [
{
"concept": "Argument",
"keyword": "min",
"expression": {
"concept": "NumericLiteral",
"value": "0",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
}
}
}
],
"target": {
"concept": "Identifier",
"namespace": "",
"name": ""
},
"enableServerValidation": true
},
{
"concept": "ValidationRule",
"calleeNamespace": "nasl.validation",
"calleeName": "max",
"arguments": [
{
"concept": "Argument",
"keyword": "max",
"expression": {
"concept": "NumericLiteral",
"value": "99999999",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
}
}
}
],
"target": {
"concept": "Identifier",
"namespace": "",
"name": ""
},
"enableServerValidation": true
}
],
"playground": []
}