summaryrefslogtreecommitdiffstats
path: root/vnfmarket/common/thirdparty/angular/.bower.json
blob: c7cefbccff026b41f24b857806a5cba5fe07255a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "name": "angular",
  "version": "1.6.2",
  "license": "MIT",
  "main": "./angular.js",
  "ignore": [],
  "dependencies": {},
  "homepage": "https://github.com/angular/bower-angular",
  "_release": "1.6.2",
  "_resolution": {
    "type": "version",
    "tag": "v1.6.2",
    "commit": "6588975381655e657da44fb3a573dbf48c3075d5"
  },
  "_source": "https://github.com/angular/bower-angular.git",
  "_target": "1.6.2",
  "_originalSource": "angular"
}
* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright © 2017-2018 AT&T Intellectual Property.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.utils

import com.fasterxml.jackson.databind.JsonNode
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.data.ArtifactType
import org.onap.ccsdk.cds.controllerblueprints.core.data.CapabilityDefinition
import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType
import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeType
import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils

class ModelTypeValidator {
    companion object {
        /**
         * This is a validateModelTypeDefinition
         *
         * @param definitionType definitionType
         * @param definitionContent definitionContent
         * @return boolean
         */
        fun validateModelTypeDefinition(definitionType: String, definitionContent: JsonNode): Boolean {

            when (definitionType) {
                BluePrintConstants.MODEL_DEFINITION_TYPE_DATA_TYPE -> {
                    JacksonUtils.readValue(definitionContent, DataType::class.java)
                        ?: throw BluePrintException("Model type definition is not DataType valid content $definitionContent")
                }
                BluePrintConstants.MODEL_DEFINITION_TYPE_NODE_TYPE -> {
                    JacksonUtils.readValue(definitionContent, NodeType::class.java)
                        ?: throw BluePrintException("Model type definition is not NodeType valid content $definitionContent")
                }
                BluePrintConstants.MODEL_DEFINITION_TYPE_ARTIFACT_TYPE -> {
                    JacksonUtils.readValue(definitionContent, ArtifactType::class.java)
                        ?: throw BluePrintException("Model type definition is not ArtifactType valid content $definitionContent")
                }
                BluePrintConstants.MODEL_DEFINITION_TYPE_CAPABILITY_TYPE -> {
                    JacksonUtils.readValue(definitionContent, CapabilityDefinition::class.java)
                        ?: throw BluePrintException("Model type definition is not CapabilityDefinition valid content $definitionContent")
                }
                BluePrintConstants.MODEL_DEFINITION_TYPE_RELATIONSHIP_TYPE -> {
                    JacksonUtils.readValue(definitionContent, RelationshipType::class.java)
                        ?: throw BluePrintException("Model type definition is not RelationshipType valid content $definitionContent")
                }
            }
            return true
        }

        /**
         * This is a validateModelType method
         *
         * @param modelType modelType
         * @return boolean
         */
        fun validateModelType(modelType: ModelType?): Boolean {
            checkNotNull(modelType) { "Model Type Information is missing." }

            val validRootTypes = BluePrintTypes.validModelTypes()

            check(validRootTypes.contains(modelType.definitionType)) {
                "Not Valid Model Root Type(${modelType.definitionType}), It should be $validRootTypes"
            }

            validateModelTypeDefinition(modelType.definitionType, modelType.definition)
            return true
        }
    }
}