pax_global_header00006660000000000000000000000064116665500150014517gustar00rootroot0000000000000052 comment=a3bdc2ebbc3f2a991b95779664c4360d3eb0056d modello-maven-plugin1.4-1.4.1/000077500000000000000000000000001166655001500160005ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/pom.xml000066400000000000000000000116331166655001500173210ustar00rootroot00000000000000 modello org.codehaus.modello 1.4.1 4.0.0 modello-maven-plugin maven-plugin Modello Maven Plugin Modello Maven Plugin enables the use of Modello in Maven builds. 2.0.6 org.apache.maven maven-plugin-api org.codehaus.modello modello-core org.apache.maven maven-project org.apache.maven maven-model org.codehaus.plexus plexus-container-default org.codehaus.plexus plexus-utils org.codehaus.modello modello-plugin-converters runtime org.codehaus.modello modello-plugin-dom4j runtime org.codehaus.modello modello-plugin-java org.codehaus.modello modello-plugin-jdom runtime org.codehaus.modello modello-plugin-stax runtime org.codehaus.modello modello-plugin-xdoc runtime org.codehaus.modello modello-plugin-xpp3 runtime org.codehaus.modello modello-plugin-xsd runtime org.sonatype.plexus plexus-build-api org.apache.maven.plugins maven-plugin-plugin generated-helpmojo helpmojo org.apache.maven.plugins maven-plugin-plugin 2.6 run-its org.apache.maven.plugins maven-invoker-plugin 1.5 src/it ${project.build.directory}/it */pom.xml verify.bsh src/it/settings.xml ${project.build.directory}/local-repo true 1.5.8 3.8.2 clean test integration-test install run modello-maven-plugin1.4-1.4.1/src/000077500000000000000000000000001166655001500165675ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/000077500000000000000000000000001166655001500172035ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone-java5/000077500000000000000000000000001166655001500213075ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone-java5/invoker.properties000066400000000000000000000000341166655001500250770ustar00rootroot00000000000000invoker.java.version = 1.5+ modello-maven-plugin1.4-1.4.1/src/it/clone-java5/pom.xml000066400000000000000000000041421166655001500226250ustar00rootroot00000000000000 4.0.0 org.codehaus.modello.its clone 0.1-SNAPSHOT Clone IT Test the generation of clone() methods. org.codehaus.plexus plexus-utils @plexusUtilsVersion@ junit junit @junitVersion@ test org.apache.maven.plugins maven-compiler-plugin 2.0.2 1.5 1.5 org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.4.3 org.codehaus.modello modello-maven-plugin @project.version@ 1.0.0 true src/main/mdo/thing.mdo standard java modello-maven-plugin1.4-1.4.1/src/it/clone-java5/src/000077500000000000000000000000001166655001500220765ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone-java5/src/main/000077500000000000000000000000001166655001500230225ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone-java5/src/main/mdo/000077500000000000000000000000001166655001500236015ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone-java5/src/main/mdo/thing.mdo000066400000000000000000000135531166655001500254220ustar00rootroot00000000000000 thing Thing package test SuperThing 1.0.0 Thing SuperThing 1.0.0 someBoolean 1.0.0 boolean someChar 1.0.0 char someByte 1.0.0 byte someShort 1.0.0 short someInt 1.0.0 int someLong 1.0.0 long someFloat 1.0.0 float someDouble 1.0.0 double someString 1.0.0 String someDate 1.0.0 Date someDom 1.0.0 DOM someProperties 1.0.0 Properties String * someStringList 1.0.0 List String * someStringSet 1.0.0 Set String * deepThingy 1.0.0 Thingy 1 deepThingyList 1.0.0 List Thingy * deepThingySet 1.0.0 Set Thingy * shallowThingy 1.0.0 Thingy 1 shallowThingyList 1.0.0 List Thingy * shallowThingySet 1.0.0 Set Thingy * 1.0.0 Thingy SuperThing 1.0.0 modello-maven-plugin1.4-1.4.1/src/it/clone-java5/src/test/000077500000000000000000000000001166655001500230555ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone-java5/src/test/java/000077500000000000000000000000001166655001500237765ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone-java5/src/test/java/test/000077500000000000000000000000001166655001500247555ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone-java5/src/test/java/test/CloneTest.java000066400000000000000000000072721166655001500275300ustar00rootroot00000000000000package test; import java.util.Date; import org.codehaus.plexus.util.xml.Xpp3Dom; import junit.framework.TestCase; public class CloneTest extends TestCase { public void testNullSafe() throws Exception { Thing orig = new Thing(); Thing copy = (Thing) orig.clone(); assertNotNull( copy ); assertNotSame( orig, copy ); } public void testClone() throws Exception { Thing orig = new Thing(); orig.setSomeBoolean( true ); orig.setSomeChar( 'X' ); orig.setSomeByte( (byte) 7 ); orig.setSomeShort( (short) 11 ); orig.setSomeInt( 13 ); orig.setSomeLong( 17 ); orig.setSomeFloat( -2.5f ); orig.setSomeDouble( 3.14 ); orig.setSomeString( "test" ); orig.setSomeDate( new Date() ); orig.setSomeDom( new Xpp3Dom( "test" ) ); orig.addSomeStringList( "string" ); orig.addSomeStringSet( "string" ); orig.setDeepThingy( new Thingy() ); orig.addDeepThingyList( new Thingy() ); orig.addDeepThingySet( new Thingy() ); orig.setShallowThingy( new Thingy() ); orig.addShallowThingyList( new Thingy() ); orig.addShallowThingySet( new Thingy() ); orig.addSomeProperty( "key", "value" ); orig.customProperties.setProperty( "key", "value" ); // NOTE: This has no cast and checks for covariant return value Thing copy = orig.clone(); assertNotNull( copy ); assertNotSame( orig, copy ); assertEquals( orig.isSomeBoolean(), copy.isSomeBoolean() ); assertEquals( orig.getSomeChar(), copy.getSomeChar() ); assertEquals( orig.getSomeByte(), copy.getSomeByte() ); assertEquals( orig.getSomeShort(), copy.getSomeShort() ); assertEquals( orig.getSomeInt(), copy.getSomeInt() ); assertEquals( orig.getSomeLong(), copy.getSomeLong() ); assertEquals( orig.getSomeFloat(), copy.getSomeFloat(), 0.1 ); assertEquals( orig.getSomeDouble(), copy.getSomeDouble(), 0.1 ); assertEquals( orig.getSomeString(), copy.getSomeString() ); assertEquals( orig.getSomeDate(), copy.getSomeDate() ); assertNotSame( orig.getSomeDate(), copy.getSomeDate() ); assertEquals( orig.getSomeDom(), copy.getSomeDom() ); assertNotSame( orig.getSomeDom(), copy.getSomeDom() ); assertEquals( orig.getSomeStringList(), copy.getSomeStringList() ); assertNotSame( orig.getSomeStringList(), copy.getSomeStringList() ); assertEquals( orig.getSomeStringSet(), copy.getSomeStringSet() ); assertNotSame( orig.getSomeStringSet(), copy.getSomeStringSet() ); assertNotSame( orig.getDeepThingy(), copy.getDeepThingy() ); assertNotSame( orig.getDeepThingyList(), copy.getDeepThingyList() ); assertNotSame( orig.getDeepThingyList().iterator().next(), copy.getDeepThingyList().iterator().next() ); assertNotSame( orig.getDeepThingySet(), copy.getDeepThingySet() ); assertNotSame( orig.getDeepThingySet().iterator().next(), copy.getDeepThingySet().iterator().next() ); assertSame( orig.getShallowThingy(), copy.getShallowThingy() ); assertNotSame( orig.getShallowThingyList(), copy.getShallowThingyList() ); assertSame( orig.getShallowThingyList().iterator().next(), copy.getShallowThingyList().iterator().next() ); assertNotSame( orig.getShallowThingySet(), copy.getShallowThingySet() ); assertSame( orig.getShallowThingySet().iterator().next(), copy.getShallowThingySet().iterator().next() ); assertEquals( orig.customProperties, copy.customProperties ); assertNotSame( orig.customProperties, copy.customProperties ); } } modello-maven-plugin1.4-1.4.1/src/it/clone/000077500000000000000000000000001166655001500203035ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone/pom.xml000066400000000000000000000040761166655001500216270ustar00rootroot00000000000000 4.0.0 org.codehaus.modello.its clone 0.1-SNAPSHOT Clone IT Test the generation of clone() methods. org.codehaus.plexus plexus-utils @plexusUtilsVersion@ junit junit @junitVersion@ test org.apache.maven.plugins maven-compiler-plugin 2.0.2 1.4 1.4 org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.4.3 org.codehaus.modello modello-maven-plugin @project.version@ 1.0.0 src/main/mdo/thing.mdo standard java modello-maven-plugin1.4-1.4.1/src/it/clone/src/000077500000000000000000000000001166655001500210725ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone/src/main/000077500000000000000000000000001166655001500220165ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone/src/main/mdo/000077500000000000000000000000001166655001500225755ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone/src/main/mdo/thing.mdo000066400000000000000000000135531166655001500244160ustar00rootroot00000000000000 thing Thing package test SuperThing 1.0.0 Thing SuperThing 1.0.0 someBoolean 1.0.0 boolean someChar 1.0.0 char someByte 1.0.0 byte someShort 1.0.0 short someInt 1.0.0 int someLong 1.0.0 long someFloat 1.0.0 float someDouble 1.0.0 double someString 1.0.0 String someDate 1.0.0 Date someDom 1.0.0 DOM someProperties 1.0.0 Properties String * someStringList 1.0.0 List String * someStringSet 1.0.0 Set String * deepThingy 1.0.0 Thingy 1 deepThingyList 1.0.0 List Thingy * deepThingySet 1.0.0 Set Thingy * shallowThingy 1.0.0 Thingy 1 shallowThingyList 1.0.0 List Thingy * shallowThingySet 1.0.0 Set Thingy * 1.0.0 Thingy SuperThing 1.0.0 modello-maven-plugin1.4-1.4.1/src/it/clone/src/test/000077500000000000000000000000001166655001500220515ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone/src/test/java/000077500000000000000000000000001166655001500227725ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone/src/test/java/test/000077500000000000000000000000001166655001500237515ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/clone/src/test/java/test/CloneTest.java000066400000000000000000000071721166655001500265230ustar00rootroot00000000000000package test; import java.util.Date; import org.codehaus.plexus.util.xml.Xpp3Dom; import junit.framework.TestCase; public class CloneTest extends TestCase { public void testNullSafe() throws Exception { Thing orig = new Thing(); Thing copy = (Thing) orig.clone(); assertNotNull( copy ); assertNotSame( orig, copy ); } public void testClone() throws Exception { Thing orig = new Thing(); orig.setSomeBoolean( true ); orig.setSomeChar( 'X' ); orig.setSomeByte( (byte) 7 ); orig.setSomeShort( (short) 11 ); orig.setSomeInt( 13 ); orig.setSomeLong( 17 ); orig.setSomeFloat( -2.5f ); orig.setSomeDouble( 3.14 ); orig.setSomeString( "test" ); orig.setSomeDate( new Date() ); orig.setSomeDom( new Xpp3Dom( "test" ) ); orig.addSomeStringList( "string" ); orig.addSomeStringSet( "string" ); orig.setDeepThingy( new Thingy() ); orig.addDeepThingyList( new Thingy() ); orig.addDeepThingySet( new Thingy() ); orig.setShallowThingy( new Thingy() ); orig.addShallowThingyList( new Thingy() ); orig.addShallowThingySet( new Thingy() ); orig.addSomeProperty( "key", "value" ); orig.customProperties.setProperty( "key", "value" ); Thing copy = (Thing) orig.clone(); assertNotNull( copy ); assertNotSame( orig, copy ); assertEquals( orig.isSomeBoolean(), copy.isSomeBoolean() ); assertEquals( orig.getSomeChar(), copy.getSomeChar() ); assertEquals( orig.getSomeByte(), copy.getSomeByte() ); assertEquals( orig.getSomeShort(), copy.getSomeShort() ); assertEquals( orig.getSomeInt(), copy.getSomeInt() ); assertEquals( orig.getSomeLong(), copy.getSomeLong() ); assertEquals( orig.getSomeFloat(), copy.getSomeFloat(), 0.1 ); assertEquals( orig.getSomeDouble(), copy.getSomeDouble(), 0.1 ); assertEquals( orig.getSomeString(), copy.getSomeString() ); assertEquals( orig.getSomeDate(), copy.getSomeDate() ); assertNotSame( orig.getSomeDate(), copy.getSomeDate() ); assertEquals( orig.getSomeDom(), copy.getSomeDom() ); assertNotSame( orig.getSomeDom(), copy.getSomeDom() ); assertEquals( orig.getSomeStringList(), copy.getSomeStringList() ); assertNotSame( orig.getSomeStringList(), copy.getSomeStringList() ); assertEquals( orig.getSomeStringSet(), copy.getSomeStringSet() ); assertNotSame( orig.getSomeStringSet(), copy.getSomeStringSet() ); assertNotSame( orig.getDeepThingy(), copy.getDeepThingy() ); assertNotSame( orig.getDeepThingyList(), copy.getDeepThingyList() ); assertNotSame( orig.getDeepThingyList().iterator().next(), copy.getDeepThingyList().iterator().next() ); assertNotSame( orig.getDeepThingySet(), copy.getDeepThingySet() ); assertNotSame( orig.getDeepThingySet().iterator().next(), copy.getDeepThingySet().iterator().next() ); assertSame( orig.getShallowThingy(), copy.getShallowThingy() ); assertNotSame( orig.getShallowThingyList(), copy.getShallowThingyList() ); assertSame( orig.getShallowThingyList().iterator().next(), copy.getShallowThingyList().iterator().next() ); assertNotSame( orig.getShallowThingySet(), copy.getShallowThingySet() ); assertSame( orig.getShallowThingySet().iterator().next(), copy.getShallowThingySet().iterator().next() ); assertEquals( orig.customProperties, copy.customProperties ); assertNotSame( orig.customProperties, copy.customProperties ); } } modello-maven-plugin1.4-1.4.1/src/it/dom4j-no-plexus-utils/000077500000000000000000000000001166655001500233065ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/dom4j-no-plexus-utils/pom.xml000066400000000000000000000042401166655001500246230ustar00rootroot00000000000000 4.0.0 org.codehaus.modello.its dom4j-no-plexus-utils 0.1-SNAPSHOT DOM4J IT Test that the DOM4J based readers/writers do not have a dependency on plexus-utils' Xpp3Dom if the model does not use DOM fields. dom4j dom4j 1.6.1 compile test org.apache.maven.plugins maven-compiler-plugin 2.0.2 1.4 1.4 org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.4.3 org.codehaus.modello modello-maven-plugin @project.version@ 1.0.0 src/main/mdo/thing.mdo standard java dom4j-reader dom4j-writer modello-maven-plugin1.4-1.4.1/src/it/dom4j-no-plexus-utils/src/000077500000000000000000000000001166655001500240755ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/dom4j-no-plexus-utils/src/main/000077500000000000000000000000001166655001500250215ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/dom4j-no-plexus-utils/src/main/mdo/000077500000000000000000000000001166655001500256005ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/dom4j-no-plexus-utils/src/main/mdo/thing.mdo000066400000000000000000000067051166655001500274220ustar00rootroot00000000000000 thing Thing package test SuperThing 1.0.0 Thing SuperThing 1.0.0 someBoolean 1.0.0 boolean someChar 1.0.0 char someByte 1.0.0 byte someShort 1.0.0 short someInt 1.0.0 int someLong 1.0.0 long someFloat 1.0.0 float someDouble 1.0.0 double someString 1.0.0 String someDate 1.0.0 Date someProperties 1.0.0 Properties String * someStringList 1.0.0 List String * someStringSet 1.0.0 Set String * thingy 1.0.0 Thingy 1 thingyList 1.0.0 List Thingy * thingySet 1.0.0 Set Thingy * Thingy SuperThing 1.0.0 modello-maven-plugin1.4-1.4.1/src/it/dom4j-no-plexus-utils/verify.bsh000066400000000000000000000006261166655001500253140ustar00rootroot00000000000000import java.io.*; File readerClass = new File( basedir, "target/classes/test/io/dom4j/ThingDom4jReader.class" ); if ( !readerClass.isFile() ) { throw new FileNotFoundException( "Missing " + readerClass ); } File writerClass = new File( basedir, "target/classes/test/io/dom4j/ThingDom4jWriter.class" ); if ( !writerClass.isFile() ) { throw new FileNotFoundException( "Missing " + writerClass ); } modello-maven-plugin1.4-1.4.1/src/it/jdom-no-plexus-utils/000077500000000000000000000000001166655001500232225ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/jdom-no-plexus-utils/pom.xml000066400000000000000000000041641166655001500245440ustar00rootroot00000000000000 4.0.0 org.codehaus.modello.its jdom-no-plexus-utils 0.1-SNAPSHOT JDOM IT Test that the JDOM based readers/writers do not have a dependency on plexus-utils' Xpp3Dom if the model does not use DOM fields. org.jdom jdom 1.1 compile test org.apache.maven.plugins maven-compiler-plugin 2.0.2 1.4 1.4 org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.4.3 org.codehaus.modello modello-maven-plugin @project.version@ 1.0.0 src/main/mdo/thing.mdo standard java jdom-writer modello-maven-plugin1.4-1.4.1/src/it/jdom-no-plexus-utils/src/000077500000000000000000000000001166655001500240115ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/jdom-no-plexus-utils/src/main/000077500000000000000000000000001166655001500247355ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/jdom-no-plexus-utils/src/main/mdo/000077500000000000000000000000001166655001500255145ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/jdom-no-plexus-utils/src/main/mdo/thing.mdo000066400000000000000000000067051166655001500273360ustar00rootroot00000000000000 thing Thing package test SuperThing 1.0.0 Thing SuperThing 1.0.0 someBoolean 1.0.0 boolean someChar 1.0.0 char someByte 1.0.0 byte someShort 1.0.0 short someInt 1.0.0 int someLong 1.0.0 long someFloat 1.0.0 float someDouble 1.0.0 double someString 1.0.0 String someDate 1.0.0 Date someProperties 1.0.0 Properties String * someStringList 1.0.0 List String * someStringSet 1.0.0 Set String * thingy 1.0.0 Thingy 1 thingyList 1.0.0 List Thingy * thingySet 1.0.0 Set Thingy * Thingy SuperThing 1.0.0 modello-maven-plugin1.4-1.4.1/src/it/jdom-no-plexus-utils/verify.bsh000066400000000000000000000003221166655001500252210ustar00rootroot00000000000000import java.io.*; File writerClass = new File( basedir, "target/classes/test/io/jdom/ThingJDOMWriter.class" ); if ( !writerClass.isFile() ) { throw new FileNotFoundException( "Missing " + writerClass ); } modello-maven-plugin1.4-1.4.1/src/it/settings.xml000066400000000000000000000031741166655001500215720ustar00rootroot00000000000000 it-repo true local.central @localRepositoryUrl@ true true local.central @localRepositoryUrl@ true true modello-maven-plugin1.4-1.4.1/src/it/stax-no-plexus-utils/000077500000000000000000000000001166655001500232505ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/stax-no-plexus-utils/pom.xml000066400000000000000000000045231166655001500245710ustar00rootroot00000000000000 4.0.0 org.codehaus.modello.its stax-no-plexus-utils 0.1-SNAPSHOT StAX IT Test that the StAX based readers/writers do not have a dependency on plexus-utils' Xpp3Dom if the model does not use DOM fields. stax stax-api 1.0.1 compile org.codehaus.woodstox wstx-asl 3.2.0 compile test org.apache.maven.plugins maven-compiler-plugin 2.0.2 1.4 1.4 org.apache.maven.plugins maven-resources-plugin 2.2 org.apache.maven.plugins maven-surefire-plugin 2.4.3 org.codehaus.modello modello-maven-plugin @project.version@ 1.0.0 src/main/mdo/thing.mdo standard java stax-reader stax-writer modello-maven-plugin1.4-1.4.1/src/it/stax-no-plexus-utils/src/000077500000000000000000000000001166655001500240375ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/stax-no-plexus-utils/src/main/000077500000000000000000000000001166655001500247635ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/stax-no-plexus-utils/src/main/mdo/000077500000000000000000000000001166655001500255425ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/it/stax-no-plexus-utils/src/main/mdo/thing.mdo000066400000000000000000000067051166655001500273640ustar00rootroot00000000000000 thing Thing package test SuperThing 1.0.0 Thing SuperThing 1.0.0 someBoolean 1.0.0 boolean someChar 1.0.0 char someByte 1.0.0 byte someShort 1.0.0 short someInt 1.0.0 int someLong 1.0.0 long someFloat 1.0.0 float someDouble 1.0.0 double someString 1.0.0 String someDate 1.0.0 Date someProperties 1.0.0 Properties String * someStringList 1.0.0 List String * someStringSet 1.0.0 Set String * thingy 1.0.0 Thingy 1 thingyList 1.0.0 List Thingy * thingySet 1.0.0 Set Thingy * Thingy SuperThing 1.0.0 modello-maven-plugin1.4-1.4.1/src/it/stax-no-plexus-utils/verify.bsh000066400000000000000000000006221166655001500252520ustar00rootroot00000000000000import java.io.*; File readerClass = new File( basedir, "target/classes/test/io/stax/ThingStaxReader.class" ); if ( !readerClass.isFile() ) { throw new FileNotFoundException( "Missing " + readerClass ); } File writerClass = new File( basedir, "target/classes/test/io/stax/ThingStaxWriter.class" ); if ( !writerClass.isFile() ) { throw new FileNotFoundException( "Missing " + writerClass ); } modello-maven-plugin1.4-1.4.1/src/main/000077500000000000000000000000001166655001500175135ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/main/java/000077500000000000000000000000001166655001500204345ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/main/java/org/000077500000000000000000000000001166655001500212235ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/000077500000000000000000000000001166655001500230165ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/000077500000000000000000000000001166655001500244515ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/000077500000000000000000000000001166655001500255575ustar00rootroot00000000000000AbstractModelloGeneratorMojo.java000066400000000000000000000252161166655001500341240ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/mavenpackage org.codehaus.modello.maven; /* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Properties; import org.apache.maven.model.Resource; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import org.codehaus.modello.ModelloException; import org.codehaus.modello.ModelloParameterConstants; import org.codehaus.modello.core.ModelloCore; import org.codehaus.modello.model.Model; import org.codehaus.modello.model.ModelValidationException; import org.sonatype.plexus.build.incremental.BuildContext; import org.codehaus.plexus.util.StringUtils; /** * @author Trygve Laugstøl * @version $Id: AbstractModelloGeneratorMojo.java 1490 2010-05-29 19:38:05Z bentmann $ * * @threadSafe */ public abstract class AbstractModelloGeneratorMojo extends AbstractMojo { // ---------------------------------------------------------------------- // Parameters // ---------------------------------------------------------------------- /** * Base directory of the project. * * @parameter default-value="${basedir}" * @readonly * @required */ private String basedir; /** * List of relative paths to mdo files containing the models. * * @parameter * @required */ private String[] models; /** * The version of the model we will be working on. * * @parameter expression="${version}" * @required */ private String version; /** * The encoding to use when generating Java source files. * * @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}" * @since 1.0-alpha-19 */ private String encoding; /** * True if the generated package names should include the version. * * @parameter expression="${packageWithVersion}" default-value="false" * @required */ private boolean packageWithVersion; /** *

Note: This is passed by Maven and must not be configured by the user.

* * @component */ private ModelloCore modelloCore; /** * The Maven project instance for the executing project. * * @parameter default-value="${project}" * @readonly * @required */ private MavenProject project; /** * Additional historical versions to generate, each being packaged with the version regardless of the * packageWithVersion setting. * * @parameter */ private List packagedVersions = new ArrayList(); /** * Generate Java 5 sources, with generic collections. * * @parameter expression="${useJava5}" default-value="false" */ private boolean useJava5; /** @component */ private BuildContext buildContext; // ---------------------------------------------------------------------- // Overridables // ---------------------------------------------------------------------- protected abstract String getGeneratorType(); public abstract File getOutputDirectory(); protected boolean producesCompilableResult() { return true; } protected boolean producesResources() { return false; } /** * Creates a Properties objects. *

* The abstract mojo will override the output directory, the version and the * package with version flag. * * @return the parameters */ protected Properties createParameters() { return new Properties(); } /** * Override this method to customize the values in the properties set. *

* This method will be called after the parameters have been populated with the * parameters in the abstract mojo. * * @param parameters the parameters to customize */ protected void customizeParameters( Properties parameters ) { } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public void execute() throws MojoExecutionException { String outputDirectory = getOutputDirectory().getAbsolutePath(); getLog().info( "outputDirectory: " + outputDirectory ); // ---------------------------------------------------------------------- // Initialize the parameters // ---------------------------------------------------------------------- Properties parameters = createParameters(); parameters.setProperty( ModelloParameterConstants.OUTPUT_DIRECTORY, outputDirectory ); parameters.setProperty( ModelloParameterConstants.VERSION, version ); parameters.setProperty( ModelloParameterConstants.PACKAGE_WITH_VERSION, Boolean.toString( packageWithVersion ) ); parameters.setProperty( ModelloParameterConstants.ALL_VERSIONS, StringUtils.join( packagedVersions.iterator(), "," ) ); parameters.setProperty( ModelloParameterConstants.USE_JAVA5, Boolean.toString( useJava5 ) ); if ( encoding != null ) { parameters.setProperty( ModelloParameterConstants.ENCODING, encoding ); } customizeParameters( parameters ); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- try { for ( int i = 0; i < models.length; i++ ) { doExecute( models[i], outputDirectory, parameters ); } } catch ( FileNotFoundException e ) { throw new MojoExecutionException( "Couldn't find file.", e ); } catch ( ModelloException e ) { throw new MojoExecutionException( "Error generating.", e ); } catch ( ModelValidationException e ) { throw new MojoExecutionException( "Error generating.", e ); } catch ( IOException e ) { throw new MojoExecutionException( "Couldn't read file.", e ); } } /** * Performs execute on a single specified model. * * @param modelStr * @param parameters * @param outputDirectory * @throws IOException * @throws ModelloException * @throws ModelValidationException */ private void doExecute( String modelStr, String outputDirectory, Properties parameters ) throws IOException, ModelloException, ModelValidationException { if ( !buildContext.hasDelta( modelStr ) ) { getLog().debug( "Skipping unchanged model: " + modelStr ); return; } getLog().info( "Working on model: " + modelStr ); Model model = modelloCore.loadModel( new File( basedir, modelStr ) ); // TODO: dynamically resolve/load the generator type getLog().info( "Generating current version: " + version ); modelloCore.generate( model, getGeneratorType(), parameters ); for ( String version : packagedVersions ) { parameters.setProperty( ModelloParameterConstants.VERSION, version ); parameters.setProperty( ModelloParameterConstants.PACKAGE_WITH_VERSION, Boolean.toString( true ) ); getLog().info( "Generating packaged version: " + version ); modelloCore.generate( model, getGeneratorType(), parameters ); } if ( producesCompilableResult() && project != null ) { project.addCompileSourceRoot( outputDirectory ); } if ( producesResources() && project != null ) { Resource resource = new Resource(); resource.setDirectory( outputDirectory ); project.addResource( resource ); } } // ---------------------------------------------------------------------- // Accessors // ---------------------------------------------------------------------- public String getBasedir() { return basedir; } public void setBasedir( String basedir ) { this.basedir = basedir; } public String getVersion() { return version; } public void setVersion( String version ) { this.version = version; } public boolean getPackageWithVersion() { return packageWithVersion; } public void setPackageWithVersion( boolean packageWithVersion ) { this.packageWithVersion = packageWithVersion; } public ModelloCore getModelloCore() { return modelloCore; } public void setModelloCore( ModelloCore modelloCore ) { this.modelloCore = modelloCore; } public void setBuildContext( BuildContext context ) { this.buildContext = context; } public MavenProject getProject() { return project; } public void setProject( MavenProject project ) { this.project = project; } public void setPackagedVersions( List packagedVersions ) { this.packagedVersions = Collections.unmodifiableList( packagedVersions ); } /** * @return Returns the paths to the models. */ public String[] getModels() { return models; } /** * @param models Sets the paths to the models. */ public void setModels( String[] models ) { this.models = models; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloConvertersMojo.java000066400000000000000000000016131166655001500327160ustar00rootroot00000000000000package org.codehaus.modello.maven; import java.io.File; /** * Creates classes that can convert between different versions of the model. * * @author Brett Porter * @version $Id: ModelloConvertersMojo.java 1094 2009-01-02 22:06:17Z hboutemy $ * @goal converters * @phase generate-sources */ public class ModelloConvertersMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated Java beans. * * @parameter expression="${basedir}/target/generated-sources/modello" * @required */ private File outputDirectory; protected String getGeneratorType() { return "converters"; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloDom4jReaderMojo.java000066400000000000000000000014571166655001500326720ustar00rootroot00000000000000package org.codehaus.modello.maven; import java.io.File; /** * Creates a DOM4J reader from the model. * * @version $Id: ModelloDom4jReaderMojo.java 1244 2009-06-10 21:47:16Z olamy $ * @goal dom4j-reader * @phase generate-sources */ public class ModelloDom4jReaderMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated DOM4J reader. * * @parameter expression="${basedir}/target/generated-sources/modello" * @required */ private File outputDirectory; protected String getGeneratorType() { return "dom4j-reader"; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloDom4jWriterMojo.java000066400000000000000000000014571166655001500327440ustar00rootroot00000000000000package org.codehaus.modello.maven; import java.io.File; /** * Creates a DOM4J writer from the model. * * @version $Id: ModelloDom4jWriterMojo.java 1244 2009-06-10 21:47:16Z olamy $ * @goal dom4j-writer * @phase generate-sources */ public class ModelloDom4jWriterMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated DOM4J reader. * * @parameter expression="${basedir}/target/generated-sources/modello" * @required */ private File outputDirectory; protected String getGeneratorType() { return "dom4j-writer"; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloGenerateMojo.java000066400000000000000000000103521166655001500323160ustar00rootroot00000000000000package org.codehaus.modello.maven; /* * Copyright (c) 2007, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import org.apache.maven.plugin.MojoExecutionException; import org.codehaus.modello.plugin.ModelloGenerator; import java.io.File; import java.util.Map; /** *

* A dynamic way to use generators and Modello plugins. *

* *

* Example Usage: *

*
 *   <plugin>
 *     <groupId>org.codehaus.modello</groupId>
 *     <artifactId>modello-maven-plugin</artifactId>
 *     <version>1.3</version>
 *     <dependencies>
 *       <dependency>
 *         <groupId>org.codehaus.modello</groupId>
 *         <artifactId>modello-plugin-jpa</artifactId>
 *         <version>1.0.0-SNAPSHOT</version>
 *       </dependency>
 *     </dependencies>
 *     <configuration>
 *       <version>1.0.0</version>
 *       <packageWithVersion>false</packageWithVersion>
 *       <models>
 *         <model>src/main/mdo/project-model.xml</model>
 *       </models>
 *     </configuration>
 *     <executions>
 *       <execution>
 *         <id>java</id>
 *         <goals>
 *           <goal>generate</goal>
 *         </goals>
 *         <configuration>
 *           <generatorId>java</generatorId>
 *         </configuration>
 *       </execution>
 *       <execution>
 *         <id>jpa</id>
 *         <goals>
 *           <goal>generate</goal>
 *         </goals>
 *         <configuration>
 *           <generatorId>jpa-mapping</generatorId>
 *         </configuration>
 *       </execution>
 *     </executions>
 *   </plugin>
 * 
* * @author Joakim Erdfelt * @version $Id: ModelloGenerateMojo.java 1482 2010-05-08 15:29:13Z bentmann $ * * @goal generate * @phase generate-sources */ public class ModelloGenerateMojo extends AbstractModelloGeneratorMojo { /** * @component role="org.codehaus.modello.plugin.ModelloGenerator" * @required */ private Map generatorMap; /** * @parameter expression="${modello.generator.id}" default-value="java" */ private String generatorId; /** * The output directory of the generated source files. * * @parameter expression="${basedir}/target/generated-sources/modello" * @required */ private File outputDirectory; protected String getGeneratorType() { return generatorId; } public File getOutputDirectory() { return outputDirectory; } public void execute() throws MojoExecutionException { if ( !generatorMap.containsKey( generatorId ) ) { throw new MojoExecutionException( "Unable to execute modello, generator id [" + generatorId + "] not found. (Available generator ids : " + generatorMap.keySet() + ")" ); } getLog().info( "[modello:generate {generator: " + generatorId + "}]" ); super.execute(); } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloJDOMWriterMojo.java000066400000000000000000000037721166655001500325220ustar00rootroot00000000000000/* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package org.codehaus.modello.maven; import java.io.File; /** * Creates a jdom writer from the model that is capable of preserving element ordering * and comments. In future it should also preserve whitespace. * * @goal jdom-writer * * @phase generate-sources * * @author Milos Kleint * */ public class ModelloJDOMWriterMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated jdom writer. * * @parameter expression="${basedir}/target/generated-sources/modello" * * @required */ private File outputDirectory; protected String getGeneratorType() { return "jdom-writer"; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloJavaMojo.java000066400000000000000000000036711166655001500314530ustar00rootroot00000000000000package org.codehaus.modello.maven; /* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import java.io.File; /** * Creates Java beans from the Modello model. * * @author Trygve Laugstøl * @version $Id: ModelloJavaMojo.java 688 2006-11-21 13:45:03Z brett $ * @goal java * @phase generate-sources */ public class ModelloJavaMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated Java beans. * * @parameter expression="${basedir}/target/generated-sources/modello" * @required */ private File outputDirectory; protected String getGeneratorType() { return "java"; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloStaxReaderMojo.java000066400000000000000000000015531166655001500326310ustar00rootroot00000000000000package org.codehaus.modello.maven; import java.io.File; /** * Creates an StAX reader from the model. * * @author Brett Porter * @version $Id: ModelloStaxReaderMojo.java 1094 2009-01-02 22:06:17Z hboutemy $ * @goal stax-reader * @phase generate-sources */ public class ModelloStaxReaderMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated StAX reader. * * @parameter expression="${basedir}/target/generated-sources/modello" * @required */ private File outputDirectory; protected String getGeneratorType() { return "stax-reader"; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloStaxWriterMojo.java000066400000000000000000000015531166655001500327030ustar00rootroot00000000000000package org.codehaus.modello.maven; import java.io.File; /** * Creates an StAX writer from the model. * * @author Brett Porter * @version $Id: ModelloStaxWriterMojo.java 1094 2009-01-02 22:06:17Z hboutemy $ * @goal stax-writer * @phase generate-sources */ public class ModelloStaxWriterMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated StAX writer. * * @parameter expression="${basedir}/target/generated-sources/modello" * @required */ private File outputDirectory; protected String getGeneratorType() { return "stax-writer"; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloXdocMojo.java000066400000000000000000000063471166655001500314720ustar00rootroot00000000000000package org.codehaus.modello.maven; /* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import org.codehaus.modello.ModelloParameterConstants; import java.io.File; import java.util.Properties; /** * Creates documentation for the model in xdoc format. * * @goal xdoc * * @author Brett Porter * @version $Id: ModelloXdocMojo.java 914 2008-07-28 07:29:56Z olamy $ */ public class ModelloXdocMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated documentation. * * @parameter expression="${basedir}/target/generated-site/xdoc" * * @required */ private File outputDirectory; /** * * @parameter * * @since 1.0-alpha-21 */ private String xdocFileName; /** * The first version of the model. This is used to decide whether or not * to show the since column. If this is not specified, it defaults to the * version of the model, which in turn means that the since column will not * be shown. * * @parameter * @since 1.0-alpha-14 */ private String firstVersion; protected String getGeneratorType() { return "xdoc"; } protected boolean producesCompilableResult() { return false; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } protected void customizeParameters( Properties parameters ) { super.customizeParameters( parameters ); // Use version if firstVersion was not specified if ( firstVersion == null ) { firstVersion = getVersion(); } parameters.put( ModelloParameterConstants.FIRST_VERSION, firstVersion ); if ( xdocFileName != null ) { parameters.put( ModelloParameterConstants.OUTPUT_XDOC_FILE_NAME, xdocFileName ); } } public String getFirstVersion() { return firstVersion; } public void setFirstVersion( String firstVersion ) { this.firstVersion = firstVersion; } } ModelloXpp3ExtendedReaderMojo.java000066400000000000000000000033171166655001500341460ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/mavenpackage org.codehaus.modello.maven; /* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * Creates an XPP3 extended reader from the model. An extended reader populates the parsed model with metadata about the * line/column from which the data was read if the model supports this. * * @goal xpp3-extended-reader * * @phase generate-sources * * @since 1.4 * @author Benjamin Bentmann * @version $Id: ModelloXpp3ExtendedReaderMojo.java 1467 2010-04-20 10:04:44Z bentmann $ */ public class ModelloXpp3ExtendedReaderMojo extends ModelloXpp3ReaderMojo { @Override protected String getGeneratorType() { return "xpp3-extended-reader"; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloXpp3ReaderMojo.java000066400000000000000000000037261166655001500325500ustar00rootroot00000000000000package org.codehaus.modello.maven; import java.io.File; /* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * Creates an XPP3 reader from the model. * * @goal xpp3-reader * * @phase generate-sources * * @author Brett Porter * @version $Id: ModelloXpp3ReaderMojo.java 765 2006-12-27 00:00:20Z aheritier $ */ public class ModelloXpp3ReaderMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated XPP reader. * * @parameter expression="${basedir}/target/generated-sources/modello" * * @required */ private File outputDirectory; protected String getGeneratorType() { return "xpp3-reader"; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloXpp3WriterMojo.java000066400000000000000000000037261166655001500326220ustar00rootroot00000000000000package org.codehaus.modello.maven; import java.io.File; /* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * Creates an XPP3 writer from the model. * * @goal xpp3-writer * * @phase generate-sources * * @author Brett Porter * @version $Id: ModelloXpp3WriterMojo.java 765 2006-12-27 00:00:20Z aheritier $ */ public class ModelloXpp3WriterMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated XPP writer. * * @parameter expression="${basedir}/target/generated-sources/modello" * * @required */ private File outputDirectory; protected String getGeneratorType() { return "xpp3-writer"; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/main/java/org/codehaus/modello/maven/ModelloXsdMojo.java000066400000000000000000000051751166655001500313310ustar00rootroot00000000000000package org.codehaus.modello.maven; /* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import java.io.File; import java.util.Properties; import org.codehaus.modello.ModelloParameterConstants; /** * Creates an XML schema from the model. * * @goal xsd * * @phase generate-sources * * @author Brett Porter * @version $Id: ModelloXsdMojo.java 1081 2009-01-01 17:34:36Z hboutemy $ */ public class ModelloXsdMojo extends AbstractModelloGeneratorMojo { /** * The output directory of the generated XML Schema. Hint: if you want to publish the schema automatically with * the site, configure this parameter to ${basedir}/target/generated-site/resources/xsd. * * @parameter expression="${basedir}/target/generated-site/xsd" * * @required */ private File outputDirectory; /** * * @parameter * * @since 1.0-alpha-21 */ private String xsdFileName; protected String getGeneratorType() { return "xsd"; } protected void customizeParameters( Properties parameters ) { super.customizeParameters( parameters ); if ( xsdFileName != null ) { parameters.put( ModelloParameterConstants.OUTPUT_XSD_FILE_NAME, xsdFileName ); } } protected boolean producesCompilableResult() { return false; } public File getOutputDirectory() { return outputDirectory; } public void setOutputDirectory( File outputDirectory ) { this.outputDirectory = outputDirectory; } } modello-maven-plugin1.4-1.4.1/src/site/000077500000000000000000000000001166655001500175335ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/site/apt/000077500000000000000000000000001166655001500203175ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/site/apt/examples/000077500000000000000000000000001166655001500221355ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/site/apt/examples/multi-model.apt.vm000066400000000000000000000033411166655001500255150ustar00rootroot00000000000000 ------ Example of multi-model configuration ------ Denis Cabasson ------ 10 August 2006 ------ Processing Multiple Modello Models * Configuring your pom.xml You can use the following configuration in your <<>> to have the Modello Plugin take two of your models into account (this configuration is taken from the maven-assembly-plugin which indeed uses two different models). +---+ [...] [...] org.codehaus.modello modello-maven-plugin ${project.version} mdo generate-sources xpp3-reader xpp3-writer java xsd src/main/mdo/descriptor.mdo src/main/mdo/component.mdo 1.0.0 mdo-site pre-site xdoc xsd src/main/mdo/descriptor.mdo src/main/mdo/component.mdo 1.0.0 [...] [...] +---+ modello-maven-plugin1.4-1.4.1/src/site/apt/index.apt000066400000000000000000000057651166655001500221510ustar00rootroot00000000000000 ------ Introduction ------ Denis Cabasson HervĂ© Boutemy ------ 1 January 2009 ------ Modello Maven Plugin This plugin makes use of the {{{http://modello.codehaus.org/}Modello}} project. * Goals Overview * {{{./xsd-mojo.html}modello:xsd}} Generates an XML Schema from the Modello model. * {{{./xdoc-mojo.html}modello:xdoc}} Generates standard documentation for the Modello model, in xdoc format. * {{{./java-mojo.html}modello:java}} Generates Java beans from the Modello model. * {{{./xpp3-writer-mojo.html}modello:xpp3-writer}} Generates an XML Pull Parser writer from the Modello model. * {{{./xpp3-reader-mojo.html}modello:xpp3-reader}} Generates an XML Pull Parser reader from the Modello model. * {{{./xpp3-extended-reader-mojo.html}modello:xpp3-extended-reader}} Generates an XML Pull Parser reader from the Modello model that records line/column number metadata in the parsed model. * {{{./dom4j-writer-mojo.html}modello:dom4j-writer}} Generates a DOM4J writer from the Modello model. * {{{./dom4j-reader-mojo.html}modello:dom4j-reader}} Generates a DOM4J reader from the Modello model. * {{{./stax-writer-mojo.html}modello:stax-writer}} Generates a StAX writer from the Modello model. * {{{./stax-reader-mojo.html}modello:stax-reader}} Generates a StAX reader from the Modello model. * {{{./jdom-writer-mojo.html}modello:jdom-writer}} Generates a {{{http://www.jdom.org/}jdom}} writer from the model that is capable of preserving element ordering and comments. * {{{./converters-mojo.html}modello:converters}} Generates classes that can convert between different versions of the model. [] * Usage General instructions on how to use the Modello Plugin can be found on the {{{./usage.html}usage page}}. Some more specific use cases are described in the examples given below. In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the {{{./mail-lists.html}mail archive}}. If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our {{{./source-repository.html}source repository}}. * Examples To provide you with better understanding of some usages of the Modello Plugin, you can take a look at the following example: * {{{./examples/multi-model.html}Including multiple models}} modello-maven-plugin1.4-1.4.1/src/site/apt/usage.apt.vm000066400000000000000000000053101166655001500225510ustar00rootroot00000000000000 ------ Usage ------ Denis Cabasson ------ 10 August 2006 ------ Usage This document is intended to provide instructions for using the modello-maven-plugin. * Typical configuration of the plugin in pom.xml You can use the following configuration in your <<>> to invoke the Modello Plugin. +---+ [...] [...] org.codehaus.modello modello-maven-plugin ${project.version} src/main/mdo/myModel.mdo 1.0.0 myModel generate-sources java xpp3-reader myModel-site-xsd pre-site xsd target/generated-site/resources/xsd myModel-site-doc pre-site xdoc [...] [...] +---+ This configuration will take into account the model described in the file <<>> in version 1.0.0. It will execute the following goals in the <<>> phase: * {{{./java-mojo.html}java}} which will generate Java beans from the model, * {{{./xpp3-reader-mojo.html}xpp3-reader}} which will create an XPP reader for the model. [] The generated Java sources will be located in the <<>> folder (or in the folder set by the <<>> parameter), which will be added as a source folder to the project build cycle. During the <<>> phase, it will execute the following goals: * {{{./xdoc-mojo.html}xdoc}} which will generate a documentation of the model in the <<>> folder, which will in turn be processed to output in the standard site, during the <<>> phase, * {{{./xsd-mojo.html}xsd}} which will generate an XML Schema for our model in the <<>> folder (set by the <<>> parameter), which will in turn be copied in the standard site, during the <<>> phase. [] modello-maven-plugin1.4-1.4.1/src/site/fml/000077500000000000000000000000001166655001500203115ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/site/fml/faq.fml000066400000000000000000000037521166655001500215670ustar00rootroot00000000000000 Where can I find documentation about Modello?

A good starting place to get some insight into Modello is Modello's wiki.

Modello model descriptor is described and documented with Modello.

Is Modello really used anywhere?

Modello is used extensively in Maven. You can find examples of models:

modello-maven-plugin1.4-1.4.1/src/site/site.xml000066400000000000000000000013351166655001500212230ustar00rootroot00000000000000 Modello modello-maven-plugin1.4-1.4.1/src/test/000077500000000000000000000000001166655001500175465ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/test/java/000077500000000000000000000000001166655001500204675ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/test/java/org/000077500000000000000000000000001166655001500212565ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/test/java/org/codehaus/000077500000000000000000000000001166655001500230515ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/test/java/org/codehaus/modello/000077500000000000000000000000001166655001500245045ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/test/java/org/codehaus/modello/maven/000077500000000000000000000000001166655001500256125ustar00rootroot00000000000000ModelloConvertersMojoTest.java000066400000000000000000000106221166655001500335320ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/test/java/org/codehaus/modello/mavenpackage org.codehaus.modello.maven; /* * Copyright (c) 2006, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import org.codehaus.modello.core.ModelloCore; import org.codehaus.plexus.PlexusTestCase; import org.sonatype.plexus.build.incremental.BuildContext; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.util.Arrays; /** * @author Brett Porter * @version $Id: ModelloConvertersMojoTest.java 1184 2009-02-13 17:39:38Z igorife $ */ public class ModelloConvertersMojoTest extends PlexusTestCase { public void testModelloConvertersMojo() throws Exception { ModelloCore modelloCore = (ModelloCore) lookup( ModelloCore.ROLE ); BuildContext buildContext = (BuildContext) lookup( BuildContext.class ); ModelloConvertersMojo mojo = new ModelloConvertersMojo(); File outputDirectory = getTestFile( "target/converters-test" ); FileUtils.deleteDirectory( outputDirectory ); // ---------------------------------------------------------------------- // Call the mojo // ---------------------------------------------------------------------- mojo.setOutputDirectory( outputDirectory ); String models[] = new String[1]; models[0] = getTestPath( "src/test/resources/java-model.mdo" ); mojo.setModels( models ); mojo.setVersion( "1.0.0" ); mojo.setPackageWithVersion( false ); mojo.setPackagedVersions( Arrays.asList( new String[] { "0.9.0", "1.0.0" } ) ); mojo.setModelloCore( modelloCore ); mojo.setBuildContext( buildContext ); mojo.execute(); // ---------------------------------------------------------------------- // Assert // ---------------------------------------------------------------------- File javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/v1_0_0/convert/VersionConverter.java" ); assertTrue( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/v1_0_0/convert/BasicVersionConverter.java" ); assertTrue( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/v0_9_0/convert/VersionConverter.java" ); assertTrue( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/v0_9_0/convert/BasicVersionConverter.java" ); assertTrue( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/convert/VersionConverter.java" ); assertFalse( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/convert/BasicVersionConverter.java" ); assertFalse( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); } } modello-maven-plugin1.4-1.4.1/src/test/java/org/codehaus/modello/maven/ModelloJavaMojoTest.java000066400000000000000000000102741166655001500323430ustar00rootroot00000000000000package org.codehaus.modello.maven; /* * Copyright (c) 2004, Codehaus.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import org.codehaus.modello.core.ModelloCore; import org.codehaus.plexus.PlexusTestCase; import org.sonatype.plexus.build.incremental.BuildContext; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.util.Arrays; /** * @author Trygve Laugstøl * @version $Id: ModelloJavaMojoTest.java 1184 2009-02-13 17:39:38Z igorife $ */ public class ModelloJavaMojoTest extends PlexusTestCase { public void testModelloJavaMojo() throws Exception { ModelloCore modelloCore = (ModelloCore) lookup( ModelloCore.ROLE ); BuildContext buildContext = (BuildContext) lookup( BuildContext.class ); ModelloJavaMojo mojo = new ModelloJavaMojo(); File outputDirectory = getTestFile( "target/java-test" ); FileUtils.deleteDirectory( outputDirectory ); // ---------------------------------------------------------------------- // Call the mojo // ---------------------------------------------------------------------- mojo.setOutputDirectory( outputDirectory ); String models[] = new String[1]; models[0] = getTestPath( "src/test/resources/java-model.mdo" ); mojo.setModels( models ); mojo.setVersion( "1.0.0" ); mojo.setPackageWithVersion( false ); mojo.setPackagedVersions( Arrays.asList( new String[] { "0.9.0", "1.0.0" } ) ); mojo.setModelloCore( modelloCore ); mojo.setBuildContext( buildContext ); mojo.execute(); // ---------------------------------------------------------------------- // Assert // ---------------------------------------------------------------------- File javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/Model.java" ); assertTrue( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/NewModel.java" ); assertTrue( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/v1_0_0/Model.java" ); assertTrue( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/v1_0_0/NewModel.java" ); assertTrue( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/v0_9_0/Model.java" ); assertTrue( "The generated java file doesn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); javaFile = new File( outputDirectory, "org/codehaus/mojo/modello/javatest/v0_9_0/NewModel.java" ); assertFalse( "The generated java file shouldn't exist: '" + javaFile.getAbsolutePath() + "'.", javaFile.exists() ); } } modello-maven-plugin1.4-1.4.1/src/test/resources/000077500000000000000000000000001166655001500215605ustar00rootroot00000000000000modello-maven-plugin1.4-1.4.1/src/test/resources/java-model.mdo000066400000000000000000000015461166655001500243060ustar00rootroot00000000000000 maven-java-mojo-test-model Modello Java Mojo Test Model Model package org.codehaus.mojo.modello.javatest Model 0.9.0+ extend 1.0.0+ String NewModel 1.0.0+