public function GeneralUtil()
public static function formatDate(date:Date):String
Return string representation of date in a standard format.
Parameters
Returns
| String — string of current date in format: "2009-12-31,23:59:09.012"
|
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
Returns
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
|
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
|
public static function getFullQualifiedName(clazz:Class):String
Parameters
Returns
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".
|
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".
|
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".
|
public static function padLeft(string:String, padCharacter:String, targetLength:uint):String
Parameters
| string:String |
|
| padCharacter:String |
|
| targetLength:uint |
Returns
public static function padRight(string:String, padCharacter:String, targetLength:uint):String
Parameters
| string:String |
|
| padCharacter:String |
|
| targetLength:uint |
Returns
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.
|