示例#1
0
        public override Object init(InternalContextAdapter context, Object data)
        {
            base.init(context, data);

            /*
             *  only do things that are not context dependant
             */

            if (parser.isDirective(directiveName))
            {
                isDirective = true;

                // create a new instance of the directive
                directive = parser.getDirective(directiveName);
                directive.init(rsvc, context, this);
                directive.setLocation(Line, Column);
            }
            else if (rsvc.isVelocimacro(directiveName, context.CurrentTemplateName))
            {
                /*
                 *  we seem to be a Velocimacro.
                 */

                isDirective = true;
                directive   = rsvc.getVelocimacro(directiveName, context.CurrentTemplateName);

                directive.init(rsvc, context, this);
                directive.setLocation(Line, Column);
            }
            else
            {
                isDirective = false;
            }

            return(data);
        }