<commit_before>h2. What is Iogi

Iogi is a small library for instantiating objects (and graphs therof) in Java.  It's primary
motivation is to help with unmarshalling request parameters in Web applications.

The project was born as a spin-off of the "VRaptor Web Framework":http://vraptor.caelum.com.br/en/.
Many frameworks use OGLN to construct objects, but, as it's name atests, OGNL is most useful as a
language for *navigating* object graphs. As such, it is oriented around properties as getter/setter
pairs. Iogi, on the other hand, is able to instantiate objects through constructor parameters or
setters. Iogi also supports dependency injection, so you can inject arbitrary objects (perhaps with
the help of a DI framework) into your domain objects as they are instantiated.

h2. Sample code


p. Here are some sample classes that you might want to instantiate:


bc..    public static class House {
        private Cat cat;

        public void setCat(final Cat cat) {
            this.cat = cat;
        }

        public Cat getCat() {
            return cat;
        }
    }

	public static class Cat {
        private Leg firstLeg;

        public void setFirstLeg(final Leg firstLeg) {
            this.firstLeg = firstLeg;
        }

        public Leg getFirstLeg() {
            return firstLeg;
        }
    }

    public static class Leg {
        private Integer id;
        private Calendar birthDay; // weird leg birthday!!

        public void setId(final Integer id) {
            this.id = id;
        }
		}



p. And here is how you can instantiate them with Iogi:



bc..        final Target<House> target = Target.create(House.class, "house");
        final Parameter parameter = new Parameter("house.cat.firstLeg.id", "");
        final House house = iogi.instantiate(target, parameter);
        assertThat(house.cat.firstLeg.id, is(equalTo(null)));

<commit_msg>README formatting<commit_after>h2. What is Iogi

Iogi is a small library for instantiating objects (and graphs therof) in Java.  It's primary
motivation is to help with unmarshalling request parameters in Web applications.

The project was born as a spin-off of the "VRaptor Web Framework":http://vraptor.caelum.com.br/en/.
Many frameworks use OGLN to construct objects, but, as it's name atests, OGNL is most useful as a
language for *navigating* object graphs. As such, it is oriented around properties as getter/setter
pairs. Iogi, on the other hand, is able to instantiate objects through constructor parameters or
setters. Iogi also supports dependency injection, so you can inject arbitrary objects (perhaps with
the help of a DI framework) into your domain objects as they are instantiated.

h2. Sample code


p. Here are some sample classes that you might want to instantiate:


bc..    public static class House {
        private Cat cat;

        public void setCat(final Cat cat) {
            this.cat = cat;
        }

        public Cat getCat() {
            return cat;
        }
    }

	public static class Cat {
        private Leg firstLeg;

        public void setFirstLeg(final Leg firstLeg) {
            this.firstLeg = firstLeg;
        }

        public Leg getFirstLeg() {
            return firstLeg;
        }
    }

    public static class Leg {
        private Integer id;
        private Calendar birthDay; // weird leg birthday!!

        public void setId(final Integer id) {
            this.id = id;
        }

    }




p. And here is how you can instantiate them with Iogi:


bc..        final Target<House> target = Target.create(House.class, "house");
        final Parameter parameter = new Parameter("house.cat.firstLeg.id", "");
        final House house = iogi.instantiate(target, parameter);
        assertThat(house.cat.firstLeg.id, is(equalTo(null)));


{'fraction_non_alphanumeric': 0.07016618306515432, 'fraction_numerical': 0.0010551305724083356, 'mean_word_length': 2.5943127962085306, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3546452', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1001, 'n_words': 441}