Commons.Collections.ExtendedProperties.AddStringProperty C# (CSharp) Method

AddStringProperty() private method

Sets a string property w/o checking for commas - used internally when a property has been broken up into strings that could contain escaped commas to prevent the inadvertent vectorization. Thanks to Leon Messerschmidt for this one.
private AddStringProperty ( String key, String token ) : void
key String
token String
return void
        private void AddStringProperty(String key, String token)
        {
            Object o = this[key];

            /*
            *  $$$ GMJ
            *  FIXME : post 1.0 release, we need to not assume
            *  that a scalar is a String - it can be an Object
            *  so we should make a little vector-like class
            *  say, Foo that wraps (not extends Vector),
            *  so we can do things like
            *  if ( !( o instanceof Foo) )
            *  so we know it's our 'vector' container
            *
            *  This applies throughout
            */

            /*
            *  do the usual thing - if we have a value and
            *  it's scalar, make a vector, otherwise add
            *  to the vector
            */

            if (o is String)
            {
                ArrayList v = new ArrayList(2);
                v.Add(o);
                v.Add(token);
                CollectionsUtil.PutElement(this, key, v);
            }
            else if (o is ArrayList)
            {
                ((ArrayList) o).Add(token);
            }
            else
            {
                AddPropertyDirect(key, token);
            }
        }