├── .github ├── dependabot.yml ├── release-drafter.yml └── workflows │ ├── maven.yml │ └── release-drafter.yml ├── .gitignore ├── LICENSE.txt ├── README.md ├── modello-core ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── codehaus │ │ └── modello │ │ ├── Modello.java │ │ ├── ModelloCli.java │ │ ├── ModelloException.java │ │ ├── ModelloParameterConstants.java │ │ ├── ModelloRuntimeException.java │ │ ├── core │ │ ├── AbstractModelloCore.java │ │ ├── DefaultGeneratorPluginManager.java │ │ ├── DefaultMetadataPluginManager.java │ │ ├── DefaultModelloCore.java │ │ ├── GeneratorPluginManager.java │ │ ├── MetadataPluginManager.java │ │ ├── ModelloCore.java │ │ └── io │ │ │ └── ModelReader.java │ │ ├── metadata │ │ ├── AbstractMetadataPlugin.java │ │ ├── AssociationMetadata.java │ │ ├── ClassMetadata.java │ │ ├── FieldMetadata.java │ │ ├── InterfaceMetadata.java │ │ ├── Metadata.java │ │ ├── MetadataPlugin.java │ │ └── ModelMetadata.java │ │ ├── model │ │ ├── BaseElement.java │ │ ├── CodeSegment.java │ │ ├── Model.java │ │ ├── ModelAssociation.java │ │ ├── ModelClass.java │ │ ├── ModelDefault.java │ │ ├── ModelField.java │ │ ├── ModelInterface.java │ │ ├── ModelType.java │ │ ├── ModelValidationException.java │ │ ├── Version.java │ │ ├── VersionDefinition.java │ │ ├── VersionRange.java │ │ └── VersionUtil.java │ │ └── plugin │ │ ├── AbstractModelloGenerator.java │ │ ├── AbstractPluginManager.java │ │ ├── ModelloGenerator.java │ │ └── model │ │ ├── ModelAssociationMetadata.java │ │ ├── ModelClassMetadata.java │ │ ├── ModelFieldMetadata.java │ │ ├── ModelInterfaceMetadata.java │ │ ├── ModelMetadataPlugin.java │ │ └── ModelModelMetadata.java │ ├── site │ └── site.xml │ └── test │ ├── java │ └── org │ │ └── codehaus │ │ └── modello │ │ ├── core │ │ ├── DefaultModelloCoreTest.java │ │ └── io │ │ │ └── ModelReaderTest.java │ │ ├── model │ │ ├── VersionDefinitionTest.java │ │ └── VersionTest.java │ │ └── plugin │ │ └── AbstractModelloGeneratorTest.java │ └── resources │ └── models │ ├── association.mdo │ ├── duplicate-associations.mdo │ ├── duplicate-classes.mdo │ ├── duplicate-fields.mdo │ ├── recursion.mdo │ └── simple.mdo ├── modello-maven-plugin ├── pom.xml └── src │ ├── it │ ├── clone-java5 │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── mdo │ │ │ │ └── thing.mdo │ │ │ └── test │ │ │ └── java │ │ │ └── test │ │ │ └── CloneTest.java │ ├── clone │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── mdo │ │ │ │ └── thing.mdo │ │ │ └── test │ │ │ └── java │ │ │ └── test │ │ │ └── CloneTest.java │ ├── dom4j-no-plexus-utils │ │ ├── pom.xml │ │ ├── src │ │ │ └── main │ │ │ │ └── mdo │ │ │ │ └── thing.mdo │ │ └── verify.bsh │ ├── features │ │ ├── invoker.properties │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── codehaus │ │ │ │ └── modello │ │ │ │ └── OrderedProperties.java │ │ │ └── site │ │ │ └── site.xml │ ├── javadoc │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── mdo │ │ │ └── model.mdo │ ├── jdom-no-plexus-utils │ │ ├── pom.xml │ │ ├── src │ │ │ └── main │ │ │ │ └── mdo │ │ │ │ └── thing.mdo │ │ └── verify.bsh │ ├── maven-model │ │ ├── pom.xml │ │ ├── src │ │ │ ├── main │ │ │ │ └── mdo │ │ │ │ │ └── maven.mdo │ │ │ └── test │ │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── codehaus │ │ │ │ │ └── modello │ │ │ │ │ └── xpp3 │ │ │ │ │ └── Xpp3ParsingTest.java │ │ │ │ └── models │ │ │ │ ├── model-with-missing-elements.xml │ │ │ │ ├── model-with-post-tags.xml │ │ │ │ └── model-with-wrong-root-tag.xml │ │ └── verify.groovy │ ├── settings.xml │ ├── snakeyaml │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── mdo │ │ │ │ └── model.mdo │ │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── plexus │ │ │ └── modello │ │ │ └── demo │ │ │ └── model │ │ │ └── RootTest.java │ └── stax-no-plexus-utils │ │ ├── pom.xml │ │ ├── src │ │ └── main │ │ │ └── mdo │ │ │ └── thing.mdo │ │ └── verify.bsh │ ├── main │ └── java │ │ └── org │ │ └── codehaus │ │ └── modello │ │ └── maven │ │ ├── AbstractModelloGeneratorMojo.java │ │ ├── AbstractModelloSourceGeneratorMojo.java │ │ ├── ModelloConvertersMojo.java │ │ ├── ModelloDom4jReaderMojo.java │ │ ├── ModelloDom4jWriterMojo.java │ │ ├── ModelloGenerateMojo.java │ │ ├── ModelloJDOMWriterMojo.java │ │ ├── ModelloJacksonExtendedReaderMojo.java │ │ ├── ModelloJacksonReaderMojo.java │ │ ├── ModelloJacksonWriterMojo.java │ │ ├── ModelloJavaMojo.java │ │ ├── ModelloJsonSchemaGeneratorMojo.java │ │ ├── ModelloSaxWriterMojo.java │ │ ├── ModelloSnakeYamlExtendedReaderMojo.java │ │ ├── ModelloSnakeYamlReaderMojo.java │ │ ├── ModelloSnakeYamlWriterMojo.java │ │ ├── ModelloStaxReaderMojo.java │ │ ├── ModelloStaxWriterMojo.java │ │ ├── ModelloVelocityMojo.java │ │ ├── ModelloXdocMojo.java │ │ ├── ModelloXpp3ExtendedReaderMojo.java │ │ ├── ModelloXpp3ExtendedWriterMojo.java │ │ ├── ModelloXpp3ReaderMojo.java │ │ ├── ModelloXpp3WriterMojo.java │ │ └── ModelloXsdMojo.java │ ├── site │ ├── apt │ │ ├── examples │ │ │ └── multi-model.apt.vm │ │ ├── index.apt │ │ └── usage.apt.vm │ ├── fml │ │ └── faq.fml │ └── site.xml │ └── test │ ├── java │ └── org │ │ └── codehaus │ │ └── modello │ │ └── maven │ │ ├── AbstractModelloSourceGeneratorMojoTest.java │ │ ├── ModelloConvertersMojoTest.java │ │ └── ModelloJavaMojoTest.java │ ├── resources │ └── java-model.mdo │ └── verifier │ └── site-verifications.xml ├── modello-plugins ├── modello-plugin-converters │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── converters │ │ │ └── ConverterGenerator.java │ │ ├── site │ │ ├── site.xml │ │ └── xdoc │ │ │ └── index.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── converters │ │ │ └── ConverterGeneratorTest.java │ │ ├── resources │ │ └── models │ │ │ └── maven.mdo │ │ └── verifiers │ │ └── converters │ │ ├── ConvertersVerifier.java │ │ ├── expected-v3.xml │ │ ├── expected.xml │ │ └── input.xml ├── modello-plugin-dom4j │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── dom4j │ │ │ ├── Dom4jReaderGenerator.java │ │ │ └── Dom4jWriterGenerator.java │ │ ├── site │ │ ├── site.xml │ │ └── xdoc │ │ │ └── index.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── dom4j │ │ │ ├── Dom4jGeneratorTest.java │ │ │ └── FeaturesDom4jGeneratorTest.java │ │ ├── resources │ │ └── maven.mdo │ │ └── verifiers │ │ ├── dom4j │ │ ├── Dom4jVerifier.java │ │ ├── expected-encoding.xml │ │ └── expected.xml │ │ └── features │ │ └── Dom4jFeaturesVerifier.java ├── modello-plugin-jackson │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── jackson │ │ │ ├── AbstractJacksonGenerator.java │ │ │ ├── JacksonExtendedReaderGenerator.java │ │ │ ├── JacksonReaderGenerator.java │ │ │ └── JacksonWriterGenerator.java │ │ ├── site │ │ ├── site.xml │ │ └── xdoc │ │ │ └── index.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── jackson │ │ │ └── JacksonGeneratorTest.java │ │ ├── resources │ │ └── maven.mdo │ │ └── verifiers │ │ └── jackson │ │ ├── JacksonVerifier.java │ │ └── expected.json ├── modello-plugin-java │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── java │ │ │ ├── AbstractJavaModelloGenerator.java │ │ │ ├── JavaModelloGenerator.java │ │ │ ├── javasource │ │ │ ├── JAnnotations.java │ │ │ ├── JArrayType.java │ │ │ ├── JClass.java │ │ │ ├── JCollectionType.java │ │ │ ├── JComment.java │ │ │ ├── JCompUnit.java │ │ │ ├── JComponentizedType.java │ │ │ ├── JConstructor.java │ │ │ ├── JDocComment.java │ │ │ ├── JDocDescriptor.java │ │ │ ├── JField.java │ │ │ ├── JInterface.java │ │ │ ├── JMapType.java │ │ │ ├── JMember.java │ │ │ ├── JMethod.java │ │ │ ├── JMethodSignature.java │ │ │ ├── JModifiers.java │ │ │ ├── JNaming.java │ │ │ ├── JParameter.java │ │ │ ├── JSourceCode.java │ │ │ ├── JSourceWriter.java │ │ │ ├── JStructure.java │ │ │ └── JType.java │ │ │ └── metadata │ │ │ ├── JavaAssociationMetadata.java │ │ │ ├── JavaClassMetadata.java │ │ │ ├── JavaFieldMetadata.java │ │ │ ├── JavaInterfaceMetadata.java │ │ │ ├── JavaMetadataPlugin.java │ │ │ └── JavaModelMetadata.java │ │ ├── site │ │ └── site.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── java │ │ │ ├── AbstractAnnotationsVerifier.java │ │ │ ├── AbstractPrincipal.java │ │ │ ├── AnnotationsJavaGeneratorTest.java │ │ │ ├── AssociationGeneratorTest.java │ │ │ ├── BiDirectionalOverrideJavaGeneratorTest.java │ │ │ ├── BuilderJavaGeneratorTest.java │ │ │ ├── FeaturesJava5GeneratorTest.java │ │ │ ├── FeaturesVersionJavaGeneratorTest.java │ │ │ ├── InterfaceAssociationTest.java │ │ │ ├── JavaGeneratorTest.java │ │ │ ├── LocationsJavaGeneratorTest.java │ │ │ ├── PackageVersionJavaTest.java │ │ │ ├── Permission.java │ │ │ ├── Role.java │ │ │ ├── StaticCreatorJavaGeneratorTest.java │ │ │ ├── TmpJavaGeneratorTest.java │ │ │ ├── ToStringJavaGeneratorTest.java │ │ │ └── javasource │ │ │ ├── JMapTypeTestCase.java │ │ │ └── JavaSourceTest.java │ │ ├── resources │ │ └── models │ │ │ ├── annotations.mdo │ │ │ ├── bidirectional-override.mdo │ │ │ ├── builder.mdo │ │ │ ├── interfaceAssociation.mdo │ │ │ ├── maven.mdo │ │ │ ├── oneToManyAssociation.mdo │ │ │ ├── static-creator.mdo │ │ │ ├── tmp.mdo │ │ │ └── tostring.mdo │ │ └── verifiers │ │ ├── annotations │ │ └── AnnotationsVerifier.java │ │ ├── bidirectional │ │ └── JavaVerifier.java │ │ ├── features-version │ │ └── JavaVerifier.java │ │ ├── features │ │ └── JavaVerifier.java │ │ ├── interfaceAssociationTest │ │ ├── InterfaceAssociationVerifier.java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── ifaceassociation │ │ │ └── package1 │ │ │ └── IPerson.java │ │ ├── java │ │ └── JavaVerifier.java │ │ ├── locations │ │ └── JavaLocationsVerifier.java │ │ ├── oneToManyAssociation │ │ └── OneToManyAssociationVerifier.java │ │ └── packageversion │ │ └── PackageVersionVerifier.java ├── modello-plugin-jdom │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── jdom │ │ │ ├── AbstractJDOMGenerator.java │ │ │ └── JDOMWriterGenerator.java │ │ ├── site │ │ ├── site.xml │ │ └── xdoc │ │ │ └── index.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── jdom │ │ │ └── FeaturesJDOMGeneratorTest.java │ │ └── verifiers │ │ └── features │ │ └── JDOMFeaturesVerifier.java ├── modello-plugin-jsonschema │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── jsonschema │ │ │ └── JsonSchemaGenerator.java │ │ └── site │ │ └── site.xml ├── modello-plugin-sax │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── sax │ │ │ └── SaxWriterGenerator.java │ │ ├── site │ │ ├── site.xml │ │ └── xdoc │ │ │ └── index.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── sax │ │ │ └── SaxGeneratorTest.java │ │ ├── resources │ │ └── maven.mdo │ │ └── verifiers │ │ └── sax │ │ ├── SaxVerifier.java │ │ └── expected.xml ├── modello-plugin-snakeyaml │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── snakeyaml │ │ │ ├── AbstractSnakeYamlGenerator.java │ │ │ ├── SnakeYamlExtendedReaderGenerator.java │ │ │ ├── SnakeYamlReaderGenerator.java │ │ │ └── SnakeYamlWriterGenerator.java │ │ ├── site │ │ ├── site.xml │ │ └── xdoc │ │ │ └── index.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── snakeyaml │ │ │ └── SnakeYamlGeneratorTest.java │ │ └── resources │ │ └── models │ │ └── maven.mdo ├── modello-plugin-stax │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── stax │ │ │ ├── AbstractStaxGenerator.java │ │ │ ├── DummyIdModelField.java │ │ │ ├── GeneratorNode.java │ │ │ ├── StaxReaderGenerator.java │ │ │ ├── StaxSerializerGenerator.java │ │ │ └── StaxWriterGenerator.java │ │ ├── site │ │ ├── site.xml │ │ └── xdoc │ │ │ └── index.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── generator │ │ │ └── xml │ │ │ └── stax │ │ │ ├── AbstractStaxGeneratorTestCase.java │ │ │ ├── BooleanTypeStaxGeneratorTest.java │ │ │ ├── FeaturesStaxDomGeneratorTest.java │ │ │ ├── FeaturesStaxGeneratorTest.java │ │ │ ├── NoAdderStaxGeneratorTest.java │ │ │ ├── StaxGeneratorPartsTest.java │ │ │ ├── StaxGeneratorTest.java │ │ │ ├── StaxGeneratorVersionInFieldTest.java │ │ │ ├── StaxGeneratorVersionInNamespaceTest.java │ │ │ ├── StaxGeneratorVersionReaderDelegateTest.java │ │ │ ├── StaxGeneratorWrongVersionInNamespaceTest.java │ │ │ └── StaxGeneratorWrongVersionTest.java │ │ ├── resources │ │ ├── boolean.mdo │ │ ├── maven.mdo │ │ ├── noAdder.mdo │ │ ├── parts.mdo │ │ ├── version-in-field.mdo │ │ └── version-in-namespace.mdo │ │ └── verifiers │ │ ├── features-dom │ │ └── StaxFeaturesVerifier.java │ │ ├── features │ │ └── StaxFeaturesVerifier.java │ │ ├── stax-parts │ │ ├── StaxVerifierParts.java │ │ └── parts.xml │ │ ├── stax-version-in-field │ │ ├── StaxVerifierVersionInField.java │ │ └── version-in-field.xml │ │ ├── stax-version-in-namespace │ │ ├── StaxVerifierVersionInNamespace.java │ │ └── version-in-namespace.xml │ │ ├── stax-version-reader-delegate │ │ ├── StaxVerifierVersionReaderDelegate.java │ │ ├── input-4.0.0.xml │ │ └── input-4.0.1.xml │ │ ├── stax-wrong-version-in-namespace │ │ ├── StaxVerifierWrongVersionNamespace.java │ │ └── wrong-version-in-namespace.xml │ │ ├── stax-wrong-version │ │ ├── StaxVerifierWrongVersion.java │ │ └── wrong-version.xml │ │ └── stax │ │ ├── StaxVerifier.java │ │ ├── expected-default-extend.xml │ │ ├── expected-encoding.xml │ │ └── expected.xml ├── modello-plugin-velocity │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── velocity │ │ │ ├── Helper.java │ │ │ └── VelocityGenerator.java │ │ └── site │ │ ├── site.xml │ │ └── xdoc │ │ └── index.xml ├── modello-plugin-xdoc │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── xdoc │ │ │ ├── XdocGenerator.java │ │ │ └── metadata │ │ │ ├── XdocAssociationMetadata.java │ │ │ ├── XdocClassMetadata.java │ │ │ ├── XdocFieldMetadata.java │ │ │ ├── XdocInterfaceMetadata.java │ │ │ ├── XdocMetadataPlugin.java │ │ │ └── XdocModelMetadata.java │ │ ├── site │ │ ├── site.xml │ │ └── xdoc │ │ │ └── index.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── xdoc │ │ │ └── XdocGeneratorTest.java │ │ └── resources │ │ ├── html4.expected.xml │ │ ├── html4.mdo │ │ ├── maven.mdo │ │ └── settings.mdo ├── modello-plugin-xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── codehaus │ │ │ │ └── modello │ │ │ │ └── plugins │ │ │ │ └── xml │ │ │ │ ├── AbstractXmlGenerator.java │ │ │ │ ├── AbstractXmlJavaGenerator.java │ │ │ │ ├── XmlModelHelpers.java │ │ │ │ └── metadata │ │ │ │ ├── XmlAssociationMetadata.java │ │ │ │ ├── XmlClassMetadata.java │ │ │ │ ├── XmlFieldMetadata.java │ │ │ │ ├── XmlInterfaceMetadata.java │ │ │ │ ├── XmlMetadataPlugin.java │ │ │ │ └── XmlModelMetadata.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── modello │ │ │ └── plugins.xml │ │ ├── site │ │ └── site.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugins │ │ │ └── xml │ │ │ ├── XmlModelHelpersTest.java │ │ │ └── XmlModelloPluginTest.java │ │ └── resources │ │ └── model.mdo ├── modello-plugin-xpp3 │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── xpp3 │ │ │ ├── AbstractXpp3Generator.java │ │ │ ├── Xpp3ExtendedReaderGenerator.java │ │ │ ├── Xpp3ExtendedWriterGenerator.java │ │ │ ├── Xpp3ReaderGenerator.java │ │ │ └── Xpp3WriterGenerator.java │ │ ├── site │ │ ├── site.xml │ │ └── xdoc │ │ │ └── index.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── generator │ │ │ └── xml │ │ │ └── xpp3 │ │ │ ├── AbstractElementTest.java │ │ │ ├── BooleanTypeXpp3GeneratorTest.java │ │ │ ├── FeaturesXpp3DomGeneratorTest.java │ │ │ ├── FeaturesXpp3GeneratorTest.java │ │ │ ├── LocationsSourceXpp3GeneratorTest.java │ │ │ ├── LocationsXpp3GeneratorTest.java │ │ │ ├── StandaloneReadXpp3GeneratorTest.java │ │ │ └── Xpp3GeneratorTest.java │ │ ├── resources │ │ ├── abstract.mdo │ │ ├── boolean.mdo │ │ ├── maven.mdo │ │ └── standaloneRead.mdo │ │ └── verifiers │ │ ├── features-dom │ │ └── Xpp3FeaturesVerifier.java │ │ ├── features │ │ └── Xpp3FeaturesVerifier.java │ │ ├── locations+src │ │ └── Xpp3LocationsSourceVerifier.java │ │ ├── locations │ │ └── Xpp3LocationsVerifier.java │ │ ├── testStandaloneRead │ │ ├── Xpp3StandaloneReadVerifier.java │ │ ├── rootClass.xml │ │ └── standaloneReadClass.xml │ │ └── xpp3 │ │ ├── Xpp3Verifier.java │ │ ├── expected-encoding.xml │ │ ├── expected.xml │ │ ├── model-with-missing-root-element.xml │ │ ├── model-with-wrong-element.xml │ │ ├── model-with-wrong-element2.xml │ │ └── model-with-wrong-root-element.xml ├── modello-plugin-xsd │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── xsd │ │ │ ├── XsdGenerator.java │ │ │ ├── XsdModelHelper.java │ │ │ └── metadata │ │ │ ├── XsdAssociationMetadata.java │ │ │ ├── XsdClassMetadata.java │ │ │ ├── XsdFieldMetadata.java │ │ │ ├── XsdInterfaceMetadata.java │ │ │ ├── XsdMetadataPlugin.java │ │ │ └── XsdModelMetadata.java │ │ ├── site │ │ └── site.xml │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ └── plugin │ │ │ └── xsd │ │ │ ├── ChangesXsdGeneratorTest.java │ │ │ ├── FeaturesXsdGeneratorTest.java │ │ │ ├── ModelloXsdGeneratorTest.java │ │ │ ├── PluginsXsdGeneratorTest.java │ │ │ └── XsdGeneratorTest.java │ │ └── resources │ │ ├── changes.mdo │ │ ├── features-invalid.xml │ │ ├── features-missing-required.xml │ │ ├── maven.mdo │ │ ├── plugin.mdo │ │ └── plugin.xml ├── pom.xml └── src │ └── site │ └── site.xml ├── modello-test ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── codehaus │ │ │ └── modello │ │ │ ├── AbstractModelloGeneratorTest.java │ │ │ ├── AbstractModelloJavaGeneratorTest.java │ │ │ ├── OrderedProperties.java │ │ │ └── verifier │ │ │ ├── Verifier.java │ │ │ └── VerifierException.java │ └── resources │ │ ├── features-Latin-15.xml │ │ ├── features-UTF-8.xml │ │ ├── features-bad-version.xml │ │ ├── features-invalid-transient.xml │ │ ├── features-wrong-attribute.xml │ │ ├── features-wrong-content.xml │ │ ├── features-wrong-element.xml │ │ ├── features-wrong-element2.xml │ │ ├── features.mdo │ │ ├── features.xml │ │ ├── locations+source.mdo │ │ ├── locations.mdo │ │ └── locations.xml │ └── site │ └── site.xml ├── pom.xml └── src ├── main └── mdo │ └── modello.mdo └── site ├── apt ├── location-tracking.apt └── release-notes.apt ├── markdown └── migration-guide.md ├── resources ├── css │ └── site.css ├── modello-deps.png └── xsd │ ├── modello-1.0.0.xsd │ ├── modello-1.1.0.xsd │ ├── modello-1.4.0.xsd │ ├── modello-1.8.0.xsd │ └── modello-2.0.0.xsd ├── site.xml └── xdoc ├── index.xml └── modello-deps.odg /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "maven" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | - package-ecosystem: "github-actions" 8 | directory: "/" 9 | schedule: 10 | interval: "daily" 11 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | _extends: .github 2 | tag-template: modello-$NEXT_MINOR_VERSION 3 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: GitHub CI 19 | 20 | on: [push, pull_request] 21 | 22 | 23 | jobs: 24 | build: 25 | name: Build it 26 | uses: codehaus-plexus/.github/.github/workflows/maven.yml@master 27 | with: 28 | maven_args: '--batch-mode --errors --show-version verify javadoc:javadoc -Prun-its' 29 | 30 | 31 | # deploy: 32 | # name: Deploy 33 | # needs: build 34 | # uses: codehaus-plexus/.github/.github/workflows/maven-deploy.yml@master 35 | # secrets: inherit 36 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | update_release_draft: 8 | uses: codehaus-plexus/.github/.github/workflows/release-drafter.yml@master 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .project 3 | .classpath 4 | .settings/ 5 | bin 6 | .idea/ 7 | *.iml 8 | .factorypath 9 | pom.xml.releaseBackup 10 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | The MIT License 3 | 4 | Copyright 2006-2012 The Codehaus. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files \(the "Software"\), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | of the Software, and to permit persons to whom the Software is furnished to do 11 | so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Modello 2 | ======= 3 | 4 | [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.modello/modello.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.modello/modello) 5 | [![MIT License](https://img.shields.io/github/license/codehaus-plexus/modello.svg?label=License)](http://www.apache.org/licenses/) 6 | ![Build Status](https://github.com/codehaus-plexus/modello/workflows/GitHub%20CI/badge.svg) 7 | [![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/codehaus/modello/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/codehaus/modello/README.md) 8 | 9 | Modello is a framework for code generation from a simple model. 10 | 11 | Modello generates code from a simple model format: based on a plugin architecture, various types of code and descriptors can be generated from the single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers, XSD and documentation. 12 | 13 | # Documentation 14 | 15 | Documentation can be found on the Modello site hosted at [Github.io](http://codehaus-plexus.github.io/modello/). 16 | 17 | This site is generated by running: 18 | 19 | ``` 20 | mvn -Prun-its,reporting clean verify site site:stage 21 | ``` 22 | 23 | # Licensing 24 | 25 | Modello is licensed under the therms of the [MIT License](http://opensource.org/licenses/mit-license.php) 26 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/ModelloException.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public class ModelloException extends Exception { 29 | private static final long serialVersionUID = -8746896773615188345L; 30 | 31 | public ModelloException(String msg) { 32 | super(msg); 33 | } 34 | 35 | public ModelloException(String msg, Throwable cause) { 36 | super(msg, cause); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/ModelloRuntimeException.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public class ModelloRuntimeException extends RuntimeException { 29 | private static final long serialVersionUID = -637783066384319780L; 30 | 31 | public ModelloRuntimeException(String msg) { 32 | super(msg); 33 | } 34 | 35 | public ModelloRuntimeException(String msg, Throwable cause) { 36 | super(msg, cause); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/core/GeneratorPluginManager.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.core; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import java.util.Iterator; 26 | import java.util.Map; 27 | 28 | import org.codehaus.modello.plugin.ModelloGenerator; 29 | 30 | /** 31 | * @author Trygve Laugstøl 32 | */ 33 | public interface GeneratorPluginManager { 34 | String ROLE = GeneratorPluginManager.class.getName(); 35 | 36 | Map getPlugins(); 37 | 38 | Iterator getPluginsIterator(); 39 | 40 | ModelloGenerator getGeneratorPlugin(String generatorId); 41 | 42 | boolean hasGeneratorPlugin(String generatorId); 43 | } 44 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/core/MetadataPluginManager.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.core; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import java.util.Iterator; 26 | import java.util.Map; 27 | 28 | import org.codehaus.modello.metadata.MetadataPlugin; 29 | 30 | /** 31 | * @author Trygve Laugstøl 32 | */ 33 | public interface MetadataPluginManager { 34 | String ROLE = MetadataPluginManager.class.getName(); 35 | 36 | Map getPlugins(); 37 | 38 | Iterator getPluginsIterator(); 39 | 40 | MetadataPlugin getMetadataPlugin(String metadataId); 41 | 42 | boolean hasMetadataPlugin(String metadataId); 43 | } 44 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/metadata/AssociationMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public interface AssociationMetadata extends Metadata {} 29 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/metadata/ClassMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public interface ClassMetadata extends Metadata {} 29 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/metadata/FieldMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public interface FieldMetadata extends Metadata {} 29 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/metadata/InterfaceMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public interface InterfaceMetadata extends Metadata {} 29 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/metadata/Metadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public interface Metadata {} 29 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/metadata/ModelMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public interface ModelMetadata extends Metadata {} 29 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/model/CodeSegment.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.model; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Jason van Zyl 27 | */ 28 | public class CodeSegment extends BaseElement { 29 | private String code; 30 | 31 | public CodeSegment() { 32 | super(false); 33 | } 34 | 35 | public String getCode() { 36 | return code; 37 | } 38 | 39 | public void setCode(String code) { 40 | this.code = code; 41 | } 42 | 43 | public void validateElement() {} 44 | } 45 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/model/ModelValidationException.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.model; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public class ModelValidationException extends Exception { 29 | private static final long serialVersionUID = -8146274663701861789L; 30 | 31 | public ModelValidationException(String msg) { 32 | super(msg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/model/VersionUtil.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.model; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Emmanuel Venisse 27 | */ 28 | public class VersionUtil { 29 | public static boolean isInConflict(VersionRange version1, VersionRange version2) { 30 | return !(version1.getToVersion().lesserThan(version2.getFromVersion()) 31 | || version2.getToVersion().lesserThan(version1.getFromVersion())); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/plugin/ModelloGenerator.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import java.util.Map; 26 | 27 | import org.codehaus.modello.ModelloException; 28 | import org.codehaus.modello.model.Model; 29 | 30 | /** 31 | * @author Trygve Laugstøl 32 | */ 33 | public interface ModelloGenerator { 34 | void generate(Model model, Map parameters) throws ModelloException; 35 | } 36 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/plugin/model/ModelAssociationMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.model; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.AssociationMetadata; 26 | 27 | /** 28 | * @author Emmanuel Venisse 29 | */ 30 | public class ModelAssociationMetadata implements AssociationMetadata { 31 | public static final String ID = ModelAssociationMetadata.class.getName(); 32 | } 33 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/plugin/model/ModelFieldMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.model; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.FieldMetadata; 26 | 27 | /** 28 | * @author Emmanuel Venisse 29 | */ 30 | public class ModelFieldMetadata implements FieldMetadata { 31 | public static final String ID = ModelFieldMetadata.class.getName(); 32 | } 33 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/plugin/model/ModelInterfaceMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.model; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.InterfaceMetadata; 26 | 27 | /** 28 | * @author Emmanuel Venisse 29 | */ 30 | public class ModelInterfaceMetadata implements InterfaceMetadata { 31 | public static final String ID = ModelInterfaceMetadata.class.getName(); 32 | } 33 | -------------------------------------------------------------------------------- /modello-core/src/main/java/org/codehaus/modello/plugin/model/ModelModelMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.model; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.ModelMetadata; 26 | 27 | /** 28 | * @author Emmanuel Venisse 29 | */ 30 | public class ModelModelMetadata implements ModelMetadata { 31 | public static final String ID = ModelModelMetadata.class.getName(); 32 | } 33 | -------------------------------------------------------------------------------- /modello-core/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /modello-core/src/test/java/org/codehaus/modello/model/VersionDefinitionTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.model; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertFalse; 6 | import static org.junit.jupiter.api.Assertions.assertTrue; 7 | 8 | class VersionDefinitionTest { 9 | 10 | @Test 11 | void fieldType() { 12 | VersionDefinition def = new VersionDefinition(); 13 | def.setType("field"); 14 | assertTrue(def.isFieldType()); 15 | assertFalse(def.isNamespaceType()); 16 | } 17 | 18 | @Test 19 | void namespaceType() { 20 | VersionDefinition def = new VersionDefinition(); 21 | def.setType("namespace"); 22 | assertTrue(def.isNamespaceType()); 23 | assertFalse(def.isFieldType()); 24 | } 25 | 26 | @Test 27 | void fieldAndNamespaceType() { 28 | VersionDefinition def = new VersionDefinition(); 29 | def.setType("field+namespace"); 30 | assertTrue(def.isFieldType()); 31 | assertTrue(def.isNamespaceType()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /modello-core/src/test/resources/models/association.mdo: -------------------------------------------------------------------------------- 1 | 2 | association-test 3 | AssociationTest 4 | 5 | 6 | package 7 | org.codehaus.modello.association 8 | 9 | 10 | 11 | 12 | Boy 13 | 1.0.0 14 | 15 | 16 | name 17 | 1.0.0 18 | String 19 | 20 | 21 | girlfriends 22 | 1.0.0 23 | 24 | Girl 25 | * 26 | 27 | 28 | 29 | 30 | 31 | Girl 32 | 1.0.0 33 | 34 | 35 | name 36 | 1.0.0 37 | String 38 | 39 | 40 | boyfriend 41 | 1.0.0 42 | 43 | Girl 44 | 45 | 46 | 47 | 48 | 49 | Foo 50 | 1.0.0 51 | 52 | 53 | bars 54 | 1.0.0 55 | 56 | Bar 57 | * 58 | 59 | 60 | 61 | 62 | 63 | Bar 64 | 1.0.0 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /modello-core/src/test/resources/models/duplicate-associations.mdo: -------------------------------------------------------------------------------- 1 | 2 | duplicate-associations 3 | Duplicate Associations Test Model 4 | 5 | 6 | MyClass 7 | 8 | 9 | MyAssociation 10 | 11 | String 12 | 13 | 14 | 15 | MyAssociation 16 | 17 | String 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /modello-core/src/test/resources/models/duplicate-classes.mdo: -------------------------------------------------------------------------------- 1 | 2 | duplicate-classes 3 | Duplicate Classes Test Model 4 | 5 | 6 | MyClass 7 | 8 | 9 | MyClass 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /modello-core/src/test/resources/models/duplicate-fields.mdo: -------------------------------------------------------------------------------- 1 | 2 | duplicate-fields 3 | Duplicate Fields Test Model 4 | 5 | 6 | MyClass 7 | 8 | 9 | MyField 10 | 11 | 12 | MyField 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /modello-core/src/test/resources/models/simple.mdo: -------------------------------------------------------------------------------- 1 | 2 | simple 3 | Simple Modello Test Model 4 | 5 | 6 | package 7 | foo.bar 8 | 9 | 10 | 11 | field 12 | foo 13 | 14 | 15 | 16 | Boy 17 | 1.0.0 18 | 19 | java.lang.Serializable 20 | 21 | 22 | 23 | name 24 | moniker 25 | 1.0.0 26 | String 27 | true 28 | 29 | 30 | girlfriends 31 | 1.0.0 32 | 33 | Girl 34 | * 35 | 36 | 37 | 38 | 39 | 40 | Girl 41 | 1.0.0 42 | 43 | 44 | age 45 | 1.0.0+ 46 | int 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/dom4j-no-plexus-utils/verify.bsh: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | File readerClass = new File( basedir, "target/classes/test/io/dom4j/ThingDom4jReader.class" ); 4 | if ( !readerClass.isFile() ) 5 | { 6 | throw new FileNotFoundException( "Missing " + readerClass ); 7 | } 8 | 9 | File writerClass = new File( basedir, "target/classes/test/io/dom4j/ThingDom4jWriter.class" ); 10 | if ( !writerClass.isFile() ) 11 | { 12 | throw new FileNotFoundException( "Missing " + writerClass ); 13 | } 14 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/features/invoker.properties: -------------------------------------------------------------------------------- 1 | invoker.goals = compile site -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/features/src/main/java/org/codehaus/modello/OrderedProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004, Codehaus.org 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do 9 | * so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.codehaus.modello; 24 | 25 | import java.util.Properties; 26 | import java.util.Set; 27 | import java.util.TreeSet; 28 | 29 | /** 30 | * A Properties class with predictable order: it is sorted by key value. This class is not really fully consistent, 31 | * but sufficiently for Modello unit-tests when reading/writing XML samples. 32 | * 33 | * @author Hervé Boutemy 34 | */ 35 | public class OrderedProperties 36 | extends Properties 37 | { 38 | private static final long serialVersionUID = 4578458610736378768L; 39 | 40 | public Set keySet() 41 | { 42 | return new TreeSet( super.keySet() ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/features/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | Modello 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/jdom-no-plexus-utils/verify.bsh: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | File writerClass = new File( basedir, "target/classes/test/io/jdom/ThingJDOMWriter.class" ); 4 | if ( !writerClass.isFile() ) 5 | { 6 | throw new FileNotFoundException( "Missing " + writerClass ); 7 | } 8 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/maven-model/src/test/models/model-with-missing-elements.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | one 4 | two 5 | 1.0 6 | 7 | 8 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/maven-model/src/test/models/model-with-post-tags.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/maven-model/src/test/models/model-with-wrong-root-tag.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | one 4 | two 5 | 1.0 6 | 7 | 8 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/maven-model/verify.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | File generatedSources = new File(basedir, "target/generated-sources/modello") 21 | File generatedSite = new File(basedir, "target/generated-site/resources/xsd") 22 | assert generatedSources.exists() 23 | assert generatedSources.isDirectory() 24 | assert generatedSite.exists() 25 | assert generatedSite.isDirectory() 26 | 27 | String javaSource = new File(generatedSources, "org/apache/maven/model/Model.java").text 28 | String xsdSource = new File(generatedSite, "maven-4.0.0.xsd").text 29 | 30 | // due formatting issues (empty lines lost) let's stick with trivial license and assertion for now 31 | assert javaSource.contains("The license of this file") 32 | assert xsdSource.contains("The license of this file") 33 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | 25 | it-repo 26 | 27 | true 28 | 29 | 30 | 31 | local.central 32 | @localRepositoryUrl@ 33 | 34 | true 35 | 36 | 37 | true 38 | 39 | 40 | 41 | 42 | 43 | local.central 44 | @localRepositoryUrl@ 45 | 46 | true 47 | 48 | 49 | true 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/snakeyaml/src/main/mdo/model.mdo: -------------------------------------------------------------------------------- 1 | 11 | 12 | 15 | model 16 | Model 17 | 18 | 19 | package 20 | org.plexus.modello.demo.model 21 | 22 | 23 | 24 | 25 | 26 | Root 27 | 1.0.0+ 28 | 29 | 30 | simpleField 31 | String 32 | 1.0.0+ 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/snakeyaml/src/test/java/org/plexus/modello/demo/model/RootTest.java: -------------------------------------------------------------------------------- 1 | package org.plexus.modello.demo.model; 2 | 3 | import org.plexus.modello.demo.model.io.snakeyaml.*; 4 | 5 | import java.io.*; 6 | 7 | public class RootTest { 8 | private static Root createRoot(String fieldValue) { 9 | Root r = new Root(); 10 | r.setSimpleField(fieldValue); 11 | return r; 12 | } 13 | 14 | private static String asYamlString(Root root) throws IOException { 15 | ModelSnakeYamlWriter writer = new ModelSnakeYamlWriter(); 16 | 17 | try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); 18 | OutputStreamWriter osw = new OutputStreamWriter(baos)) { 19 | writer.write(osw, root); 20 | return baos.toString(); 21 | } 22 | } 23 | 24 | public void testWritingYaml() throws IOException { 25 | Root root = createRoot("modello IT"); 26 | 27 | String rootAsYaml = asYamlString(root); 28 | 29 | String expected = "%YAML 1.1" + "\n" // directive used to identify the version of YAML 30 | + "---" + "\n" // document separator 31 | + "\"simpleField\": \"modello IT\"" + "\n"; // actual Root 32 | assert expected.equals(rootAsYaml): "Actual: [" + rootAsYaml + "]"; 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/it/stax-no-plexus-utils/verify.bsh: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | File readerClass = new File( basedir, "target/classes/test/io/stax/ThingStaxReader.class" ); 4 | if ( !readerClass.isFile() ) 5 | { 6 | throw new FileNotFoundException( "Missing " + readerClass ); 7 | } 8 | 9 | File writerClass = new File( basedir, "target/classes/test/io/stax/ThingStaxWriter.class" ); 10 | if ( !writerClass.isFile() ) 11 | { 12 | throw new FileNotFoundException( "Missing " + writerClass ); 13 | } 14 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloConvertersMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | import org.apache.maven.plugins.annotations.LifecyclePhase; 4 | import org.apache.maven.plugins.annotations.Mojo; 5 | 6 | /** 7 | * Creates classes that can convert between different versions of the model. 8 | * 9 | * @author Brett Porter 10 | */ 11 | @Mojo(name = "converters", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 12 | public class ModelloConvertersMojo extends AbstractModelloSourceGeneratorMojo { 13 | protected String getGeneratorType() { 14 | return "converters"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloDom4jReaderMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | import org.apache.maven.plugins.annotations.LifecyclePhase; 4 | import org.apache.maven.plugins.annotations.Mojo; 5 | 6 | /** 7 | * Creates a DOM4J reader from the model. 8 | */ 9 | @Mojo(name = "dom4j-reader", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 10 | public class ModelloDom4jReaderMojo extends AbstractModelloSourceGeneratorMojo { 11 | protected String getGeneratorType() { 12 | return "dom4j-reader"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloDom4jWriterMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | import org.apache.maven.plugins.annotations.LifecyclePhase; 4 | import org.apache.maven.plugins.annotations.Mojo; 5 | 6 | /** 7 | * Creates a DOM4J writer from the model. 8 | */ 9 | @Mojo(name = "dom4j-writer", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 10 | public class ModelloDom4jWriterMojo extends AbstractModelloSourceGeneratorMojo { 11 | protected String getGeneratorType() { 12 | return "dom4j-writer"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloJDOMWriterMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.apache.maven.plugins.annotations.LifecyclePhase; 26 | import org.apache.maven.plugins.annotations.Mojo; 27 | 28 | /** 29 | * Creates a jdom writer from the model that is capable of preserving element ordering 30 | * and comments. In future it should also preserve whitespace. 31 | * 32 | * @author Milos Kleint 33 | */ 34 | @Mojo(name = "jdom-writer", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 35 | public class ModelloJDOMWriterMojo extends AbstractModelloSourceGeneratorMojo { 36 | protected String getGeneratorType() { 37 | return "jdom-writer"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloJavaMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.apache.maven.plugins.annotations.LifecyclePhase; 26 | import org.apache.maven.plugins.annotations.Mojo; 27 | 28 | /** 29 | * Creates Java beans from the Modello model. 30 | * 31 | * @author Trygve Laugstøl 32 | */ 33 | @Mojo(name = "java", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 34 | public class ModelloJavaMojo extends AbstractModelloSourceGeneratorMojo { 35 | protected String getGeneratorType() { 36 | return "java"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloSaxWriterMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | /* 4 | * Copyright (c) 2013, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.apache.maven.plugins.annotations.LifecyclePhase; 26 | import org.apache.maven.plugins.annotations.Mojo; 27 | 28 | /** 29 | * Creates a SAX writer from the model. 30 | * 31 | * @since 1.8 32 | * @author Simone Tripodi 33 | */ 34 | @Mojo(name = "sax-writer", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 35 | public class ModelloSaxWriterMojo extends AbstractModelloSourceGeneratorMojo { 36 | protected String getGeneratorType() { 37 | return "sax-writer"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloSnakeYamlReaderMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | /* 4 | * Copyright (c) 2004-2012, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.apache.maven.plugins.annotations.LifecyclePhase; 26 | import org.apache.maven.plugins.annotations.Mojo; 27 | 28 | /** 29 | * Creates an SnakeYaml reader from the model. 30 | * 31 | * @since 1.8 32 | * @author Simone Tripodi 33 | */ 34 | @Mojo(name = "snakeyaml-reader", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 35 | public class ModelloSnakeYamlReaderMojo extends AbstractModelloSourceGeneratorMojo { 36 | protected String getGeneratorType() { 37 | return "snakeyaml-reader"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloSnakeYamlWriterMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.apache.maven.plugins.annotations.LifecyclePhase; 26 | import org.apache.maven.plugins.annotations.Mojo; 27 | 28 | /** 29 | * Creates an SnakeYaml writer from the model. 30 | * 31 | * @since 1.8 32 | * @author Simone Tripodi 33 | */ 34 | @Mojo(name = "snakeyaml-writer", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 35 | public class ModelloSnakeYamlWriterMojo extends AbstractModelloSourceGeneratorMojo { 36 | protected String getGeneratorType() { 37 | return "snakeyaml-writer"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloStaxReaderMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | import org.apache.maven.plugins.annotations.LifecyclePhase; 4 | import org.apache.maven.plugins.annotations.Mojo; 5 | 6 | /** 7 | * Creates an StAX reader from the model. 8 | * 9 | * @author Brett Porter 10 | */ 11 | @Mojo(name = "stax-reader", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 12 | public class ModelloStaxReaderMojo extends AbstractModelloSourceGeneratorMojo { 13 | protected String getGeneratorType() { 14 | return "stax-reader"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloStaxWriterMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | import org.apache.maven.plugins.annotations.LifecyclePhase; 4 | import org.apache.maven.plugins.annotations.Mojo; 5 | 6 | /** 7 | * Creates an StAX writer from the model. 8 | * 9 | * @author Brett Porter 10 | */ 11 | @Mojo(name = "stax-writer", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 12 | public class ModelloStaxWriterMojo extends AbstractModelloSourceGeneratorMojo { 13 | protected String getGeneratorType() { 14 | return "stax-writer"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXpp3ReaderMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.apache.maven.plugins.annotations.LifecyclePhase; 26 | import org.apache.maven.plugins.annotations.Mojo; 27 | 28 | /** 29 | * Creates an XPP3 reader from the model. 30 | * 31 | * @author Brett Porter 32 | */ 33 | @Mojo(name = "xpp3-reader", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 34 | public class ModelloXpp3ReaderMojo extends AbstractModelloSourceGeneratorMojo { 35 | protected String getGeneratorType() { 36 | return "xpp3-reader"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/main/java/org/codehaus/modello/maven/ModelloXpp3WriterMojo.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.maven; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.apache.maven.plugins.annotations.LifecyclePhase; 26 | import org.apache.maven.plugins.annotations.Mojo; 27 | 28 | /** 29 | * Creates an XPP3 writer from the model. 30 | * 31 | * @author Brett Porter 32 | */ 33 | @Mojo(name = "xpp3-writer", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) 34 | public class ModelloXpp3WriterMojo extends AbstractModelloSourceGeneratorMojo { 35 | protected String getGeneratorType() { 36 | return "xpp3-writer"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/site/fml/faq.fml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Where can I find documentation about Modello? 9 | 10 |

Modello model descriptor is described and documented with Modello.

11 |
12 |
13 | 14 | 15 | Is Modello really used anywhere? 16 | 17 |

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

25 |

26 |
27 |
28 | 29 |
30 | 31 |
32 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/test/resources/java-model.mdo: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | maven-java-mojo-test-model 6 | Modello Java Mojo Test Model 7 | Model 8 | 9 | 10 | package 11 | org.codehaus.mojo.modello.javatest 12 | 13 | 14 | 15 | 16 | Model 17 | 0.9.0+ 18 | 19 | 20 | extend 21 | 1.0.0+ 22 | String 23 | 24 | 25 | 26 | 27 | NewModel 28 | 1.0.0+ 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modello-maven-plugin/src/test/verifier/site-verifications.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | target/it/features/target/site/index.html 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-converters/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-converters 11 | Modello Model Version Converter Plugin 12 | Modello Model Version Converter Plugin generates code to transform a model between two versions. 13 | 14 | 15 | 16 | org.codehaus.modello 17 | modello-plugin-java 18 | 19 | 20 | org.codehaus.modello 21 | modello-plugin-stax 22 | test 23 | 24 | 25 | org.codehaus.plexus 26 | plexus-utils 27 | 28 | 29 | org.codehaus.woodstox 30 | stax2-api 31 | 4.2.2 32 | test 33 | 34 | 35 | com.fasterxml.woodstox 36 | woodstox-core 37 | 7.1.1 38 | test 39 | 40 | 41 | 42 | 43 | 44 | 45 | maven-dependency-plugin 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-converters/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-dom4j/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-dom4j 11 | Modello Dom4J Plugin 12 | Modello Dom4J Plugin generates XML readers and writers based on Dom4J API. 13 | 14 | 15 | 16 | org.codehaus.modello 17 | modello-plugin-java 18 | 19 | 20 | org.codehaus.modello 21 | modello-plugin-xml 22 | 23 | 24 | org.codehaus.plexus 25 | plexus-utils 26 | 27 | 28 | org.dom4j 29 | dom4j 30 | 2.1.4 31 | test 32 | 33 | 34 | 35 | 36 | org.xmlunit 37 | xmlunit-core 38 | test 39 | 40 | 41 | 42 | 43 | 44 | 45 | maven-dependency-plugin 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-dom4j/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-dom4j/src/test/verifiers/dom4j/expected-encoding.xml: -------------------------------------------------------------------------------- 1 | 2 | Maven#&x00A9; 3 | 4 | component1 5 | 6 | 7 | component2 8 | 9 | sub 10 | 11 | 12 | 13 | 14 | foo 15 | 16 | 17 | 18 | 19 | Mailing list 20 | Super Subscribe 21 | Duper Unsubscribe 22 | ?ber Archive 23 | 24 | 25 | 26 | connection 27 | developerConnection 28 | url 29 | 30 | 31 | src/main/java 32 | src/test/java 33 | 34 | 35 | excludeEclipsePlugin 36 | foo 37 | 38 | de/abstrakt/tools/codegeneration/eclipse/*.java 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jackson/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-jackson 11 | Modello Jackson Plugin 12 | Modello Jackson Plugin generates JSON readers and writers based on Jackson Streaming APIs, plus reader delegates to be able to read 13 | multiple model versions. 14 | 15 | 16 | 17 | 18 | 19 | org.codehaus.modello 20 | modello-plugin-java 21 | 22 | 23 | org.codehaus.modello 24 | modello-plugin-xml 25 | 26 | 27 | org.codehaus.plexus 28 | plexus-utils 29 | 30 | 31 | com.fasterxml.jackson.core 32 | jackson-core 33 | 34 | 35 | com.fasterxml.jackson.core 36 | jackson-databind 37 | 38 | 39 | com.fasterxml.jackson.core 40 | jackson-annotations 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.apache.maven.plugins 48 | maven-dependency-plugin 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/AbstractJacksonGenerator.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.jackson; 2 | 3 | /* 4 | * Copyright (c) 2004-2013, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.plugins.xml.AbstractXmlJavaGenerator; 26 | 27 | /** 28 | * @author Simone Tripodi 29 | */ 30 | public abstract class AbstractJacksonGenerator extends AbstractXmlJavaGenerator {} 31 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jackson/src/main/java/org/codehaus/modello/plugin/jackson/JacksonExtendedReaderGenerator.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.jackson; 2 | 3 | /* 4 | * Copyright (c) 2004-2013, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.model.ModelClass; 26 | 27 | /** 28 | * The generator for Jackson-based parsers that support input location tracking. 29 | * 30 | * @author Simone Tripodi 31 | */ 32 | public class JacksonExtendedReaderGenerator extends JacksonReaderGenerator { 33 | 34 | @Override 35 | protected boolean isRelevant(ModelClass modelClass) { 36 | return isJavaEnabled(modelClass); 37 | } 38 | 39 | @Override 40 | protected boolean isLocationTracking() { 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jackson/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jackson/src/test/verifiers/jackson/expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "extender" : "/foo/bar", 3 | "modelVersion" : "4.0.0", 4 | "name" : "Maven", 5 | "components" : [ { 6 | "name" : "component1" 7 | }, { 8 | "comment" : "comment2", 9 | "name" : "component2", 10 | "components" : [ { 11 | "comment" : "subcomment", 12 | "name" : "sub" 13 | } ] 14 | }, { 15 | "name" : "component3", 16 | "custom" : { 17 | "foo" : "bar", 18 | "bar" : { 19 | "att1" : "value", 20 | "content" : "baz" 21 | }, 22 | "el1" : { 23 | "el2" : "te&xt" 24 | }, 25 | "excludes" : [ "*.vlt", "*.xml" ] 26 | } 27 | }, { 28 | "name" : "component4", 29 | "properties" : [ { 30 | "key" : "key", 31 | "value" : "theValue" 32 | } ], 33 | "flatProperties" : { 34 | "name" : "value" 35 | } 36 | } ], 37 | "repositories" : [ { 38 | "id" : "foo" 39 | }, { 40 | "id" : "bar" 41 | } ], 42 | "mailingLists" : [ { 43 | "name" : "Mailing list", 44 | "subscribe" : "Super Subscribe", 45 | "unsubscribe" : "Duper Unsubscribe", 46 | "archive" : "?ber Archive" 47 | } ], 48 | "scm" : { 49 | "connection" : "connection", 50 | "developerConnection" : "developerConnection", 51 | "url" : "url" 52 | }, 53 | "builder" : { 54 | "sourceDirectory" : "src/main/java", 55 | "unitTestSourceDirectory" : "src/test/java", 56 | "sourceModifications" : [ { 57 | "className" : "excludeEclipsePlugin", 58 | "directory" : "foo", 59 | "excludes" : [ "de/abstrakt/tools/codegeneration/eclipse/*.java" ] 60 | } ], 61 | "unitTest" : { } 62 | }, 63 | "content" : { 64 | "attr" : "attribute", 65 | "content": "content value" 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-java 11 | Modello Java Plugin 12 | Modello Java Plugin generates Java POJOs for the model. 13 | 14 | 15 | 16 | org.codehaus.plexus 17 | plexus-utils 18 | 19 | 20 | org.codehaus.plexus 21 | plexus-build-api 22 | 23 | 24 | 25 | javax.persistence 26 | persistence-api 27 | 1.0.2 28 | test 29 | 30 | 31 | javax.xml.bind 32 | jaxb-api 33 | 2.3.1 34 | test 35 | 36 | 37 | 38 | 39 | 40 | 41 | maven-dependency-plugin 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/javasource/JAnnotations.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.java.javasource; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Iterator; 5 | import java.util.List; 6 | 7 | public class JAnnotations { 8 | private List annotations; 9 | 10 | public JAnnotations() { 11 | this.annotations = new ArrayList(); 12 | } 13 | 14 | public void appendAnnotation(String annotation) { 15 | annotations.add(annotation); 16 | } 17 | 18 | /** 19 | * Returns the String representation of this JAnnotations 20 | * @return the String representation of this JAnnotations 21 | **/ 22 | public String toString() { 23 | StringBuilder sb = new StringBuilder(); 24 | for (Iterator iterator = annotations.iterator(); iterator.hasNext(); ) { 25 | sb.append(iterator.next()); 26 | if (iterator.hasNext()) { 27 | sb.append(' '); 28 | } 29 | } 30 | return sb.toString(); 31 | } // -- toString 32 | 33 | /** 34 | * prints this Annotations using the given JSourceWriter 35 | * 36 | * @param jsw the JSourceWriter to print to 37 | */ 38 | public void print(JSourceWriter jsw) { 39 | for (String annotation : annotations) { 40 | jsw.writeln(annotation.toString()); 41 | } 42 | } // -- print 43 | } 44 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/javasource/JArrayType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006 Werner Guttmann 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | package org.codehaus.modello.plugin.java.javasource; 17 | 18 | /** 19 | * JType sub-class for Arrays. 20 | * 21 | * @author Werner Guttman 22 | * @version $Revision$ $Date$ 23 | * @since 1.0.4 24 | */ 25 | public final class JArrayType extends JComponentizedType { 26 | // -------------------------------------------------------------------------- 27 | 28 | /** 29 | * Creates an instance of a array type, of type 'name'. 30 | * 31 | * @param componentType Component type. 32 | */ 33 | public JArrayType(final JType componentType) { 34 | super(componentType.getName(), componentType); 35 | } 36 | 37 | // -------------------------------------------------------------------------- 38 | 39 | /** 40 | * Returns the String representation of this JType, which is simply the name of this type. 41 | * 42 | * @return The String representation of this JType. 43 | */ 44 | public String toString() { 45 | return getComponentType().toString() + "[]"; 46 | } 47 | 48 | // -------------------------------------------------------------------------- 49 | } 50 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/metadata/JavaInterfaceMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.java.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.InterfaceMetadata; 26 | 27 | /** 28 | * @author Emmanuel Venisse 29 | */ 30 | public class JavaInterfaceMetadata implements InterfaceMetadata { 31 | public static final String ID = JavaInterfaceMetadata.class.getName(); 32 | } 33 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/main/java/org/codehaus/modello/plugin/java/metadata/JavaModelMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.java.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.ModelMetadata; 26 | 27 | /** 28 | * @author Emmanuel Venisse 29 | */ 30 | public class JavaModelMetadata implements ModelMetadata { 31 | public static final String ID = JavaModelMetadata.class.getName(); 32 | 33 | private boolean suppressAllWarnings = true; 34 | 35 | public void setSuppressAllWarnings(boolean suppressAllWarnings) { 36 | this.suppressAllWarnings = suppressAllWarnings; 37 | } 38 | 39 | public boolean isSuppressAllWarnings() { 40 | return suppressAllWarnings; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/java/org/codehaus/modello/plugin/java/AbstractPrincipal.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.java; 2 | 3 | /** 4 | * Test Abstract Class to ensure that externally referenced classes can be used in the <superClass> element. 5 | * 6 | * @author Joakim Erdfelt 7 | */ 8 | public abstract class AbstractPrincipal { 9 | private int principal; 10 | 11 | public int getPrincipal() { 12 | return principal; 13 | } 14 | 15 | public void setPrincipal(int principal) { 16 | this.principal = principal; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/java/org/codehaus/modello/plugin/java/BiDirectionalOverrideJavaGeneratorTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.java; 2 | 3 | /* 4 | * Copyright 2001-2006 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import java.util.Map; 20 | 21 | import org.codehaus.modello.AbstractModelloJavaGeneratorTest; 22 | import org.codehaus.modello.core.ModelloCore; 23 | import org.codehaus.modello.model.Model; 24 | 25 | /** 26 | * BiDirectionalOverrideJavaGeneratorTest 27 | * 28 | * @author Joakim Erdfelt 29 | */ 30 | public class BiDirectionalOverrideJavaGeneratorTest extends AbstractModelloJavaGeneratorTest { 31 | public BiDirectionalOverrideJavaGeneratorTest() { 32 | super("bidirectional"); 33 | } 34 | 35 | public void testJavaGenerator() throws Throwable { 36 | ModelloCore modello = (ModelloCore) lookup(ModelloCore.ROLE); 37 | 38 | Model model = modello.loadModel(getXmlResourceReader("/models/bidirectional-override.mdo")); 39 | 40 | Map parameters = getModelloParameters("1.0.0"); 41 | 42 | modello.generate(model, "java", parameters); 43 | 44 | compileGeneratedSources(); 45 | 46 | verifyCompiledGeneratedSources("JavaVerifier"); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/java/org/codehaus/modello/plugin/java/InterfaceAssociationTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.java; 2 | 3 | import java.util.Map; 4 | 5 | import org.codehaus.modello.AbstractModelloJavaGeneratorTest; 6 | import org.codehaus.modello.core.ModelloCore; 7 | import org.codehaus.modello.model.Model; 8 | 9 | public class InterfaceAssociationTest extends AbstractModelloJavaGeneratorTest { 10 | public InterfaceAssociationTest() { 11 | super("interfaceAssociationTest"); 12 | } 13 | 14 | public void testJavaGenerator() throws Throwable { 15 | ModelloCore modello = (ModelloCore) lookup(ModelloCore.ROLE); 16 | 17 | Model model = modello.loadModel(getXmlResourceReader("/models/interfaceAssociation.mdo")); 18 | 19 | Map parameters = getModelloParameters("4.0.0", 8); 20 | 21 | modello.generate(model, "java", parameters); 22 | 23 | compileGeneratedSources(8); 24 | 25 | verifyCompiledGeneratedSources("InterfaceAssociationVerifier"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/java/org/codehaus/modello/plugin/java/Permission.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.java; 2 | 3 | /* 4 | * Copyright 2001-2006 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * Test Interface used by to ensure that interface overrides can be used. 21 | * 22 | * @author Joakim Erdfelt 23 | */ 24 | public interface Permission { 25 | String getName(); 26 | 27 | void setName(String name); 28 | } 29 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/java/org/codehaus/modello/plugin/java/Role.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.java; 2 | 3 | /* 4 | * Copyright 2001-2006 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import java.util.List; 20 | 21 | /** 22 | * Test Interface used by to ensure that interface overrides can be used. 23 | * 24 | * @author Joakim Erdfelt 25 | */ 26 | public interface Role { 27 | String getName(); 28 | 29 | void setName(String name); 30 | 31 | void setRoles(List roles); 32 | 33 | List getRoles(); 34 | 35 | void addRole(Role role); 36 | 37 | void removeRole(Role role); 38 | 39 | void setPermission(Permission permission); 40 | 41 | Permission getPermission(); 42 | } 43 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/java/org/codehaus/modello/plugin/java/javasource/JMapTypeTestCase.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.java.javasource; 2 | 3 | import junit.framework.TestCase; 4 | 5 | /** 6 | * @author Simone Tripodi 7 | * @since 1.8 8 | */ 9 | public final class JMapTypeTestCase extends TestCase { 10 | 11 | public void testJavaPropertiesType() { 12 | JMapType mapType = new JMapType("java.util.Properties", new JClass("String")); 13 | 14 | assertEquals("java.util.Properties", mapType.toString()); 15 | } 16 | 17 | public void testJavaMapType() { 18 | JMapType mapType = new JMapType("java.util.Map", new JClass("String")); 19 | 20 | assertEquals("java.util.Map", mapType.toString()); 21 | } 22 | 23 | public void testJavaMapInitialization() { 24 | JMapType mapType = new JMapType("java.util.Map", "new java.util.HashMap()", new JClass("String")); 25 | 26 | assertEquals("new java.util.HashMap()", mapType.getInstanceName()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/resources/models/interfaceAssociation.mdo: -------------------------------------------------------------------------------- 1 | 2 | interface-association-test 3 | InterfaceAssociationTest 4 | 5 | 6 | 7 | package 8 | org.codehaus.modello.ifaceassociation.package1 9 | 10 | 11 | 12 | 13 | 14 | Location 15 | 16 | 17 | persons 18 | 19 | Person 20 | * 21 | 22 | 23 | 24 | relatives 25 | Set 26 | 27 | Person 28 | * 29 | 30 | 31 | 32 | mother 33 | 34 | Person 35 | 36 | 37 | 38 | 39 | 40 | 41 | Person 42 | 43 | IPerson 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/resources/models/tmp.mdo: -------------------------------------------------------------------------------- 1 | 2 | tmp 3 | Modello Test Model with tmp 4 | 5 | 6 | package 7 | foo.bar 8 | 9 | 10 | 11 | 12 | MyClass 13 | 1.0.0 14 | 15 | 16 | id 17 | 1.0.0 18 | true 19 | String 20 | true 21 | 22 | 23 | tmp 24 | 1.0.0 25 | double 26 | true 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/resources/models/tostring.mdo: -------------------------------------------------------------------------------- 1 | 2 | tostring 3 | Modello Test Model with toString() method 4 | 5 | 6 | package 7 | foo.bar.tostring 8 | 9 | 10 | 11 | 12 | MyClass 13 | 1.0.0 14 | 15 | 16 | id 17 | 1.0.0 18 | true 19 | String 20 | true 21 | 22 | 23 | tmp 24 | 1.0.0 25 | double 26 | true 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/verifiers/bidirectional/JavaVerifier.java: -------------------------------------------------------------------------------- 1 | import org.codehaus.modello.plugin.java.Role; 2 | import org.codehaus.modello.tests.bidiroverride.BiRole; 3 | import org.codehaus.modello.verifier.Verifier; 4 | 5 | import junit.framework.Assert; 6 | 7 | import java.util.List; 8 | 9 | public class JavaVerifier 10 | extends Verifier 11 | { 12 | public void verify() 13 | { 14 | Role parent = new BiRole(); 15 | parent.setName( "parent" ); 16 | 17 | Role child = new BiRole(); 18 | child.setName( "child" ); 19 | 20 | parent.addRole( child ); 21 | Assert.assertEquals( 1, parent.getRoles().size() ); 22 | 23 | List roles = parent.getRoles(); 24 | Assert.assertTrue( "Collection element should be of type BiRole.", (roles.get(0) instanceof BiRole) ); 25 | 26 | parent.removeRole( child ); 27 | Assert.assertEquals( 0, parent.getRoles().size() ); 28 | 29 | BiRole birole = (BiRole) parent; 30 | 31 | birole.setPrincipal( 22 ); 32 | Assert.assertEquals( 22, birole.getPrincipal() ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/verifiers/features-version/JavaVerifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004, Codehaus.org 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do 9 | * so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | import org.codehaus.modello.verifier.Verifier; 24 | import org.codehaus.modello.verifier.VerifierException; 25 | 26 | import junit.framework.Assert; 27 | 28 | /** 29 | * @author Herve Boutemy 30 | */ 31 | public class JavaVerifier 32 | extends Verifier 33 | { 34 | public void verify() 35 | { 36 | Object v1_0_0 = new org.codehaus.modello.test.features.v1_0_0.Features(); 37 | Object v1_5_0 = new org.codehaus.modello.test.features.v1_5_0.Features(); 38 | Object v2_0_0 = new org.codehaus.modello.test.features.v2_0_0.Features(); 39 | Object v3_0_0 = new org.codehaus.modello.test.features.v3_0_0.Features(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/verifiers/interfaceAssociationTest/InterfaceAssociationVerifier.java: -------------------------------------------------------------------------------- 1 | import junit.framework.Assert; 2 | 3 | import org.codehaus.modello.ifaceassociation.package1.IPerson; 4 | import org.codehaus.modello.ifaceassociation.package1.Person; 5 | import org.codehaus.modello.ifaceassociation.package1.Location; 6 | import org.codehaus.modello.verifier.Verifier; 7 | 8 | import java.lang.reflect.Field; 9 | import java.util.ArrayList; 10 | import java.util.HashSet; 11 | import java.util.List; 12 | import java.util.Set; 13 | 14 | import junit.framework.Assert; 15 | 16 | public class InterfaceAssociationVerifier 17 | extends Verifier 18 | { 19 | public void verify() 20 | throws Exception 21 | { 22 | Location location = new Location(); 23 | 24 | IPerson person = new Person(); 25 | 26 | // check List persons attribute getters/setters 27 | location.addPerson( person ); 28 | 29 | List persons = location.getPersons(); 30 | 31 | location.setPersons( new ArrayList( persons ) ); 32 | 33 | location.removePerson( person ); 34 | 35 | // check Set relatives attribute getters/setters 36 | location.addRelative( person ); 37 | 38 | Set relatives = location.getRelatives(); 39 | 40 | location.setRelatives( new HashSet( relatives ) ); 41 | 42 | location.removeRelative( person ); 43 | 44 | IPerson mother = new Person(); 45 | 46 | location.setMother( mother ); 47 | 48 | Assert.assertNotNull( location.getMother() ); 49 | 50 | location.setMother( null ); 51 | 52 | Assert.assertNull( location.getMother() ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-java/src/test/verifiers/interfaceAssociationTest/org/codehaus/modello/ifaceassociation/package1/IPerson.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.ifaceassociation.package1; 2 | 3 | public interface IPerson 4 | { 5 | 6 | } -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jdom/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-jdom 11 | Modello JDOM Plugin 12 | Modello JDOM Plugin generates XML writers based on JDOM API. 13 | 14 | 15 | 16 | org.codehaus.modello 17 | modello-plugin-java 18 | 19 | 20 | org.codehaus.plexus 21 | plexus-utils 22 | 23 | 24 | org.codehaus.modello 25 | modello-plugin-xml 26 | 27 | 28 | 29 | org.codehaus.modello 30 | modello-plugin-stax 31 | test 32 | 33 | 34 | org.jdom 35 | jdom 36 | ${jdom.version} 37 | test 38 | 39 | 40 | 41 | 42 | org.xmlunit 43 | xmlunit-core 44 | test 45 | 46 | 47 | 48 | 49 | 50 | 51 | maven-dependency-plugin 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jdom/src/main/java/org/codehaus/modello/plugin/jdom/AbstractJDOMGenerator.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.jdom; 2 | 3 | /* 4 | * Copyright (c) 2004, Jason van Zyl 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.plugins.xml.AbstractXmlJavaGenerator; 26 | 27 | /** 28 | * @author Trygve Laugstøl 29 | */ 30 | public abstract class AbstractJDOMGenerator extends AbstractXmlJavaGenerator {} 31 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jdom/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jdom/src/site/xdoc/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Modello JDOM Plugin 7 | Hervé Boutemy 8 | 9 | 10 | 11 | 12 |
13 | 14 |

Modello JDOM Plugin generates XML writers based on JDOM 1 API. 15 | It attempts to preserve formatting of not changed elements and even with the changed ones it does 16 | some tricks to keep the formatting in line with the rest.

17 | 18 |

Notice: DOM content type is represented as 19 | plexus-utils' Xpp3Dom objects

20 | 21 | 22 |

jdom-writer generator creates 23 | my.model.package.io.jdom.ModelNameJDOMWriter class with following 24 | public methods: 25 |

26 | 27 |
    28 |
  • public void write( RootClass root, Document document, OutputStream stream )
    29 |     throws IOException
  • 30 | 31 |
  • public void write( RootClass root, Document document, OutputStreamWriter writer )
    32 |     throws IOException
  • 33 | 34 |
  • public void write( RootClass root, Document document, Writer writer, Format jdomFormat )
    35 |     throws IOException
  • 36 |
37 |
38 | 39 |
40 | 41 | 42 | 43 |
44 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jsonschema/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-jsonschema 11 | Modello JSON-Schema Plugin 12 | Modello JSON-Schema Plugin generates a JSON-Schema from the model to be able to validate JSON content. 13 | 14 | 15 | 16 | org.codehaus.modello 17 | modello-plugin-java 18 | 19 | 20 | org.codehaus.modello 21 | modello-plugin-xml 22 | 23 | 24 | com.fasterxml.jackson.core 25 | jackson-core 26 | 27 | 28 | 29 | 30 | xml-apis 31 | xml-apis 32 | 2.0.2 33 | test 34 | 35 | 36 | xerces 37 | xercesImpl 38 | 2.12.2 39 | test 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-jsonschema/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-sax/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-sax 11 | Modello SAX Plugin 12 | Modello SAX Plugin generates XML readers and writers based on SAX API. 13 | 14 | 15 | 16 | org.codehaus.modello 17 | modello-plugin-xml 18 | 19 | 20 | org.codehaus.plexus 21 | plexus-utils 22 | 23 | 24 | org.codehaus.modello 25 | modello-plugin-java 26 | 27 | 28 | 29 | org.xmlunit 30 | xmlunit-core 31 | test 32 | 33 | 34 | 35 | 36 | 37 | 38 | maven-dependency-plugin 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-sax/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-sax/src/site/xdoc/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Modello SAX Plugin 7 | Simone Tripodi 8 | 9 | 10 | 11 | 12 |
13 | 14 |

Modello SAX Plugin generates SAX writers based on 15 | SAX APIs, 16 | plus reader delegates to be able to read multiple model versions.

17 | 18 | 19 |

sax-writer generator creates 20 | my.model.package.io.sax.ModelNameSAXWriter class with following 21 | public methods: 22 |

23 | 24 |
    25 |
  • public void write( OutputStream output, RootClass root )
    26 |     throws SAXException, TransformerException
  • 27 |
  • public void write( Writer writer, RootClass root )
    28 |     throws SAXException, TransformerException, UnsupportedEncodingException
  • 29 |
  • public void write( org.xml.sax.ContentHandler, RootClass root )
    30 |     throws SAXException
    (this method will take care to open/close the XML document)
  • 31 |
  • public void write( org.xml.sax.ContentHandler, RootClass root, boolean startDocument )
    32 |     throws SAXException
    (this method will take care to open/close the XML document depending on the startDocument flag)
  • 33 |
34 |
35 | 36 |
37 | 38 | 39 | 40 |
41 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-snakeyaml/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-snakeyaml 11 | Modello SnakeYaml Plugin 12 | Modello SnakeYaml Plugin generates YAML readers and writers based on SnakeYaml Streaming APIs, plus reader delegates to be able to read 13 | multiple model versions. 14 | 15 | 16 | 17 | org.codehaus.modello 18 | modello-plugin-java 19 | 20 | 21 | org.codehaus.modello 22 | modello-plugin-xml 23 | 24 | 25 | org.yaml 26 | snakeyaml 27 | 2.4 28 | 29 | 30 | 31 | 32 | 33 | 34 | maven-dependency-plugin 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/AbstractSnakeYamlGenerator.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.snakeyaml; 2 | 3 | /* 4 | * Copyright (c) 2004-2013, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.plugins.xml.AbstractXmlJavaGenerator; 26 | 27 | /** 28 | * @author Simone Tripodi 29 | */ 30 | public abstract class AbstractSnakeYamlGenerator extends AbstractXmlJavaGenerator {} 31 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-snakeyaml/src/main/java/org/codehaus/modello/plugin/snakeyaml/SnakeYamlExtendedReaderGenerator.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.snakeyaml; 2 | 3 | /* 4 | * Copyright (c) 2004-2013, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import javax.inject.Named; 26 | 27 | import org.codehaus.modello.model.ModelClass; 28 | 29 | /** 30 | * The generator for Jackson-based parsers that support input location tracking. 31 | * 32 | * @author Simone Tripodi 33 | */ 34 | @Named("snakeyaml-extended-reader") 35 | public class SnakeYamlExtendedReaderGenerator extends SnakeYamlReaderGenerator { 36 | 37 | @Override 38 | protected boolean isRelevant(ModelClass modelClass) { 39 | return isJavaEnabled(modelClass); 40 | } 41 | 42 | @Override 43 | protected boolean isLocationTracking() { 44 | return true; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-snakeyaml/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/main/java/org/codehaus/modello/plugin/stax/DummyIdModelField.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.stax; 2 | 3 | /* 4 | * Copyright (c) 2006, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.model.ModelField; 26 | 27 | public class DummyIdModelField extends ModelField { 28 | public String getName() { 29 | return "modello.refid"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/java/org/codehaus/modello/generator/xml/stax/BooleanTypeStaxGeneratorTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.generator.xml.stax; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | import java.util.Map; 23 | 24 | import org.codehaus.modello.AbstractModelloJavaGeneratorTest; 25 | import org.codehaus.modello.core.ModelloCore; 26 | import org.codehaus.modello.model.Model; 27 | 28 | public class BooleanTypeStaxGeneratorTest extends AbstractModelloJavaGeneratorTest { 29 | public BooleanTypeStaxGeneratorTest() { 30 | super("testBooleanType"); 31 | } 32 | 33 | public void testBooleanType() throws Throwable { 34 | ModelloCore modello = (ModelloCore) lookup(ModelloCore.ROLE); 35 | 36 | Model model = modello.loadModel(getXmlResourceReader("/boolean.mdo")); 37 | 38 | Map parameters = getModelloParameters("1.0.0", 8); 39 | 40 | modello.generate(model, "java", parameters); 41 | modello.generate(model, "stax-reader", parameters); 42 | modello.generate(model, "stax-writer", parameters); 43 | 44 | compileGeneratedSources(8); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/java/org/codehaus/modello/generator/xml/stax/NoAdderStaxGeneratorTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.generator.xml.stax; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | import java.util.Map; 23 | 24 | import org.codehaus.modello.AbstractModelloJavaGeneratorTest; 25 | import org.codehaus.modello.core.ModelloCore; 26 | import org.codehaus.modello.model.Model; 27 | 28 | public class NoAdderStaxGeneratorTest extends AbstractModelloJavaGeneratorTest { 29 | public NoAdderStaxGeneratorTest() { 30 | super("testNoAdder"); 31 | } 32 | 33 | public void testNoAdder() throws Throwable { 34 | ModelloCore modello = (ModelloCore) lookup(ModelloCore.ROLE); 35 | 36 | Model model = modello.loadModel(getXmlResourceReader("/noAdder.mdo")); 37 | 38 | Map parameters = getModelloParameters("1.0.0"); 39 | 40 | modello.generate(model, "java", parameters); 41 | modello.generate(model, "stax-reader", parameters); 42 | modello.generate(model, "stax-writer", parameters); 43 | 44 | compileGeneratedSources(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/java/org/codehaus/modello/generator/xml/stax/StaxGeneratorVersionInFieldTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.generator.xml.stax; 2 | 3 | import java.util.List; 4 | 5 | import org.codehaus.modello.model.Model; 6 | import org.codehaus.modello.model.ModelClass; 7 | import org.codehaus.modello.model.Version; 8 | import org.codehaus.plexus.component.repository.exception.ComponentLookupException; 9 | 10 | /** 11 | * @author Trygve Laugstøl 12 | * @author Emmanuel Venisse 13 | */ 14 | public class StaxGeneratorVersionInFieldTest extends AbstractStaxGeneratorTestCase { 15 | public StaxGeneratorVersionInFieldTest() throws ComponentLookupException { 16 | super("stax-version-in-field"); 17 | } 18 | 19 | public void testStaxReaderVersionInField() throws Throwable { 20 | Model model = modello.loadModel(getXmlResourceReader("/version-in-field.mdo")); 21 | 22 | List classesList = model.getClasses(new Version("4.0.0")); 23 | 24 | assertEquals(1, classesList.size()); 25 | 26 | ModelClass clazz = (ModelClass) classesList.get(0); 27 | 28 | assertEquals("Model", clazz.getName()); 29 | 30 | verifyModel(model, "org.codehaus.modello.generator.xml.stax.StaxVerifierVersionInField"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/java/org/codehaus/modello/generator/xml/stax/StaxGeneratorVersionInNamespaceTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.generator.xml.stax; 2 | 3 | import java.util.List; 4 | 5 | import org.codehaus.modello.model.Model; 6 | import org.codehaus.modello.model.ModelClass; 7 | import org.codehaus.modello.model.Version; 8 | import org.codehaus.plexus.component.repository.exception.ComponentLookupException; 9 | 10 | /** 11 | * @author Trygve Laugstøl 12 | * @author Emmanuel Venisse 13 | */ 14 | public class StaxGeneratorVersionInNamespaceTest extends AbstractStaxGeneratorTestCase { 15 | public StaxGeneratorVersionInNamespaceTest() throws ComponentLookupException { 16 | super("stax-version-in-namespace"); 17 | } 18 | 19 | public void testStaxReaderVersionInField() throws Throwable { 20 | Model model = modello.loadModel(getXmlResourceReader("/version-in-namespace.mdo")); 21 | 22 | List classesList = model.getClasses(new Version("4.0.0")); 23 | 24 | assertEquals(1, classesList.size()); 25 | 26 | ModelClass clazz = (ModelClass) classesList.get(0); 27 | 28 | assertEquals("Model", clazz.getName()); 29 | 30 | verifyModel(model, "org.codehaus.modello.generator.xml.stax.StaxVerifierVersionInNamespace"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/java/org/codehaus/modello/generator/xml/stax/StaxGeneratorWrongVersionInNamespaceTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.generator.xml.stax; 2 | 3 | import java.util.List; 4 | 5 | import org.codehaus.modello.model.Model; 6 | import org.codehaus.modello.model.ModelClass; 7 | import org.codehaus.modello.model.Version; 8 | import org.codehaus.plexus.component.repository.exception.ComponentLookupException; 9 | 10 | /** 11 | * @author Trygve Laugstøl 12 | * @author Emmanuel Venisse 13 | */ 14 | public class StaxGeneratorWrongVersionInNamespaceTest extends AbstractStaxGeneratorTestCase { 15 | public StaxGeneratorWrongVersionInNamespaceTest() throws ComponentLookupException { 16 | super("stax-wrong-version-in-namespace"); 17 | } 18 | 19 | public void testStaxReaderVersionInField() throws Throwable { 20 | Model model = modello.loadModel(getXmlResourceReader("/version-in-namespace.mdo")); 21 | 22 | List classesList = model.getClasses(new Version("4.0.0")); 23 | 24 | assertEquals(1, classesList.size()); 25 | 26 | ModelClass clazz = (ModelClass) classesList.get(0); 27 | 28 | assertEquals("Model", clazz.getName()); 29 | 30 | verifyModel(model, "org.codehaus.modello.generator.xml.stax.StaxVerifierWrongVersionNamespace"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/java/org/codehaus/modello/generator/xml/stax/StaxGeneratorWrongVersionTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.generator.xml.stax; 2 | 3 | import java.util.List; 4 | 5 | import org.codehaus.modello.model.Model; 6 | import org.codehaus.modello.model.ModelClass; 7 | import org.codehaus.modello.model.Version; 8 | import org.codehaus.plexus.component.repository.exception.ComponentLookupException; 9 | 10 | /** 11 | * @author Trygve Laugstøl 12 | * @author Emmanuel Venisse 13 | */ 14 | public class StaxGeneratorWrongVersionTest extends AbstractStaxGeneratorTestCase { 15 | public StaxGeneratorWrongVersionTest() throws ComponentLookupException { 16 | super("stax-wrong-version"); 17 | } 18 | 19 | public void testStaxReaderVersionInField() throws Throwable { 20 | Model model = modello.loadModel(getXmlResourceReader("/version-in-field.mdo")); 21 | 22 | List classesList = model.getClasses(new Version("4.0.0")); 23 | 24 | assertEquals(1, classesList.size()); 25 | 26 | ModelClass clazz = (ModelClass) classesList.get(0); 27 | 28 | assertEquals("Model", clazz.getName()); 29 | 30 | verifyModel(model, "org.codehaus.modello.generator.xml.stax.StaxVerifierWrongVersion"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/resources/boolean.mdo: -------------------------------------------------------------------------------- 1 | 2 | 6 | test 7 | Test 8 | 9 | 10 | package 11 | org.codehaus.modello.generator.xml.stax.test.testboolean 12 | 13 | 14 | 15 | 16 | BooleanTest 17 | 1.0.0+ 18 | 19 | 20 | property 21 | 1.0.0+ 22 | Boolean 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/resources/noAdder.mdo: -------------------------------------------------------------------------------- 1 | 2 | 6 | test 7 | Test 8 | 9 | 10 | package 11 | org.codehaus.modello.generator.xml.stax.test.noadder 12 | 13 | 14 | 15 | 16 | MyType 17 | 1.0.0+ 18 | 19 | 20 | test 21 | 1.0.0+ 22 | String 23 | 24 | 25 | 26 | 27 | NoAdderTest 28 | 1.0.0+ 29 | 30 | 31 | property 32 | 1.0.0+ 33 | 34 | MyType 35 | * 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/resources/version-in-field.mdo: -------------------------------------------------------------------------------- 1 | 2 | maven 3 | VersionInField 4 | 5 | 6 | package 7 | org.codehaus.modello.test.model.vif 8 | 9 | 10 | 11 | field 12 | modelVersion 13 | 14 | 15 | 16 | Model 17 | 3.0.0+ 18 | 19 | 20 | modelVersion 21 | 4.0.0 22 | true 23 | The version of this model you are using. 24 | String 25 | 26 | 27 | name 28 | 3.0.0+ 29 | true 30 | Human readable name of the project. 31 | String 32 | 33 | 34 | description 35 | 3.0.0+ 36 | true 37 | Human readable description of the project. 38 | String 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/resources/version-in-namespace.mdo: -------------------------------------------------------------------------------- 1 | 2 | maven 3 | VersionInNamespace 4 | 5 | 6 | package 7 | org.codehaus.modello.test.model.vin 8 | 9 | 10 | 11 | namespace 12 | 13 | 14 | 15 | Model 16 | 3.0.0+ 17 | 18 | 19 | name 20 | 3.0.0+ 21 | true 22 | Human readable name of the project. 23 | String 24 | 25 | 26 | description 27 | 3.0.0+ 28 | true 29 | Human readable description of the project. 30 | String 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/verifiers/stax-version-in-field/version-in-field.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Something out of place. 4 | 4.0.0 5 | Maven 6 | 7 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/verifiers/stax-version-in-namespace/version-in-namespace.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | Something out of place. 5 | Maven 6 | 7 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/verifiers/stax-version-reader-delegate/input-4.0.0.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 26 | Something out of place. 27 | Maven 28 | 29 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/verifiers/stax-version-reader-delegate/input-4.0.1.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 26 | Something out of place. 27 | Maven 28 | 29 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/verifiers/stax-wrong-version-in-namespace/wrong-version-in-namespace.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | Something out of place. 5 | Maven 6 | 7 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/verifiers/stax-wrong-version/wrong-version.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Something out of place. 4 | 1.2.3 5 | Maven 6 | 7 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/verifiers/stax/expected-default-extend.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-stax/src/test/verifiers/stax/expected-encoding.xml: -------------------------------------------------------------------------------- 1 | 2 | Maven#&x00A9; 3 | 4 | component1 5 | 6 | 7 | component2 8 | 9 | sub 10 | 11 | 12 | 13 | component3 14 | 15 | bar 16 | baz 17 | 18 | text 19 | 20 | 21 | 22 | 23 | component4 24 | 25 | 26 | key 27 | theValue 28 | 29 | 30 | 31 | value 32 | 33 | 34 | 35 | 36 | foo 37 | 38 | 39 | 40 | 41 | Mailing list 42 | Super Subscribe 43 | Duper Unsubscribe 44 | ?ber Archive 45 | 46 | 47 | 48 | connection 49 | developerConnection 50 | url 51 | 52 | 53 | src/main/java 54 | src/test/java 55 | 56 | 57 | excludeEclipsePlugin 58 | foo 59 | 60 | de/abstrakt/tools/codegeneration/eclipse/*.java 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-velocity/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-velocity 11 | Modello Velocity Plugin 12 | Modello Velocity Plugin generates files from the Modello model using Velocity templates. 13 | 14 | 15 | 16 | org.codehaus.modello 17 | modello-plugin-xml 18 | 19 | 20 | org.codehaus.plexus 21 | plexus-utils 22 | 23 | 24 | org.apache.velocity 25 | velocity-engine-core 26 | 2.4.1 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-velocity/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-xdoc 11 | Modello XDOC Plugin 12 | Modello XDOC Plugin generates model documentation using xdoc markup to be included in a Maven-generated reporting 13 | site. 14 | 15 | 16 | 17 | org.codehaus.modello 18 | modello-plugin-xml 19 | 20 | 21 | org.codehaus.modello 22 | modello-plugin-xsd 23 | 24 | 25 | org.codehaus.plexus 26 | plexus-utils 27 | 28 | 29 | org.jsoup 30 | jsoup 31 | 1.20.1 32 | 33 | 34 | com.github.chhorz 35 | javadoc-parser 36 | 0.3.1 37 | 38 | 39 | org.xmlunit 40 | xmlunit-core 41 | test 42 | 43 | 44 | 45 | 46 | 47 | 48 | maven-dependency-plugin 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/src/main/java/org/codehaus/modello/plugin/xdoc/metadata/XdocAssociationMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xdoc.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.AssociationMetadata; 26 | 27 | /** 28 | * @author Hervé Boutemy 29 | */ 30 | public class XdocAssociationMetadata implements AssociationMetadata { 31 | public static final String ID = XdocAssociationMetadata.class.getName(); 32 | } 33 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/src/main/java/org/codehaus/modello/plugin/xdoc/metadata/XdocClassMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xdoc.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.ClassMetadata; 26 | 27 | /** 28 | * @author Hervé Boutemy 29 | */ 30 | public class XdocClassMetadata implements ClassMetadata { 31 | public static final String ID = XdocClassMetadata.class.getName(); 32 | 33 | private String anchorName; 34 | 35 | public String getAnchorName() { 36 | return anchorName; 37 | } 38 | 39 | public void setAnchorName(String anchorName) { 40 | this.anchorName = anchorName; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/src/main/java/org/codehaus/modello/plugin/xdoc/metadata/XdocFieldMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xdoc.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.FieldMetadata; 26 | 27 | /** 28 | * @author Hervé Boutemy 29 | */ 30 | public class XdocFieldMetadata implements FieldMetadata { 31 | public static final String ID = XdocFieldMetadata.class.getName(); 32 | 33 | public static final String NONE = "none"; 34 | 35 | public static final String BLANK = "blank"; 36 | 37 | private String separator; 38 | 39 | public String getSeparator() { 40 | return separator; 41 | } 42 | 43 | public void setSeparator(String separator) { 44 | this.separator = separator; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/src/main/java/org/codehaus/modello/plugin/xdoc/metadata/XdocInterfaceMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xdoc.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.InterfaceMetadata; 26 | 27 | /** 28 | * @author Hervé Boutemy 29 | */ 30 | public class XdocInterfaceMetadata implements InterfaceMetadata { 31 | public static final String ID = XdocInterfaceMetadata.class.getName(); 32 | } 33 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/src/main/java/org/codehaus/modello/plugin/xdoc/metadata/XdocModelMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xdoc.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.ModelMetadata; 26 | 27 | /** 28 | * @author Hervé Boutemy 29 | */ 30 | public class XdocModelMetadata implements ModelMetadata { 31 | public static final String ID = XdocModelMetadata.class.getName(); 32 | } 33 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/src/site/xdoc/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Modello XDOC Plugin 7 | Hervé Boutemy 8 | 9 | 10 | 11 | 12 |
13 | 14 |

Modello XDOC Plugin generates model documentation using xdoc markup to be included in a Maven-generated 15 | reporting site.

16 | 17 | 18 |

xdoc generator creates model-id.xdoc documentation containing an XML 19 | representation of the model, followed by a table with explanation for every model class. 20 |

21 |

22 | An example is available to see the resulting document. 23 |

24 |
25 | 26 |
27 | 28 | 29 | 30 |
31 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/src/test/resources/html4.expected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Modello Java Mojo Test Model 9 | 10 | 11 |
12 |

No description.

13 | 14 | <model> 15 | <extend/> 16 | </model> 17 | 18 | 19 | 20 |

Whether this proxy configuration is the active one. Note: While the type of this field is String for technical reasons, the semantic type is actually boolean. 21 |
22 | This is a description in HTML4 23 |
24 | NOTE: HTML linebreak should be converted to selfclosing XML-tag 25 |
26 |

Since: Maven 3

27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 41 | 42 | 43 | 44 |
ElementTypeSinceDescription
36 | extend 37 | 39 | String 40 | 1.0.0No description.
45 |
46 |
47 | 48 |
49 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xdoc/src/test/resources/html4.mdo: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | html4 6 | Modello Java Mojo Test Model 7 | Model 8 | 9 | 10 | package 11 | org.codehaus.mojo.modello.javatest 12 | 13 | 14 | 15 | 16 | This is a comment 17 | 18 | 21 | This is a description in HTML4
22 | NOTE: HTML linebreak should be converted to selfclosing XML-tag
23 | @since Maven 3 24 | ]]> 25 |
26 | Model 27 | 0.9.0+ 28 | 29 | 30 | extend 31 | 1.0.0+ 32 | String 33 | 34 | 35 |
36 | 37 | NewModel 38 | 1.0.0+ 39 | 40 |
41 |
42 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xml/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-xml 11 | Modello XML Plugin 12 | Modello XML Plugin contains shared code for every plugins working on XML representation of the model. 13 | 14 | 15 | 16 | org.codehaus.modello 17 | modello-plugin-java 18 | true 19 | 20 | 21 | 22 | org.codehaus.plexus 23 | plexus-utils 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xml/src/main/java/org/codehaus/modello/plugins/xml/metadata/XmlInterfaceMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugins.xml.metadata; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import org.codehaus.modello.metadata.InterfaceMetadata; 26 | 27 | /** 28 | * @author
Trygve Laugstøl 29 | */ 30 | public class XmlInterfaceMetadata implements InterfaceMetadata { 31 | public static final String ID = XmlInterfaceMetadata.class.getName(); 32 | } 33 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xml/src/main/resources/META-INF/modello/plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | xml 5 | org.codehaus.modello.plugins.xml.metadata.XmlMetaDataPlugin 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xml/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-xpp3 11 | Modello XPP3 Plugin 12 | Modello XPP3 Plugin generates XML readers and writers based on XPP3 API (XML Pull Parser). 13 | 14 | 15 | 16 | org.codehaus.modello 17 | modello-plugin-java 18 | 19 | 20 | org.codehaus.plexus 21 | plexus-utils 22 | 23 | 24 | org.codehaus.modello 25 | modello-plugin-xml 26 | 27 | 28 | 29 | 30 | org.xmlunit 31 | xmlunit-core 32 | test 33 | 34 | 35 | 36 | 37 | 38 | 39 | maven-dependency-plugin 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/main/java/org/codehaus/modello/plugin/xpp3/Xpp3ExtendedReaderGenerator.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xpp3; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | import javax.inject.Named; 26 | 27 | import org.codehaus.modello.model.ModelClass; 28 | 29 | /** 30 | * The generator for XPP3-based parsers that support input location tracking. 31 | * 32 | * @author Benjamin Bentmann 33 | */ 34 | @Named("xpp3-extended-reader") 35 | public class Xpp3ExtendedReaderGenerator extends Xpp3ReaderGenerator { 36 | 37 | @Override 38 | protected boolean isRelevant(ModelClass modelClass) { 39 | return isJavaEnabled(modelClass); 40 | } 41 | 42 | @Override 43 | protected boolean isLocationTracking() { 44 | return true; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/test/java/org/codehaus/modello/generator/xml/xpp3/BooleanTypeXpp3GeneratorTest.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.generator.xml.xpp3; 2 | 3 | /* 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | import java.util.Map; 23 | 24 | import org.codehaus.modello.AbstractModelloJavaGeneratorTest; 25 | import org.codehaus.modello.core.ModelloCore; 26 | import org.codehaus.modello.model.Model; 27 | 28 | public class BooleanTypeXpp3GeneratorTest extends AbstractModelloJavaGeneratorTest { 29 | public BooleanTypeXpp3GeneratorTest() { 30 | super("testBooleanType"); 31 | } 32 | 33 | public void testBooleanType() throws Throwable { 34 | ModelloCore modello = (ModelloCore) lookup(ModelloCore.ROLE); 35 | 36 | Model model = modello.loadModel(getXmlResourceReader("/boolean.mdo")); 37 | 38 | Map parameters = getModelloParameters("1.0.0", 8); // autoboxing 39 | 40 | modello.generate(model, "java", parameters); 41 | modello.generate(model, "xpp3-reader", parameters); 42 | 43 | compileGeneratedSources(8); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/test/resources/abstract.mdo: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | abstract 5 | Abstract 6 | 7 | 8 | 9 | package 10 | org.codehaus.modello.generator.xml.xpp3.test.abstracto 11 | 12 | 13 | 14 | 15 | 16 | Root 17 | 1.0.0+ 18 | Node 19 | 20 | 21 | leaves 22 | 1.0.0+ 23 | 24 | Leaf 25 | * 26 | 27 | 28 | 29 | 30 | 31 | 32 | Node 33 | 1.0.0+ 34 | 35 | 36 | id 37 | String 38 | 1.0.0+ 39 | true 40 | 41 | 42 | 43 | 44 | 45 | Leaf 46 | Node 47 | 1.0.0+ 48 | 49 | 50 | id 51 | String 52 | 1.0.0+ 53 | true 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/test/resources/boolean.mdo: -------------------------------------------------------------------------------- 1 | 2 | 6 | test 7 | Test 8 | 9 | 10 | package 11 | org.codehaus.modello.generator.xml.xpp3.test.testboolean 12 | 13 | 14 | 15 | 16 | BooleanTest 17 | 1.0.0+ 18 | 19 | 20 | property 21 | 1.0.0+ 22 | Boolean 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/test/resources/standaloneRead.mdo: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | StandaloneRead 5 | StandaloneRead 6 | 7 | 8 | 9 | package 10 | org.codehaus.modello.generator.xml.xpp3.test.standaloneread 11 | 12 | 13 | 14 | 15 | 16 | RootClass 17 | 1.0.0+ 18 | 19 | 20 | leaves 21 | 1.0.0+ 22 | 23 | StandaloneReadClass 24 | * 25 | 26 | 27 | 28 | 29 | 30 | 31 | FooClass 32 | 1.0.0+ 33 | 34 | 35 | id 36 | String 37 | 1.0.0+ 38 | true 39 | 40 | 41 | 42 | 43 | 44 | StandaloneReadClass 45 | 1.0.0+ 46 | 47 | 48 | id 49 | String 50 | 1.0.0+ 51 | true 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/test/verifiers/testStandaloneRead/rootClass.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | a 5 | 6 | 7 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/test/verifiers/testStandaloneRead/standaloneReadClass.xml: -------------------------------------------------------------------------------- 1 | 2 | a 3 | 4 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/test/verifiers/xpp3/expected-encoding.xml: -------------------------------------------------------------------------------- 1 | 2 | Maven#&x00A9; 3 | 4 | component1 5 | 6 | 7 | component2 8 | 9 | sub 10 | 11 | 12 | 13 | component3 14 | 15 | bar 16 | baz 17 | 18 | text 19 | 20 | 21 | 22 | 23 | component4 24 | 25 | 26 | key 27 | theValue 28 | 29 | 30 | 31 | value 32 | 33 | 34 | 35 | 36 | foo 37 | 38 | 39 | 40 | 41 | Mailing list 42 | Super Subscribe 43 | Duper Unsubscribe 44 | ?ber Archive 45 | 46 | 47 | 48 | connection 49 | developerConnection 50 | url 51 | 52 | 53 | src/main/java 54 | src/test/java 55 | 56 | 57 | excludeEclipsePlugin 58 | foo 59 | 60 | de/abstrakt/tools/codegeneration/eclipse/*.java 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xpp3/src/test/verifiers/xpp3/model-with-missing-root-element.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mailing list 5 | Super Subscribe 6 | Duper Unsubscribe 7 | ?ber Archive 8 | 9 | 10 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xsd/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.codehaus.modello 7 | modello-plugins 8 | 2.5.2-SNAPSHOT 9 | 10 | modello-plugin-xsd 11 | Modello XSD Plugin 12 | Modello XSD Plugin generates an XML Schema from the model to be able to validate XML content. 13 | 14 | 15 | 16 | org.codehaus.modello 17 | modello-plugin-xml 18 | 19 | 20 | org.codehaus.plexus 21 | plexus-utils 22 | 23 | 24 | 25 | 26 | xml-apis 27 | xml-apis 28 | 2.0.2 29 | test 30 | 31 | 32 | xerces 33 | xercesImpl 34 | 2.12.2 35 | test 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xsd/src/main/java/org/codehaus/modello/plugin/xsd/metadata/XsdAssociationMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xsd.metadata; 2 | 3 | /* 4 | * Copyright 2001-2007 The Codehaus. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import org.codehaus.modello.metadata.AssociationMetadata; 20 | 21 | /** 22 | * XsdAssociationMetadata 23 | * 24 | * @author Joakim Erdfelt 25 | */ 26 | public class XsdAssociationMetadata implements AssociationMetadata { 27 | public static final String ID = XsdAssociationMetadata.class.getName(); 28 | } 29 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xsd/src/main/java/org/codehaus/modello/plugin/xsd/metadata/XsdClassMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xsd.metadata; 2 | 3 | /* 4 | * Copyright 2001-2007 The Codehaus. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import org.codehaus.modello.metadata.ClassMetadata; 20 | 21 | /** 22 | * XsdClassMetadata 23 | * 24 | * @author Joakim Erdfelt 25 | */ 26 | public class XsdClassMetadata implements ClassMetadata { 27 | public static final String ID = XsdClassMetadata.class.getName(); 28 | 29 | public static final String COMPOSITOR_ALL = "all"; 30 | 31 | public static final String COMPOSITOR_SEQUENCE = "sequence"; 32 | 33 | private String compositor = COMPOSITOR_ALL; 34 | 35 | public String getCompositor() { 36 | return compositor; 37 | } 38 | 39 | public void setCompositor(String compositor) { 40 | if (COMPOSITOR_ALL.equals(compositor) || COMPOSITOR_SEQUENCE.equals(compositor)) { 41 | this.compositor = compositor; 42 | } else { 43 | // default 44 | this.compositor = COMPOSITOR_ALL; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xsd/src/main/java/org/codehaus/modello/plugin/xsd/metadata/XsdFieldMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xsd.metadata; 2 | 3 | /* 4 | * Copyright 2001-2007 The Codehaus. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import org.codehaus.modello.metadata.FieldMetadata; 20 | 21 | /** 22 | * XsdFieldMetadata 23 | * 24 | * @author Joakim Erdfelt 25 | */ 26 | public class XsdFieldMetadata implements FieldMetadata { 27 | public static final String ID = XsdFieldMetadata.class.getName(); 28 | } 29 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xsd/src/main/java/org/codehaus/modello/plugin/xsd/metadata/XsdInterfaceMetadata.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.plugin.xsd.metadata; 2 | 3 | /* 4 | * Copyright 2001-2007 The Codehaus. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import org.codehaus.modello.metadata.InterfaceMetadata; 20 | 21 | /** 22 | * XsdFieldMetadata 23 | * 24 | * @author Joakim Erdfelt 25 | */ 26 | public class XsdInterfaceMetadata implements InterfaceMetadata { 27 | public static final String ID = XsdInterfaceMetadata.class.getName(); 28 | } 29 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xsd/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xsd/src/test/resources/features-invalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /modello-plugins/modello-plugin-xsd/src/test/resources/features-missing-required.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /modello-plugins/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /modello-test/src/main/java/org/codehaus/modello/OrderedProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004, Codehaus.org 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in 6 | * the Software without restriction, including without limitation the rights to 7 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | * of the Software, and to permit persons to whom the Software is furnished to do 9 | * so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | * SOFTWARE. 21 | */ 22 | 23 | package org.codehaus.modello; 24 | 25 | import java.util.Properties; 26 | import java.util.Set; 27 | import java.util.TreeSet; 28 | 29 | /** 30 | * A Properties class with predictable order: it is sorted by key value. This class is not really fully consistent, 31 | * but sufficiently for Modello unit-tests when reading/writing XML samples. 32 | * 33 | * @author Hervé Boutemy 34 | */ 35 | public class OrderedProperties extends Properties { 36 | private static final long serialVersionUID = 4578458610736378768L; 37 | 38 | public Set keySet() { 39 | return new TreeSet(super.keySet()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /modello-test/src/main/java/org/codehaus/modello/verifier/VerifierException.java: -------------------------------------------------------------------------------- 1 | package org.codehaus.modello.verifier; 2 | 3 | /* 4 | * Copyright (c) 2004, Codehaus.org 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is furnished to do 11 | * so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * @author Trygve Laugstøl 27 | */ 28 | public class VerifierException extends RuntimeException { 29 | private static final long serialVersionUID = 104760798383307575L; 30 | 31 | public VerifierException(String msg) { 32 | super(msg); 33 | } 34 | 35 | public VerifierException(String msg, Exception ex) { 36 | super(msg, ex); 37 | } 38 | 39 | public VerifierException(String msg, Throwable throwable) { 40 | super(msg, throwable); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /modello-test/src/main/resources/features-Latin-15.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehaus-plexus/modello/0e03e4f1424b45cb9f75e970522f18e67d52c85c/modello-test/src/main/resources/features-Latin-15.xml -------------------------------------------------------------------------------- /modello-test/src/main/resources/features-UTF-8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 1.0.0 6 | encoding check: euro €, OE/oe Œ/œ, S/s hácek Š/š, Z/z hácek Ž/ž, Y diaeresis: Ÿ 7 | -------------------------------------------------------------------------------- /modello-test/src/main/resources/features-bad-version.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 2.0.0 6 | -------------------------------------------------------------------------------- /modello-test/src/main/resources/features-invalid-transient.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | FAILED 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /modello-test/src/main/resources/features-wrong-attribute.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 1.0.0 6 | 7 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /modello-test/src/main/resources/features-wrong-content.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 1.0.0 6 | 7 | 8 | If strict, parsing should fail, no content allowed here. 9 | 10 | If strict, parsing should fail, no content allowed here. 11 | 12 | -------------------------------------------------------------------------------- /modello-test/src/main/resources/features-wrong-element.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 1.0.0 6 | 7 | 8 | If strict, parsing should fail. 9 | -------------------------------------------------------------------------------- /modello-test/src/main/resources/features-wrong-element2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 1.0.0 6 | 7 | 8 | 9 | good 10 | 11 | 16 | foo 17 | If strict, parsing should fail. 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /modello-test/src/main/resources/locations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | test 5 | 6 | a 7 | b 8 | c 9 | 10 | a 11 | b 12 | c 13 | 14 | 15 | a 16 | b 17 | c 18 | 19 | 20 | 21 | a 22 | b 23 | c 24 | 25 | 26 | 27 | test 28 | test 29 | 30 | 31 | 32 | 33 | a 34 | test 35 | 36 | 37 | 38 | test 39 | b 40 | 41 | 42 | 43 | 44 | 45 | test 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /modello-test/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/site/markdown/migration-guide.md: -------------------------------------------------------------------------------- 1 | Migration Guide 2 | =============== 3 | 4 | Migration from 1.11 to 2.0 5 | -------------------------- 6 | 7 | * `useJava5(boolean)` has been replaced with `javaSource(int)` 8 | * Associate attributes `java.generate-create` and `java.generate-break` have been replaced with attribute `java.bidi` 9 | * Associate attribute `java.use-interface` has been renamed to `java.useInterface` 10 | * Class attribute `xml.namespace` has been moved to model 11 | * Class attribute `xml.schemaLocation` has been moved to model 12 | * Field attribute `java.adder` has been moved to association 13 | * Field attribute `xml.associationTagName` has been moved to `xml.tagName` in association 14 | * Field attribute `xml.listStyle` has been moved to `xml.itemsStyle` in association 15 | * Field type `Content` has been replaced with field attribute `xml.content="true"` + type `String` 16 | * Model attribute `xsd.target-namespace` has been renamed to `xsd.targetNamespace` 17 | 18 | -------------------------------------------------------------------------------- /src/site/resources/css/site.css: -------------------------------------------------------------------------------- 1 | table.bodyTable tr.a:hover, table.bodyTable tr.b:hover { 2 | background: #dfe3db; 3 | } 4 | -------------------------------------------------------------------------------- /src/site/resources/modello-deps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehaus-plexus/modello/0e03e4f1424b45cb9f75e970522f18e67d52c85c/src/site/resources/modello-deps.png -------------------------------------------------------------------------------- /src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/site/xdoc/modello-deps.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehaus-plexus/modello/0e03e4f1424b45cb9f75e970522f18e67d52c85c/src/site/xdoc/modello-deps.odg --------------------------------------------------------------------------------