Packagenet.sourceforge.fxpotpourri.logging.misc
Classpublic class GeneralUtil



Public Methods
 MethodDefined by
  
GeneralUtil
  
formatDate(date:Date):String
[static] Return string representation of date in a standard format.
GeneralUtil
  
formatToString(object:Object, ... rest):String
[static] Handy method to get a consistent result of toString():String Example: public class Foo { public var bar:String = "xy"; private var hidden:String = "vw"; public function toString():String { return StringUtilX.formatToString(this, "bar", null, "hidden="+hidden); // => "Foo[bar=xy;hidden=vw]" } }
GeneralUtil
  
getClassByClassName(className:String):Class
[static] Returns a reference to the class object of the class specified by the className parameter.
GeneralUtil
  
getClassByInstance(instance:*):Class
[static] Returns a reference to the class object of the instance specified by the instance parameter
GeneralUtil
  
getFullQualifiedName(clazz:Class):String
[static]
GeneralUtil
  
getFullQualifiedNameByInstance(object:Object):String
[static] Returns the fully qualified name of given instance.
GeneralUtil
  
getSimpleName(clazz:Class):String
[static] Returns the simple name (last part of fully qualified name) of given class.
GeneralUtil
  
getSimpleNameByInstance(object:Object):String
[static] Returns the simple name (last part of fully qualified name) of given instance.
GeneralUtil
  
padLeft(string:String, padCharacter:String, targetLength:uint):String
[static]
GeneralUtil
  
padRight(string:String, padCharacter:String, targetLength:uint):String
[static]
GeneralUtil
  
resolveAttribute(object:Object, attributeName:String):Object
[static] Can resolve deeply nested attributes for a given object.
GeneralUtil
Constructor detail
GeneralUtil()constructor
public function GeneralUtil()
Method detail
formatDate()method
public static function formatDate(date:Date):String

Return string representation of date in a standard format.

Parameters
date:Date

Returns
String — string of current date in format: "2009-12-31,23:59:09.012"
formatToString()method 
public static function formatToString(object:Object, ... rest):String

Handy method to get a consistent result of toString():String Example: public class Foo { public var bar:String = "xy"; private var hidden:String = "vw"; public function toString():String { return StringUtilX.formatToString(this, "bar", null, "hidden="+hidden); // => "Foo[bar=xy;hidden=vw]" } }

Parameters
object:Object
 
... rest

Returns
String
getClassByClassName()method 
public static function getClassByClassName(className:String):Class

Returns a reference to the class object of the class specified by the className parameter.

Parameters
className:String — Full name of a class

Returns
Class — Reference to the class object of the class specified by the className parameter
getClassByInstance()method 
public static function getClassByInstance(instance:*):Class

Returns a reference to the class object of the instance specified by the instance parameter

Parameters
instance:* — The instance from which to return the class

Returns
Class — Reference to the class object of the class specified by the instance parameter
getFullQualifiedName()method 
public static function getFullQualifiedName(clazz:Class):String

Parameters
clazz:Class

Returns
String
getFullQualifiedNameByInstance()method 
public static function getFullQualifiedNameByInstance(object:Object):String

Returns the fully qualified name of given instance.

Parameters
object:Object — the instance which should be described; must not be null.

Returns
String — a string like "com.foobar::MyClass".
getSimpleName()method 
public static function getSimpleName(clazz:Class):String

Returns the simple name (last part of fully qualified name) of given class.

Parameters
clazz:Class — which should be described; must not be null.

Returns
String — string like "MyClass".
getSimpleNameByInstance()method 
public static function getSimpleNameByInstance(object:Object):String

Returns the simple name (last part of fully qualified name) of given instance.

Parameters
object:Object — the instance which should be described; must not be null.

Returns
String — string like "MyClass".
padLeft()method 
public static function padLeft(string:String, padCharacter:String, targetLength:uint):StringParameters
string:String
 
padCharacter:String
 
targetLength:uint

Returns
String
padRight()method 
public static function padRight(string:String, padCharacter:String, targetLength:uint):StringParameters
string:String
 
padCharacter:String
 
targetLength:uint

Returns
String
resolveAttribute()method 
public static function resolveAttribute(object:Object, attributeName:String):Object

Can resolve deeply nested attributes for a given object.

Parameters
object:Object — which is under inspection.
 
attributeName:String — eg: "outterProperty.innerProperty.myVariable"

Returns
Object — desired attribute of generic type Object.