Packagesekati.utils
Classpublic class TypeEnforcer

TypeEnforcer provides type helpers for class constructors.



Public Methods
 MethodDefined by
  
TypeEnforcer Static Constructor
TypeEnforcer
  
enforceAbstract(classInstance:*, classAbstract:Class):void
[static] Forcibly abstract a class instance from its abstract class (An abstract class has no direct instances, but has descendants with instances).
TypeEnforcer
  
enforceStatic(classInstance:*):void
[static] Notify upon attempted instantiation of a static class (e.g.
TypeEnforcer
Constructor detail
TypeEnforcer()constructor
public function TypeEnforcer()

TypeEnforcer Static Constructor

Method detail
enforceAbstract()method
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); 
      }
     }
    }
   

enforceStatic()method 
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 );
      }
     }
   }