ClassPath Class
Class com.blitzagency.xray.ClassPath
Inheritance
>
ClassPath
| Property Summary |
|---|
| private static Array | check is an array that holds references to all the objects found in the initial registerPackage process.
it's used in the checkExtended method to check for super relationships |
| private static String | fullPath is what's returned when getFullPath is called. |
| Method Summary |
|---|
| private static Void | _protect(package_obj:Object, unprotected:Array) |
| static Object | compares the __proto__ of the object sent in with the prototype of the objects in the check array. If a match is
found, then this is the direct super class of the object |
| private static Void | checkProtoChain walks up the __proto__ chain to resolve the entire extended path of a class |
| private static | Private helper function to look up all classes in a given package and
tell them there own classname and
package name. |
| static String | getClass(obj:Object, extendedPath:Boolean, includePath:Boolean) returns a string containing either the className, class path and name or fully extended class path |
| static String | Returns the short classname (ie without the package info) for an
object or a constructor (Class). |
| static String | Returns the short classname (ie without the package info) for an
object or a constructor (Class). |
| static String | Returns the complete classname including the package part, for the
given object or constructor (Class). |
| private static | intrinsicPusher adds all of the Flash core classes/objects (LocalConnection, NetStream, MovieClip, etc). The
reason for doing it this way is to avoid running ASSetPropFlags on _global. For some reason, it seems to introduce a bug and
cause a slow down in snapshots. |
| static | Registers a package to be used with getClassName and getPath. |
check
private static var check:Array;
fullPath
private static var fullPath:String;
_protect
private static function _protect(package_obj:Object, unprotected:Array):Void
checkExtended
public static function checkExtended(obj:Object):Object
Parameters:
Returns:
Object containing 3 properties:
extended:Boolean - whether or not it's extended
className:String - className with path
shortClassName:String - just the className
checkProtoChain
private static function checkProtoChain(obj:Object, extendedPath:Boolean, includePath:Boolean):Void
Parameters:
obj:Object- - starting point
Returns:
nothing
classPusher
private static function classPusher(node:Object, name:String)
Private helper function to look up all classes in a given package and
tell them there own classname and
package name.
Parameters:
node- the object that corresponds to the given name for
example _global["mx"]
name- the starting package name, to start the recursion,
eg "mx"
getClass
public static function getClass(obj:Object, extendedPath:Boolean, includePath:Boolean):String
Parameters:
obj:Object- - object who's class name you want to resolve
extendedPath:Boolean- - return extended full class path
includePath:Boolean- - if extendedPath is false, then this flag is evaluated to see if you want the
class package path included with the class name.
exampe
//this example has a glow filter which extends BitmapFilter and we want to see the full extended path
import ClassUtilities;
import flash.filters.GlowFilter;
var glow:GlowFilter = new GlowFilter(0x00ff00,1,5,5,2,3,false,false);
trace("protoChain full Path :: " + ClassUtilities.getFullPath(glow, true));
//traces
flash.filters.GlowFilter.BitmapFilter.Object
//this example has a glow filter which extends BitmapFilter and we want to see the non-extended path
import ClassUtilities;
import flash.filters.GlowFilter;
var glow:GlowFilter = new GlowFilter(0x00ff00,1,5,5,2,3,false,false);
trace("protoChain full Path :: " + ClassUtilities.getFullPath(glow, false));
//traces
flash.filters.GlowFilter
//this example has a glow filter which extends BitmapFilter and we want to see the full extended path
import ClassUtilities;
import flash.filters.GlowFilter;
var glow:GlowFilter = new GlowFilter(0x00ff00,1,5,5,2,3,false,false);
trace("protoChain full Path :: " + ClassUtilities.getFullPath(glow, false, false));
//traces
GlowFilter
Returns:
String containing either the className, class path and name or fully extended class path
getClassName
public static function getClassName(obj:Object):String
Returns the short classname (ie without the package info) for an
object or a constructor (Class).
Parameters:
obj- the obj to get the classname for
Returns:
the classname if the object's class was previously correctly
registered
getLongClassName
public static function getLongClassName(obj:Object):String
Returns the short classname (ie without the package info) for an
object or a constructor (Class).
Parameters:
obj- the obj to get the classname for
Returns:
the classname if the object's class was previously correctly
registered
getPath
public static function getPath(obj:Object):String
Returns the complete classname including the package part, for the
given object or constructor (Class).
Parameters:
obj- the obj to get the complete package name for
Returns:
the complete package name if the object's class was
previously correctly registered
intrinsicPusher
private static function intrinsicPusher(node:Object, className:String)
Parameters:
node:Object- - global object to be added IE: _global.LocalConnection
className:String- - actual name of the class/object
Returns:
nothing
registerPackage
public static function registerPackage(packageName:String)
Registers a package to be used with getClassName and getPath. If packageName is undefined, then _global is searched
with it's properties exposed, then the properties are reset to the original state. This allows the user to simply
inspect all of global and all packages that might be in com or mx or anywhere else.
Parameters:
a- string describing a top level package to be registered, for
example "mx" or "trimm"
Documentation generated by BLDoc Community Edition from B-Line Express.