BeanFactory.getInstance().locate( ${key} )package ${enclosing_package}
{
import com.bourre.error.PrivateConstructorException;
/**
* The <code>${enclosing_type}</code> is abstract implementation for...
*
* <p>Use <code class="prettyprint">getConstructorAccess()</code> to
* extends class.</p>
*
* @see #getConstructorAccess()
*
* @author ${user}
*/
public class ${enclosing_type}
{
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
${cursor}
//--------------------------------------------------------------------
// Protected methods
//--------------------------------------------------------------------
/**
* Gives access to <code>${enclosing_type}</code> contructor.
*
* @example
* <pre class="prettyprint">
* package
* {
* public class MyExtension extends ${enclosing_type}
* {
* super( getConstructorAccess() );
* }
* }
* </pre>
*/
protected function getConstructorAccess( ) : ConstructorAccess
{
return ConstructorAccess.instance;
}
//--------------------------------------------------------------------
// Private implementation
//--------------------------------------------------------------------
/**
* @private
*/
function ${enclosing_type}( access : ConstructorAccess )
{
if ( !(access is ConstructorAccess) ) throw new PrivateConstructorException();
}
}
}
internal class ConstructorAccess
{
static public const instance : ConstructorAccess = new ConstructorAccess();
}package ${enclosing_package}
{
import com.bourre.commands.AbstractCommand;
import com.bourre.error.UnreachableDataException;
import flash.events.Event;
/**
* The <code>${enclosing_type}</code> command.
*
* @see #execute()
*
* @author ${user}
*/
public class ${enclosing_type} extends AbstractCommand
{
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
/**
* Creates instance.
*/
public function ${enclosing_type}( )
{
}
/**
* Executes command.
*
* @param event event object that will be used as data source by the command
*
* @throws <code>UnreachableDataException</code> — Stateless command
* use the passed-in event as data source for its execution,
* so the event must provide the right data for the current
* <code>Command</code> object.
*/
override public function execute( event : Event = null ) : void
{
if( event == null )
{
var msg : String = this + ".execute() failed, event data is unreachable";
getLogger().error( msg );
throw( new UnreachableDataException( msg ) );
}
else
{
${cursor}
}
}
}
}package ${enclosing_package}
{
import com.bourre.commands.AbstractSyncCommand;
import com.bourre.error.UnreachableDataException;
import flash.events.Event;
/**
* The <code>${enclosing_type}</code> sync command.
*
* @see #execute()
*
* @author ${user}
*/
public class ${enclosing_type} extends AbstractSyncCommand
{
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
/**
* Creates instance.
*/
public function ${enclosing_type}( )
{
super( );
}
/**
* @inheritDoc
*/
override public function execute( event : Event = null ) : void
{
if( event == null )
{
var msg : String = this + ".execute() failed, event data is unreachable";
getLogger().error( msg );
throw( new UnreachableDataException( msg ) );
}
else
{
${cursor}
fireCommandEndEvent();
}
}
}
}package ${enclosing_package}
{
/**
* Constants definition.
*
* @author ${user}
*/
public final class ${enclosing_type}
{
//--------------------------------------------------------------------
// Constants
//--------------------------------------------------------------------
/**
*
*/
public static const ${NAME} : ${TYPE} = ${cursor}
//--------------------------------------------------------------------
// Private implementation
//--------------------------------------------------------------------
/**
* @private
*/
function ${enclosing_type}( ) { }
}
}
package ${enclosing_package}
{
import com.bourre.events.EventChannel;
import com.bourre.log.Logger;
/**
* <code>${enclosing_type}</code> class.
*
* @author ${user}
*/
public class Tester
{
//--------------------------------------------------------------------
// Private properties
//--------------------------------------------------------------------
private static var _CHANNEL : EventChannel;
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
/**
* You can disable or enable the debug by switching
* the <code>isOn</code> property with <code>true|false</code>.
*
* @default true
*/
public static var isOn : Boolean = true;
/**
* Returns the <code>EventChannel</code> instance.
*
* @return The <code>EventChannel</code> instance.
*/
public static function get CHANNEL() : EventChannel
{
if ( !${enclosing_type}._CHANNEL ) ${enclosing_type}._CHANNEL = new ${enclosing_type}Channel( );
return ${enclosing_type}._CHANNEL;
}
/**
* Dispath a log on the <code>Logger</code> instance with
* <code>DEBUG</code> level.
*
* @param o Any data to log.
*/
public static function DEBUG( o : * ) : void
{
if (${enclosing_type}.isOn) Logger.DEBUG( o, ${enclosing_type}.CHANNEL );
}
/**
* Dispath a log on the <code>Logger</code> instance with
* <code>INFO</code> level.
*
* @param o Any data to log.
*/
public static function INFO( o : * ) : void
{
if (${enclosing_type}.isOn) Logger.INFO( o, ${enclosing_type}.CHANNEL );
}
/**
* Dispath a log on the <code>Logger</code> instance with
* <code>WARN</code> level.
*
* @param o Any data to log.
*/
public static function WARN( o : * ) : void
{
if (${enclosing_type}.isOn) Logger.WARN( o, ${enclosing_type}.CHANNEL );
}
/**
* Dispath a log on the <code>Logger</code> instance with
* <code>ERROR</code> level.
*
* @param o Any data to log.
*/
public static function ERROR( o : * ) : void
{
if (${enclosing_type}.isOn) Logger.ERROR( o, ${enclosing_type}.CHANNEL );
}
/**
* Dispath a log on the <code>Logger</code> instance with
* <code>FATAL</code> level.
*
* @param o Any data to log.
*/
public static function FATAL( o : * ) : void
{
if (${enclosing_type}.isOn) Logger.FATAL( o, ${enclosing_type}.CHANNEL );
}
}
}
import com.bourre.events.EventChannel;
internal class ${enclosing_type}Channel extends EventChannel
{
}package ${enclosing_package}
{
import com.bourre.model.AbstractModel;
import com.bourre.plugin.Plugin;
/**
* The <code>${enclosing_type}</code> model.
*
* @author ${user}
*/
public class ${enclosing_type} extends AbstractModel
{
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
/**
* Creates instance.
*/
public function ${enclosing_type}(owner : Plugin = null )
{
super( owner, ${cursor} );
}
}
}
package ${enclosing_package}
{
import com.bourre.log.PixlibStringifier;
import com.bourre.error.PrivateConstructorException;
/**
* The <code>${enclosing_type}</code> class.
*
* @author ${user}
*/
public class ${enclosing_type}
{
//--------------------------------------------------------------------
// Private properties
//--------------------------------------------------------------------
private static var _oI : ${enclosing_type} ;
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
/**
* Returns singleton instance of <code>${enclosing_type}</code> class.
*
* @return The singleton instance of <code>${enclosing_type}</code> class.
*/
public static function getInstance() : ${enclosing_type}
{
if ( !(${enclosing_type}._oI is ${enclosing_type}) ) ${enclosing_type}._oI = new ${enclosing_type}( ConstructorAccess.instance );
return ${enclosing_type}._oI;
}
/**
* Releases singleton instance.
*/
public static function release() : void
{
if ( ${enclosing_type}._oI is ${enclosing_type} ) ${enclosing_type}._oI = null;
}
/**
* Returns string representation of instance.
*
* @return The string representation of instance.
*/
public function toString() : String
{
return PixlibStringifier.stringify( this );
}
//--------------------------------------------------------------------
// Private implementation
//--------------------------------------------------------------------
/**
* @private
*/
function ${enclosing_type}( access : ConstructorAccess )
{
if ( !(access is ConstructorAccess) ) throw new PrivateConstructorException();
}
}
}
internal class ConstructorAccess
{
static public const instance : ConstructorAccess = new ConstructorAccess();
}package ${enclosing_package}
{
import com.bourre.plugin.Plugin;
import com.bourre.view.AbstractView;
import flash.display.DisplayObject;
/**
* The <code>${enclosing_type} </code> view.
*
* @author ${user}
*/
public class ${enclosing_type} extends AbstractView
{
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
/**
* Creates instance.
*/
public function ${enclosing_type}( owner : Plugin = null, mc : DisplayObject = null )
{
super( owner, ${cursor}, mc );
}
//--------------------------------------------------------------------
// Protected methods
//--------------------------------------------------------------------
/**
* @private
* View is initialized.
*/
override protected function onInitView() : void
{
}
}
}package ${enclosing_package}
{
import com.bourre.plugin.Plugin;
import com.bourre.view.AbstractView;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
/**
* The <code>${enclosing_type}</code> view.
*
* @author ${user}
*/
public class ${enclosing_type} extends AbstractView
{
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
/**
* Creates instance.
*/
public function ${enclosing_type}( owner : Plugin = null, mc : DisplayObject = null )
{
super( owner, ${cursor}, mc );
}
/**
* Returns <code>DisplayObjectContainer</code> instance of current
* view.
*
* @return The <code>DisplayObjectContainer</code> instance of current
* view.
*/
public function getContainer( ) : DisplayObjectContainer
{
return view as DisplayObjectContainer;
}
//--------------------------------------------------------------------
// Protected methods
//--------------------------------------------------------------------
/**
* @private
* View is initialized.
*/
override protected function onInitView() : void
{
}
}
}package ${enclosing_package}
{
import com.bourre.plugin.Plugin;
import com.bourre.view.AbstractView;
/**
* The <code>${enclosing_type} </code> view.
*
* @author ${user}
*/
public class ${enclosing_type} extends AbstractView
{
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
/**
* Creates instance.
*/
public function ${enclosing_type}( owner : Plugin = null )
{
super( owner, ${cursor} );
}
//--------------------------------------------------------------------
// Protected methods
//--------------------------------------------------------------------
/**
* @private
* View is initialized.
*/
override protected function onInitView() : void
{
}
}
}package ${enclosing_package}
{
import com.bourre.plugin.Plugin;
import com.bourre.view.AbstractView;
import flash.display.DisplayObjectContainer;
/**
* The <code>${enclosing_type}</code> view.
*
* @author ${user}
*/
public class ${enclosing_type} extends AbstractView
{
//--------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------
/**
* Creates instance.
*/
public function ${enclosing_type}( owner : Plugin = null )
{
super( owner, ${cursor} );
}
/**
* Returns <code>DisplayObjectContainer</code> instance of current
* view.
*
* @return The <code>DisplayObjectContainer</code> instance of current
* view.
*/
public function getContainer( ) : DisplayObjectContainer
{
return view as DisplayObjectContainer;
}
//--------------------------------------------------------------------
// Protected methods
//--------------------------------------------------------------------
/**
* @private
* View is initialized.
*/
override protected function onInitView() : void
{
}
}
}if( BeanFactory.getInstance().isBeanRegistered( ${bean} ) )
{
${cursor}
}
else
{
}if( BeanFactory.getInstance().isRegistered( ${key} ) )
{
${cursor}
}
else
{
}