@return the enclosing class body namespace or null if not in a class.
( NameSpace thisNameSpace )
| 596 | @return the enclosing class body namespace or null if not in a class. |
| 597 | */ |
| 598 | static NameSpace getClassNameSpace( NameSpace thisNameSpace ) |
| 599 | { |
| 600 | if ( null == thisNameSpace ) |
| 601 | return null; |
| 602 | |
| 603 | // is a class instance |
| 604 | //if ( thisNameSpace.classInstance != null ) |
| 605 | if ( thisNameSpace.isClass ) |
| 606 | return thisNameSpace; |
| 607 | |
| 608 | if ( thisNameSpace.isMethod |
| 609 | && thisNameSpace.getParent() != null |
| 610 | //&& thisNameSpace.getParent().classInstance != null |
| 611 | && thisNameSpace.getParent().isClass |
| 612 | ) |
| 613 | return thisNameSpace.getParent(); |
| 614 | |
| 615 | return null; |
| 616 | } |
| 617 | |
| 618 | /** |
| 619 | Check the cache, else use toObject() to try to resolve to a class |
no test coverage detected