public function TypeEnforcer()
TypeEnforcer Static Constructor
public static function enforceAbstract(classInstance:*, classAbstract:Class):void
Forcibly abstract a class instance from its abstract class (An abstract class has no direct instances, but has descendants with instances).
Parameters
| classInstance:* — instance of the Class .
|
|
| classAbstract:Class — the abstract Class reference.
|
Throws
| — if the instance is not properly abstracted.
|
Example
package {
public class AbstractExample {
public function AbstractExample( ) {
TypeEnforcer.enforceAbstract(this, AbstractExample);
}
}
}
public static function enforceStatic(classInstance:*):void
Notify upon attempted instantiation of a static class (e.g. a class with only static methods which does not require instantiation).
Parameters
| classInstance:* — instance of the Class .
|
Throws
| — which describes the static nature of the class when called.
|
Example
package {
public class StaticExample {
public function StaticExample() {
TypeEnforcer.enforceStatic( this );
}
}
}