Example #1
0
        //////////////////////////////////////////////////////////////////////////
        // Collection (@collection)
        //////////////////////////////////////////////////////////////////////////

        private bool writeCollectionItems(Type type, object obj, bool first)
        {
            // lookup each method
            Method m = type.method("each", false);

            if (m == null)
            {
                throw IOErr.make("Missing " + type.qname() + ".each").val;
            }

            // call each(it)
            EachIterator it = new EachIterator(this, first);

            m.invoke(obj, new object[] { it });
            return(it.first);
        }
Example #2
0
        //////////////////////////////////////////////////////////////////////////
        // Collection (@collection)
        //////////////////////////////////////////////////////////////////////////
        private bool writeCollectionItems(Type type, object obj, bool first)
        {
            // lookup each method
              Method m = type.method("each", false);
              if (m == null) throw IOErr.make("Missing " + type.qname() + ".each").val;

              // call each(it)
              EachIterator it = new EachIterator(this, first);
              m.invoke(obj, new object[] { it });
              return it.first;
        }