public static boolean isForeignKey ( NodeKey key , NodeKey rootKey ) { if ( key == null ) { return false ; } String nodeWorkspaceKey = key . getWorkspaceKey ( ) ; boolean sameWorkspace = rootKey . getWorkspaceKey ( ) . equals ( nodeWorkspaceKey ) ; boolean sameSource = rootKey . getSourceKey ( ) . equalsIgnoreCase ( key . getSourceKey ( ) ) ; return ! sameWorkspace || ! sameSource ; }
Checks if the node given key is foreign by comparing the source key & workspace key against the same keys from this session s root . This method is used for reference resolving .