src/aria/core/JsonValidator.js
function (typeName, packageDef) {
                var packageName, otherBP;
                var i = typeName.indexOf(':');
                // if no semicolumn, type is defined inside this package
                if (i == -1) {
                    packageName = packageDef.$package;
                    otherBP = packageDef;
                } else {
                    var ns = typeName.substr(0, i);
                    typeName = typeName.substr(i + 1);
                    packageName = (packageDef.$namespaces == null ? null : packageDef.$namespaces[ns]);
                    if (typeUtils.isObject(packageName)) {
                        packageName = packageName.$package;
                    }
                    if (!packageName) {
                        this._logError(this.UNDEFINED_PREFIX, [ns, this._currentBeanName]);
                        return this._typeRefError;
                    }
                }

                var fullName = packageName + "." + typeName;
                var typeRef = this.__processedBeans[fullName];
                if (typeRef) {
                    return typeRef;
                }

                if (!otherBP) {
                    otherBP = this.__loadedBeans[packageName];
                    if (!otherBP) {
                        this._logError(this.MISSING_BEANSPACKAGE, [packageName, this._currentBeanName]);
                        return this._typeRefError;
                    }
                }

                typeRef = this.__findTypeInBP(otherBP, typeName);

                // update this type name with fully qualified name
                if (typeRef != this._typeError && !typeRef[this._MD_TYPENAME]) {
                    typeRef[this._MD_TYPENAME] = fullName;
                }

                return typeRef;
            }
function (typeName, packageDef) {
                var packageName, otherBP;
                var i = typeName.indexOf(':');
                // if no semicolumn, type is defined inside this package
                if (i == -1) {
                    packageName = packageDef.$package;
                    otherBP = packageDef;
                } else {
                    var ns = typeName.substr(0, i);
                    typeName = typeName.substr(i + 1);
                    packageName = (packageDef.$namespaces == null ? null : packageDef.$namespaces[ns]);
                    if (typeUtils.isObject(packageName)) {
                        packageName = packageName.$package;
                    }
                    if (!packageName) {
                        this._logError(this.UNDEFINED_PREFIX, [ns, this._currentBeanName]);
                        return this._typeRefError;
                    }
                }

                var fullName = packageName + "." + typeName;
                var typeRef = this.__processedBeans[fullName];
                if (typeRef) {
                    return typeRef;
                }

                if (!otherBP) {
                    otherBP = this.__loadedBeans[packageName];
                    if (!otherBP) {
                        this._logError(this.MISSING_BEANSPACKAGE, [packageName, this._currentBeanName]);
                        return this._typeRefError;
                    }
                }

                typeRef = this.__findTypeInBP(otherBP, typeName);

                // update this type name with fully qualified name
                if (typeRef != this._typeError && !typeRef[this._MD_TYPENAME]) {
                    typeRef[this._MD_TYPENAME] = fullName;
                }

                return typeRef;
            }
function ( typeName , packageDef ) { var packageName , otherBP ; var i = typeName . indexOf ( ':' ) ; // if no semicolumn, type is defined inside this package if ( i == - 1 ) { packageName = packageDef . $package ; otherBP = packageDef ; } else { var ns = typeName . substr ( 0 , i ) ; typeName = typeName . substr ( i + 1 ) ; packageName = ( packageDef . $namespaces == null ? null : packageDef . $namespaces [ ns ] ) ; if ( typeUtils . isObject ( packageName ) ) { packageName = packageName . $package ; } if ( ! packageName ) { this . _logError ( this . UNDEFINED_PREFIX , [ ns , this . _currentBeanName ] ) ; return this . _typeRefError ; } } var fullName = packageName + "." + typeName ; var typeRef = this . __processedBeans [ fullName ] ; if ( typeRef ) { return typeRef ; } if ( ! otherBP ) { otherBP = this . __loadedBeans [ packageName ] ; if ( ! otherBP ) { this . _logError ( this . MISSING_BEANSPACKAGE , [ packageName , this . _currentBeanName ] ) ; return this . _typeRefError ; } } typeRef = this . __findTypeInBP ( otherBP , typeName ) ; // update this type name with fully qualified name if ( typeRef != this . _typeError && ! typeRef [ this . _MD_TYPENAME ] ) { typeRef [ this . _MD_TYPENAME ] = fullName ; } return typeRef ; }
Find a bean definition by its type name. It relies on the bean package currently being processed.
@param {String} typeName A string composed of two parts: 'namespace:value' where the namespace is
optional if the value refers a type defined in the package currently being processed.
@param {aria.core.BaseTypes:Package} packageDef reference package
@return {aria.core.BaseTypes:Bean} definition of the requested bean, or this._typeRefError if it could
not be found
Find a bean definition by its type name . It relies on the bean package currently being processed .