示例#1
0
 internal MethodSourceWriter(StringBuilder target, ClassSourceWriter classSourceWriter)
 {
     this._target            = target;
     this._classSourceWriter = classSourceWriter;
     this._levels.push(_bottom);
     this._levels.push(_level);
 }
示例#2
0
        protected internal override ClassEmitter Generate(TypeReference type, TypeReference @base, TypeReference[] interfaces)
        {
            StringBuilder target = new StringBuilder();

            lock (this)
            {
                StringBuilder old = _classes[type] = target;
                if (old != null)
                {
                    _classes[type] = old;
                    throw new System.InvalidOperationException("Trying to generate class twice: " + type);
                }
            }
            ClassSourceWriter writer = new ClassSourceWriter(target, _configuration);

            writer.DeclarePackage(type);
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            writer.Javadoc("Generated by " + this.GetType().FullName);
            writer.PublicClass(type);
            writer.ExtendClass(@base);
            writer.Implement(interfaces);
            writer.Begin();
            return(writer);
        }