Skip to content

Commit ca30aba

Browse files
committed
Reformat using spotless
1 parent 9ae116f commit ca30aba

File tree

236 files changed

+13014
-17264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+13014
-17264
lines changed

modello-core/pom.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
35
<parent>
4-
<artifactId>modello</artifactId>
56
<groupId>org.codehaus.modello</groupId>
7+
<artifactId>modello</artifactId>
68
<version>2.1.2-SNAPSHOT</version>
79
</parent>
8-
9-
<modelVersion>4.0.0</modelVersion>
1010
<artifactId>modello-core</artifactId>
1111
<name>Modello Core</name>
12-
<description>
13-
Modello Core contains the basis for model description, reading, and plugins system.
14-
</description>
12+
<description>Modello Core contains the basis for model description, reading, and plugins system.</description>
1513

1614
<dependencies>
1715
<dependency>

modello-core/src/main/java/org/codehaus/modello/Modello.java

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,47 +29,39 @@
2929
import org.codehaus.modello.core.ModelloCore;
3030
import org.codehaus.modello.model.Model;
3131
import org.codehaus.modello.model.ModelValidationException;
32-
import org.codehaus.plexus.PlexusContainer;
3332
import org.codehaus.plexus.DefaultPlexusContainer;
33+
import org.codehaus.plexus.PlexusContainer;
3434

3535
/**
3636
* @author <a href="mailto:[email protected]">Jason van Zyl</a>
3737
* @author <a href="mailto:[email protected]">Trygve Laugst&oslash;l</a>
3838
*/
39-
public class Modello
40-
{
39+
public class Modello {
4140
private PlexusContainer container;
4241

4342
private ModelloCore core;
4443

45-
public Modello()
46-
throws ModelloException
47-
{
48-
try
49-
{
44+
public Modello() throws ModelloException {
45+
try {
5046
container = new DefaultPlexusContainer();
5147

52-
core = (ModelloCore) container.lookup( ModelloCore.ROLE );
53-
}
54-
catch ( Exception ex )
55-
{
56-
throw new ModelloException( "Error while starting plexus.", ex );
48+
core = (ModelloCore) container.lookup(ModelloCore.ROLE);
49+
} catch (Exception ex) {
50+
throw new ModelloException("Error while starting plexus.", ex);
5751
}
5852
}
5953

60-
public void generate( Reader modelReader, String outputType, Properties parameters )
61-
throws ModelloException, ModelValidationException
62-
{
63-
Model model = core.loadModel( modelReader );
54+
public void generate(Reader modelReader, String outputType, Properties parameters)
55+
throws ModelloException, ModelValidationException {
56+
Model model = core.loadModel(modelReader);
6457

65-
core.generate( model, outputType, parameters );
58+
core.generate(model, outputType, parameters);
6659
}
6760

68-
public void translate( Reader reader, Writer writer, String outputType, Properties parameters )
69-
throws ModelloException, ModelValidationException
70-
{
71-
Model model = core.translate( reader, outputType, parameters );
61+
public void translate(Reader reader, Writer writer, String outputType, Properties parameters)
62+
throws ModelloException, ModelValidationException {
63+
Model model = core.translate(reader, outputType, parameters);
7264

73-
core.saveModel( model, writer );
65+
core.saveModel(model, writer);
7466
}
7567
}

modello-core/src/main/java/org/codehaus/modello/ModelloCli.java

Lines changed: 35 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,114 +22,102 @@
2222
* SOFTWARE.
2323
*/
2424

25-
import org.codehaus.plexus.util.ReaderFactory;
26-
import org.codehaus.plexus.util.StringUtils;
27-
2825
import java.io.File;
2926
import java.util.Properties;
3027

28+
import org.codehaus.plexus.util.ReaderFactory;
29+
import org.codehaus.plexus.util.StringUtils;
30+
3131
/**
3232
* @author <a href="mailto:[email protected]">Trygve Laugst&oslash;l</a>
3333
*/
34-
public class ModelloCli
35-
{
34+
public class ModelloCli {
3635
private static File modelFile;
3736

3837
private static String outputType;
3938

4039
private static Properties parameters;
4140

42-
public static void main( String[] args )
43-
throws Exception
44-
{
41+
public static void main(String[] args) throws Exception {
4542
Modello modello = new Modello();
4643

47-
parseArgumentsFromCommandLine( args );
44+
parseArgumentsFromCommandLine(args);
4845

49-
modello.generate( ReaderFactory.newXmlReader( modelFile ), outputType, parameters );
46+
modello.generate(ReaderFactory.newXmlReader(modelFile), outputType, parameters);
5047
}
5148

52-
public static void parseArgumentsFromCommandLine( String[] args )
53-
throws Exception
54-
{
55-
if ( args.length < 6 )
56-
{
49+
public static void parseArgumentsFromCommandLine(String[] args) throws Exception {
50+
if (args.length < 6) {
5751
usage();
5852

59-
System.exit( 1 );
53+
System.exit(1);
6054
}
6155

62-
modelFile = new File( args[0] );
56+
modelFile = new File(args[0]);
6357

6458
outputType = args[1];
6559

6660
parameters = new Properties();
6761

6862
String outputDirectory = args[2];
6963

70-
if ( StringUtils.isEmpty( outputDirectory ) )
71-
{
72-
System.err.println( "Missing required parameter: output directory" );
64+
if (StringUtils.isEmpty(outputDirectory)) {
65+
System.err.println("Missing required parameter: output directory");
7366

7467
usage();
7568

76-
System.exit( 1 );
69+
System.exit(1);
7770
}
7871

79-
parameters.setProperty( ModelloParameterConstants.OUTPUT_DIRECTORY, outputDirectory );
72+
parameters.setProperty(ModelloParameterConstants.OUTPUT_DIRECTORY, outputDirectory);
8073

81-
String modelVersion = args[ 3 ];
74+
String modelVersion = args[3];
8275

83-
if ( StringUtils.isEmpty( modelVersion ) )
84-
{
85-
System.err.println( "Missing required parameter: model version" );
76+
if (StringUtils.isEmpty(modelVersion)) {
77+
System.err.println("Missing required parameter: model version");
8678

8779
usage();
8880

89-
System.exit( 1 );
81+
System.exit(1);
9082
}
9183

92-
parameters.setProperty( ModelloParameterConstants.VERSION, modelVersion );
84+
parameters.setProperty(ModelloParameterConstants.VERSION, modelVersion);
9385

94-
String packageWithVersion = args[ 4 ];
86+
String packageWithVersion = args[4];
9587

96-
if ( StringUtils.isEmpty( packageWithVersion ) )
97-
{
98-
System.err.println( "Missing required parameter: package with version" );
88+
if (StringUtils.isEmpty(packageWithVersion)) {
89+
System.err.println("Missing required parameter: package with version");
9990

10091
usage();
10192

102-
System.exit( 1 );
93+
System.exit(1);
10394
}
10495

105-
parameters.setProperty( ModelloParameterConstants.PACKAGE_WITH_VERSION, packageWithVersion );
96+
parameters.setProperty(ModelloParameterConstants.PACKAGE_WITH_VERSION, packageWithVersion);
10697

107-
String javaSource = args[ 5 ];
98+
String javaSource = args[5];
10899

109-
if ( StringUtils.isEmpty( javaSource ) )
110-
{
111-
System.err.println( "Missing required parameter: Java Source" );
100+
if (StringUtils.isEmpty(javaSource)) {
101+
System.err.println("Missing required parameter: Java Source");
112102

113103
usage();
114104

115-
System.exit( 1 );
105+
System.exit(1);
116106
}
117107

118-
parameters.setProperty( ModelloParameterConstants.OUTPUT_JAVA_SOURCE, javaSource );
108+
parameters.setProperty(ModelloParameterConstants.OUTPUT_JAVA_SOURCE, javaSource);
119109

120-
if ( args.length > 6 )
121-
{
122-
parameters.setProperty( ModelloParameterConstants.ENCODING, args[6] );
110+
if (args.length > 6) {
111+
parameters.setProperty(ModelloParameterConstants.ENCODING, args[6]);
123112
}
124113
}
125114

126115
// ----------------------------------------------------------------------
127116
//
128117
// ----------------------------------------------------------------------
129118

130-
private static void usage()
131-
{
132-
System.err.println( "Usage: modello <model> <outputType> <output directory> <modelVersion> <packageWithVersion>"
133-
+ "<javaSource> [<encoding>]" );
119+
private static void usage() {
120+
System.err.println("Usage: modello <model> <outputType> <output directory> <modelVersion> <packageWithVersion>"
121+
+ "<javaSource> [<encoding>]");
134122
}
135123
}

modello-core/src/main/java/org/codehaus/modello/ModelloException.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,14 @@
2525
/**
2626
* @author <a href="mailto:[email protected]">Trygve Laugst&oslash;l</a>
2727
*/
28-
public class ModelloException
29-
extends Exception
30-
{
28+
public class ModelloException extends Exception {
3129
private static final long serialVersionUID = -8746896773615188345L;
3230

33-
public ModelloException( String msg )
34-
{
35-
super( msg );
31+
public ModelloException(String msg) {
32+
super(msg);
3633
}
3734

38-
public ModelloException( String msg, Throwable cause )
39-
{
40-
super( msg, cause );
35+
public ModelloException(String msg, Throwable cause) {
36+
super(msg, cause);
4137
}
4238
}

modello-core/src/main/java/org/codehaus/modello/ModelloParameterConstants.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
/**
2626
* @author <a href="mailto:[email protected]">Trygve Laugst&oslash;l</a>
2727
*/
28-
public class ModelloParameterConstants
29-
{
28+
public class ModelloParameterConstants {
3029
public static final String VERSION = "modello.version";
3130

3231
public static final String OUTPUT_DIRECTORY = "modello.output.directory";
@@ -47,7 +46,7 @@ public class ModelloParameterConstants
4746
public static final String ENCODING = "modello.output.encoding";
4847

4948
/**
50-
* Replaces USE_JAVA5
49+
* Replaces USE_JAVA5
5150
* @since 2.0
5251
*/
5352
public static final String OUTPUT_JAVA_SOURCE = "modello.output.java.source";
@@ -78,7 +77,6 @@ public class ModelloParameterConstants
7877
* @since 2.1
7978
*/
8079
public static final String XSD_ENFORCE_MANDATORY_ELEMENTS = "modello.xsd.enforce.mandatory.element";
81-
private ModelloParameterConstants()
82-
{
83-
}
80+
81+
private ModelloParameterConstants() {}
8482
}

modello-core/src/main/java/org/codehaus/modello/ModelloRuntimeException.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,14 @@
2525
/**
2626
* @author <a href="mailto:[email protected]">Trygve Laugst&oslash;l</a>
2727
*/
28-
public class ModelloRuntimeException
29-
extends RuntimeException
30-
{
28+
public class ModelloRuntimeException extends RuntimeException {
3129
private static final long serialVersionUID = -637783066384319780L;
3230

33-
public ModelloRuntimeException( String msg )
34-
{
35-
super( msg );
31+
public ModelloRuntimeException(String msg) {
32+
super(msg);
3633
}
3734

38-
public ModelloRuntimeException( String msg, Throwable cause )
39-
{
40-
super( msg, cause );
35+
public ModelloRuntimeException(String msg, Throwable cause) {
36+
super(msg, cause);
4137
}
4238
}

modello-core/src/main/java/org/codehaus/modello/core/AbstractModelloCore.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,27 @@
2222
* SOFTWARE.
2323
*/
2424

25+
import java.io.Reader;
26+
import java.io.Writer;
27+
2528
import org.codehaus.modello.ModelloException;
2629
import org.codehaus.modello.model.Model;
2730
import org.codehaus.modello.model.ModelValidationException;
2831
import org.codehaus.plexus.logging.AbstractLogEnabled;
2932

30-
import java.io.Reader;
31-
import java.io.Writer;
32-
3333
/**
3434
* @author <a href="mailto:[email protected]">Trygve Laugst&oslash;l</a>
3535
*/
36-
public abstract class AbstractModelloCore
37-
extends AbstractLogEnabled
38-
implements ModelloCore
39-
{
36+
public abstract class AbstractModelloCore extends AbstractLogEnabled implements ModelloCore {
4037
// ----------------------------------------------------------------------
4138
// Partial ModelloCore implementation
4239
// ----------------------------------------------------------------------
4340

44-
public Model input( Reader reader )
45-
throws ModelloException, ModelValidationException
46-
{
47-
return loadModel( reader );
41+
public Model input(Reader reader) throws ModelloException, ModelValidationException {
42+
return loadModel(reader);
4843
}
4944

50-
public void output( Model model, Writer writer )
51-
throws ModelloException
52-
{
53-
saveModel( model, writer );
45+
public void output(Model model, Writer writer) throws ModelloException {
46+
saveModel(model, writer);
5447
}
5548
}

modello-core/src/main/java/org/codehaus/modello/core/DefaultGeneratorPluginManager.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,27 @@
3333
/**
3434
* @author <a href="mailto:[email protected]">Trygve Laugst&oslash;l</a>
3535
*/
36-
@Component( role = GeneratorPluginManager.class )
37-
public class DefaultGeneratorPluginManager
38-
extends AbstractPluginManager<ModelloGenerator>
39-
implements GeneratorPluginManager
40-
{
36+
@Component(role = GeneratorPluginManager.class)
37+
public class DefaultGeneratorPluginManager extends AbstractPluginManager<ModelloGenerator>
38+
implements GeneratorPluginManager {
4139
@Requirement
4240
private Map<String, ModelloGenerator> plugins;
4341

44-
public Map<String, ModelloGenerator> getPlugins()
45-
{
42+
public Map<String, ModelloGenerator> getPlugins() {
4643
return plugins;
4744
}
4845

49-
public ModelloGenerator getGeneratorPlugin( String generatorId )
50-
{
51-
ModelloGenerator generator = getPlugin( generatorId );
46+
public ModelloGenerator getGeneratorPlugin(String generatorId) {
47+
ModelloGenerator generator = getPlugin(generatorId);
5248

53-
if ( generator == null )
54-
{
55-
throw new ModelloRuntimeException( "No such generator plugin: '" + generatorId + "'." );
49+
if (generator == null) {
50+
throw new ModelloRuntimeException("No such generator plugin: '" + generatorId + "'.");
5651
}
5752

5853
return generator;
5954
}
6055

61-
public boolean hasGeneratorPlugin( String generatorId )
62-
{
63-
return hasPlugin( generatorId );
56+
public boolean hasGeneratorPlugin(String generatorId) {
57+
return hasPlugin(generatorId);
6458
}
6559
}

0 commit comments

Comments
 (0)