src/ecore.js
function() {
        var eContainer = this.eContainer,
            eClass = this.eClass,
            iD = eClass.get('eIDAttribute'),
            eFeature,
            contents,
            fragment;

        // Must be at least contain in a Resource or EObject.
        if (!eContainer) return null;

        // Use ID has fragment
        if (iD) return this.get(iD.get('name'));

        if (this._id) return this._id;

        // ModelElement uses names except for roots
        if (this.isKindOf('EModelElement')) {
            if (!eContainer) {
                return '/';
            } else if (eContainer.isKindOf('Resource')) {
                contents = eContainer.get('contents');
                return contents.size() > 1 ? '/' + contents.indexOf(this) : '/';
            } else {
                return eContainer.fragment() + '/' + this.get('name');
            }
        }

        // Default fragments
        if (eContainer.isKindOf('Resource')) {
            contents = eContainer.get('contents');
            fragment = contents.size() > 1 ? '/' + contents.indexOf(this) : '/';
        } else {
            eFeature = this.eContainingFeature;
            if (eFeature) {
                fragment = eContainer.fragment() + '/@' + eFeature.get('name');
                if (eFeature.get('upperBound') !== 1) {
                    fragment += '.' + eContainer.get(eFeature.get('name')).indexOf(this);
                }
            }
        }

        return fragment;
    }
function() {
        var eContainer = this.eContainer,
            eClass = this.eClass,
            iD = eClass.get('eIDAttribute'),
            eFeature,
            contents,
            fragment;

        // Must be at least contain in a Resource or EObject.
        if (!eContainer) return null;

        // Use ID has fragment
        if (iD) return this.get(iD.get('name'));

        if (this._id) return this._id;

        // ModelElement uses names except for roots
        if (this.isKindOf('EModelElement')) {
            if (!eContainer) {
                return '/';
            } else if (eContainer.isKindOf('Resource')) {
                contents = eContainer.get('contents');
                return contents.size() > 1 ? '/' + contents.indexOf(this) : '/';
            } else {
                return eContainer.fragment() + '/' + this.get('name');
            }
        }

        // Default fragments
        if (eContainer.isKindOf('Resource')) {
            contents = eContainer.get('contents');
            fragment = contents.size() > 1 ? '/' + contents.indexOf(this) : '/';
        } else {
            eFeature = this.eContainingFeature;
            if (eFeature) {
                fragment = eContainer.fragment() + '/@' + eFeature.get('name');
                if (eFeature.get('upperBound') !== 1) {
                    fragment += '.' + eContainer.get(eFeature.get('name')).indexOf(this);
                }
            }
        }

        return fragment;
    }
function ( ) { var eContainer = this . eContainer , eClass = this . eClass , iD = eClass . get ( 'eIDAttribute' ) , eFeature , contents , fragment ; // Must be at least contain in a Resource or EObject. if ( ! eContainer ) return null ; // Use ID has fragment if ( iD ) return this . get ( iD . get ( 'name' ) ) ; if ( this . _id ) return this . _id ; // ModelElement uses names except for roots if ( this . isKindOf ( 'EModelElement' ) ) { if ( ! eContainer ) { return '/' ; } else if ( eContainer . isKindOf ( 'Resource' ) ) { contents = eContainer . get ( 'contents' ) ; return contents . size ( ) > 1 ? '/' + contents . indexOf ( this ) : '/' ; } else { return eContainer . fragment ( ) + '/' + this . get ( 'name' ) ; } } // Default fragments if ( eContainer . isKindOf ( 'Resource' ) ) { contents = eContainer . get ( 'contents' ) ; fragment = contents . size ( ) > 1 ? '/' + contents . indexOf ( this ) : '/' ; } else { eFeature = this . eContainingFeature ; if ( eFeature ) { fragment = eContainer . fragment ( ) + '/@' + eFeature . get ( 'name' ) ; if ( eFeature . get ( 'upperBound' ) !== 1 ) { fragment += '.' + eContainer . get ( eFeature . get ( 'name' ) ) . indexOf ( this ) ; } } } return fragment ; }
Returns the fragment identifier of the EObject.  @return {String}
Returns the fragment identifier of the EObject .