├── .gitignore
├── LICENSE
├── README.md
├── license_header.txt
├── nb-configuration.xml
├── nbactions.xml
├── pom.xml
└── src
├── main
└── java
│ └── com
│ └── speedment
│ └── common
│ └── codegen
│ ├── DependencyManager.java
│ ├── Generator.java
│ ├── Meta.java
│ ├── RenderStack.java
│ ├── RenderTree.java
│ ├── Transform.java
│ ├── TransformFactory.java
│ ├── constant
│ ├── DefaultAnnotationUsage.java
│ ├── DefaultJavadocTag.java
│ ├── DefaultType.java
│ ├── DefaultValue.java
│ ├── SimpleParameterizedType.java
│ ├── SimpleType.java
│ └── SimpleTypeUtil.java
│ ├── controller
│ ├── AlignTabs.java
│ ├── AutoEquals.java
│ ├── AutoImports.java
│ ├── AutoJavadoc.java
│ ├── FinalParameters.java
│ ├── SetGetAdd.java
│ └── package-info.java
│ ├── internal
│ ├── BridgeTransform.java
│ ├── DefaultDependencyManager.java
│ ├── DefaultGenerator.java
│ ├── DefaultRenderStack.java
│ ├── DefaultRenderTree.java
│ ├── DefaultTransformFactory.java
│ ├── MetaImpl.java
│ ├── java
│ │ ├── JavaGenerator.java
│ │ ├── JavaTransformFactory.java
│ │ └── view
│ │ │ ├── AnnotationUsageView.java
│ │ │ ├── AnnotationView.java
│ │ │ ├── ClassOrInterfaceView.java
│ │ │ ├── ClassView.java
│ │ │ ├── ConstructorView.java
│ │ │ ├── EnumConstantView.java
│ │ │ ├── EnumView.java
│ │ │ ├── FieldView.java
│ │ │ ├── FileView.java
│ │ │ ├── GenericView.java
│ │ │ ├── ImportView.java
│ │ │ ├── InitalizerView.java
│ │ │ ├── InterfaceFieldView.java
│ │ │ ├── InterfaceMethodView.java
│ │ │ ├── InterfaceView.java
│ │ │ ├── JavadocTagView.java
│ │ │ ├── JavadocView.java
│ │ │ ├── MethodView.java
│ │ │ ├── ModifierView.java
│ │ │ ├── TypeView.java
│ │ │ ├── trait
│ │ │ ├── HasAnnotationUsageView.java
│ │ │ ├── HasClassesView.java
│ │ │ ├── HasCodeView.java
│ │ │ ├── HasCommentView.java
│ │ │ ├── HasFieldsView.java
│ │ │ ├── HasGenericsView.java
│ │ │ ├── HasImplementsView.java
│ │ │ ├── HasImportsView.java
│ │ │ ├── HasInitalizersView.java
│ │ │ ├── HasInitializersView.java
│ │ │ ├── HasJavadocTagsView.java
│ │ │ ├── HasJavadocView.java
│ │ │ ├── HasMethodsView.java
│ │ │ ├── HasModifiersView.java
│ │ │ ├── HasNameView.java
│ │ │ ├── HasThrowsView.java
│ │ │ ├── HasTypeView.java
│ │ │ └── HasValueView.java
│ │ │ └── value
│ │ │ ├── ArrayValueView.java
│ │ │ ├── BooleanValueView.java
│ │ │ ├── EnumValueView.java
│ │ │ ├── NullValueView.java
│ │ │ ├── NumberValueView.java
│ │ │ ├── ReferenceValueView.java
│ │ │ └── TextValueView.java
│ ├── model
│ │ ├── AnnotationImpl.java
│ │ ├── AnnotationUsageImpl.java
│ │ ├── ClassImpl.java
│ │ ├── ClassOrInterfaceImpl.java
│ │ ├── ConstructorImpl.java
│ │ ├── EnumConstantImpl.java
│ │ ├── EnumImpl.java
│ │ ├── FieldImpl.java
│ │ ├── FileImpl.java
│ │ ├── GenericImpl.java
│ │ ├── ImportImpl.java
│ │ ├── InitializerImpl.java
│ │ ├── InterfaceFieldImpl.java
│ │ ├── InterfaceImpl.java
│ │ ├── InterfaceMethodImpl.java
│ │ ├── JavadocImpl.java
│ │ ├── JavadocTagImpl.java
│ │ ├── MethodImpl.java
│ │ ├── ValueImpl.java
│ │ └── value
│ │ │ ├── ArrayValueImpl.java
│ │ │ ├── BooleanValueImpl.java
│ │ │ ├── EnumValueImpl.java
│ │ │ ├── NullValueImpl.java
│ │ │ ├── NumberValueImpl.java
│ │ │ ├── ReferenceValueImpl.java
│ │ │ └── TextValueImpl.java
│ └── util
│ │ ├── CollectorUtil.java
│ │ ├── Copier.java
│ │ ├── NullUtil.java
│ │ ├── StaticClassUtil.java
│ │ └── TextUtil.java
│ ├── model
│ ├── Annotation.java
│ ├── AnnotationUsage.java
│ ├── Class.java
│ ├── ClassOrInterface.java
│ ├── Constructor.java
│ ├── Enum.java
│ ├── EnumConstant.java
│ ├── Field.java
│ ├── File.java
│ ├── Generic.java
│ ├── Import.java
│ ├── Initializer.java
│ ├── Interface.java
│ ├── InterfaceField.java
│ ├── InterfaceMethod.java
│ ├── Javadoc.java
│ ├── JavadocTag.java
│ ├── Method.java
│ ├── Value.java
│ ├── modifier
│ │ ├── AnnotationModifier.java
│ │ ├── ClassModifier.java
│ │ ├── ConstructorModifier.java
│ │ ├── EnumModifier.java
│ │ ├── FieldModifier.java
│ │ ├── ImportModifier.java
│ │ ├── InitalizerModifier.java
│ │ ├── InterfaceFieldModifier.java
│ │ ├── InterfaceMethodModifier.java
│ │ ├── InterfaceModifier.java
│ │ ├── Keyword.java
│ │ ├── MethodModifier.java
│ │ ├── Modifier.java
│ │ └── package-info.java
│ ├── package-info.java
│ ├── trait
│ │ ├── HasAnnotationUsage.java
│ │ ├── HasCall.java
│ │ ├── HasClasses.java
│ │ ├── HasCode.java
│ │ ├── HasComment.java
│ │ ├── HasConstructors.java
│ │ ├── HasCopy.java
│ │ ├── HasFields.java
│ │ ├── HasGenerics.java
│ │ ├── HasImplements.java
│ │ ├── HasImports.java
│ │ ├── HasInitializers.java
│ │ ├── HasJavadoc.java
│ │ ├── HasJavadocTags.java
│ │ ├── HasMethods.java
│ │ ├── HasModifiers.java
│ │ ├── HasName.java
│ │ ├── HasSupertype.java
│ │ ├── HasThrows.java
│ │ ├── HasType.java
│ │ ├── HasValue.java
│ │ └── package-info.java
│ └── value
│ │ ├── ArrayValue.java
│ │ ├── BooleanValue.java
│ │ ├── EnumValue.java
│ │ ├── NullValue.java
│ │ ├── NumberValue.java
│ │ ├── ReferenceValue.java
│ │ └── TextValue.java
│ ├── package-info.java
│ └── util
│ ├── Formatting.java
│ └── package-info.java
└── test
└── java
└── com
├── example
└── PersonFactory.java
└── speedment
├── common
└── codegen
│ ├── internal
│ ├── DefaultRenderStackTest.java
│ ├── TestGenericInterfaces.java
│ └── java
│ │ └── view
│ │ ├── TypeViewTest.java
│ │ └── trait
│ │ └── HasImportsViewTest.java
│ └── model
│ └── AnnotationUsageTest.java
└── example
├── Person.java
└── PersonImpl.java
/.gitignore:
--------------------------------------------------------------------------------
1 | .sonar
2 | sonar-project.properties
3 | /target/
4 | /.idea/
5 | nb-configuration.xml
6 | **.iml
--------------------------------------------------------------------------------
/license_header.txt:
--------------------------------------------------------------------------------
1 |
2 | Copyright (c) 2006-${currentYear}, Speedment, Inc. All Rights Reserved.
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 |
17 |
--------------------------------------------------------------------------------
/nbactions.xml:
--------------------------------------------------------------------------------
1 |
2 | Field
is currently being transformed into a String,
24 | * the stack might look like this:
25 | *
26 | * File → Class → Method → Field 27 | *28 | * 29 | * @author Emil Forslund 30 | * @see Generator 31 | * @since 2.0 32 | */ 33 | public interface RenderStack { 34 | 35 | /** 36 | * Returns a
Stream
of all models in the stack of a particular
37 | * type from bottom and up.
38 | *
39 | * @param Stream
of all models in the stack of a particular
47 | * type from top to bottom.
48 | *
49 | * @param empty
.
37 | *
38 | * This method is not meant to be called outside the code generator. If you
39 | * want to transform between different types, setup a {@link Generator},
40 | * install the
22 | * This package is part of the API. Modifications to classes here should only
23 | * (if ever) be done in major releases.
24 | */
25 | package com.speedment.common.codegen.controller;
--------------------------------------------------------------------------------
/src/main/java/com/speedment/common/codegen/internal/DefaultRenderTree.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); You may not
6 | * use this file except in compliance with the License. You may obtain a copy of
7 | * 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, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 | package com.speedment.common.codegen.internal;
18 |
19 | import com.speedment.common.codegen.Meta;
20 | import com.speedment.common.codegen.RenderTree;
21 | import java.util.LinkedList;
22 | import java.util.List;
23 | import static java.util.Objects.requireNonNull;
24 |
25 | /**
26 | *
27 | * @author Emil Forslund
28 | */
29 | public final class DefaultRenderTree implements RenderTree {
30 |
31 | private final List> branches;
32 |
33 | private DefaultRenderTree(List> branches) {
34 | this.branches = requireNonNull(branches);
35 | }
36 |
37 | @Override
38 | public List> branches() {
39 | return branches;
40 | }
41 |
42 | public static final class Builder implements RenderTree.Builder {
43 |
44 | private final List> branches;
45 |
46 | public Builder() {
47 | branches = new LinkedList<>();
48 | }
49 |
50 | @Override
51 | public Builder withBranch(Meta, ?> meta) {
52 | branches.add(requireNonNull(meta));
53 | return this;
54 | }
55 |
56 | @Override
57 | public RenderTree build() {
58 | return new DefaultRenderTree(branches);
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/src/main/java/com/speedment/common/codegen/internal/java/JavaGenerator.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); You may not
6 | * use this file except in compliance with the License. You may obtain a copy of
7 | * 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, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 | package com.speedment.common.codegen.internal.java;
18 |
19 | import com.speedment.common.codegen.TransformFactory;
20 | import com.speedment.common.codegen.internal.DefaultDependencyManager;
21 | import com.speedment.common.codegen.internal.DefaultGenerator;
22 |
23 | import java.util.Set;
24 | import java.util.regex.Pattern;
25 | import java.util.stream.Collectors;
26 | import java.util.stream.Stream;
27 |
28 | /**
29 | * A hook to the generator that can be passed to various stages in the pipeline.
30 | * Contains multiple methods for generating model-to-model or model-to-text.
31 | *
32 | * The
64 | * Warning! If you use this constructor, no transforms will be installed
65 | * by default!
66 | *
67 | * @param factory the transform factory to use
68 | */
69 | public JavaGenerator(TransformFactory factory) {
70 | super(new DefaultDependencyManager(IGNORED), factory);
71 | }
72 |
73 | private static Pattern[] compileAll(String... regexp) {
74 | final Set
39 | * The default value is a single space (" ").
40 | *
41 | * @return the suffix
42 | */
43 | default String genericsSuffix() {
44 | return " ";
45 | }
46 |
47 | /**
48 | * Render the generics-part of the model followed by a space character.
49 | *
50 | * @param gen the generator
51 | * @param model the model
52 | * @return the generated code
53 | */
54 | default String renderGenerics(Generator gen, M model) {
55 | return gen.onEach(model.getGenerics())
56 | .collect(joinIfNotEmpty(", ", "<", ">" + genericsSuffix()));
57 | }
58 | }
--------------------------------------------------------------------------------
/src/main/java/com/speedment/common/codegen/internal/java/view/trait/HasImplementsView.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); You may not
6 | * use this file except in compliance with the License. You may obtain a copy of
7 | * 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, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 | package com.speedment.common.codegen.internal.java.view.trait;
18 |
19 | import com.speedment.common.codegen.Generator;
20 | import com.speedment.common.codegen.Transform;
21 | import com.speedment.common.codegen.model.trait.HasImplements;
22 |
23 | import static com.speedment.common.codegen.internal.util.CollectorUtil.joinIfNotEmpty;
24 |
25 | /**
26 | * A trait with the functionality to render models with the trait
27 | * {@link HasImplements}.
28 | *
29 | * @author Emil Forslund
30 | * @param
62 | * The default behaviour of this method is to return the input without any
63 | * modifications.
64 | *
65 | * @param method the method to wrap
66 | * @return a model derived from the method
67 | */
68 | default Object wrapMethod(Method method) {
69 | return method;
70 | }
71 | }
--------------------------------------------------------------------------------
/src/main/java/com/speedment/common/codegen/internal/java/view/trait/HasModifiersView.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); You may not
6 | * use this file except in compliance with the License. You may obtain a copy of
7 | * 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, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 | package com.speedment.common.codegen.internal.java.view.trait;
18 |
19 | import com.speedment.common.codegen.Generator;
20 | import com.speedment.common.codegen.Transform;
21 | import com.speedment.common.codegen.model.modifier.Modifier;
22 | import com.speedment.common.codegen.model.trait.HasModifiers;
23 |
24 | import java.util.Set;
25 | import java.util.stream.Stream;
26 |
27 | import static com.speedment.common.codegen.internal.util.CollectorUtil.joinIfNotEmpty;
28 | import static java.util.stream.Collectors.toSet;
29 |
30 | /**
31 | * A trait with the functionality to render models with the trait
32 | * {@link HasModifiers}.
33 | *
34 | * @author Emil Forslund
35 | * @param
37 | * The default value is an empty string ("").
38 | *
39 | * @return the trailing name suffix
40 | */
41 | default String nameSuffix() {
42 | return "";
43 | }
44 |
45 | /**
46 | * Render the name of the model.
47 | *
48 | * @param gen the generator
49 | * @param model the model
50 | * @return the generated code
51 | */
52 | default String renderName(Generator gen, M model) {
53 | return model.getName() + nameSuffix();
54 | }
55 | }
--------------------------------------------------------------------------------
/src/main/java/com/speedment/common/codegen/internal/java/view/trait/HasThrowsView.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); You may not
6 | * use this file except in compliance with the License. You may obtain a copy of
7 | * 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, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 | package com.speedment.common.codegen.internal.java.view.trait;
18 |
19 | import com.speedment.common.codegen.Generator;
20 | import com.speedment.common.codegen.Transform;
21 | import static com.speedment.common.codegen.internal.util.CollectorUtil.joinIfNotEmpty;
22 | import com.speedment.common.codegen.model.trait.HasThrows;
23 |
24 | /**
25 | * A trait with the functionality to render models with the trait
26 | * {@link HasThrows}.
27 | *
28 | * @author Emil Forslund
29 | * @param
33 | * Warning! This class should not be instantiated directly but using
34 | * the {@link Interface#of(String)} method!
35 | *
36 | * @param name the name
37 | */
38 | public InterfaceImpl(String name) {
39 | super (name);
40 | }
41 |
42 | /**
43 | * Copy constructor
44 | *
45 | * @param prototype the prototype
46 | */
47 | protected InterfaceImpl(Interface prototype) {
48 | super (prototype);
49 | }
50 |
51 | @Override
52 | public InterfaceImpl copy() {
53 | return new InterfaceImpl(this);
54 | }
55 | }
--------------------------------------------------------------------------------
/src/main/java/com/speedment/common/codegen/internal/model/ValueImpl.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); You may not
6 | * use this file except in compliance with the License. You may obtain a copy of
7 | * 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, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 | /*
18 | * To change this license header, choose License Headers in Project Properties.
19 | * To change this template file, choose Tools | Templates
20 | * and open the template in the editor.
21 | */
22 | package com.speedment.common.codegen.internal.model;
23 |
24 | import com.speedment.common.codegen.model.Value;
25 |
26 | import java.util.Objects;
27 |
28 | /**
29 | * The default implementation of the {@link Value} interface.
30 | *
31 | * @author Emil Forslund
32 | * @param Transform
in the factory and call one of the
41 | * on()
-methods in Generator
.
42 | *
43 | * @param gen a reference to the generator being used
44 | * @param model the model to transform
45 | * @return the transformed model or empty if the transformation could
46 | * not be done for that input
47 | */
48 | Optionalfinal
.
36 | *
37 | * @param model the model to operate on
38 | */
39 | @Override
40 | public void accept(T model) {
41 | requireNonNull(model).getMethods()
42 | .forEach(m -> m.getFields()
43 | .forEach(f -> f.final_())
44 | );
45 | }
46 | }
--------------------------------------------------------------------------------
/src/main/java/com/speedment/common/codegen/controller/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); You may not
6 | * use this file except in compliance with the License. You may obtain a copy of
7 | * 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, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 | /**
18 | * Controllers that automate certain tasks on the model hierarchy is located
19 | * here. These components are useful to keep the model initialization short
20 | * and consise.
21 | * JavaGenerator
comes with all the basic types
33 | * of the java language and the 'java.lang'-package ignored in imports and
34 | * has views of all the basic language concepts preinstalled.
35 | *
36 | * @author Emil Forslund
37 | */
38 | public class JavaGenerator extends DefaultGenerator {
39 |
40 | private final static Pattern[] IGNORED = compileAll(
41 | "^void$",
42 | "^byte$",
43 | "^short$",
44 | "^char$",
45 | "^int$",
46 | "^long$",
47 | "^boolean$",
48 | "^float$",
49 | "^double$",
50 | "^java\\.lang\\."
51 | );
52 |
53 | /**
54 | * Instantiates the JavaGenerator.
55 | */
56 | public JavaGenerator() {
57 | this(new JavaTransformFactory());
58 | }
59 |
60 | /**
61 | * Instantiates the JavaGenerator using an array of custom
62 | * {@link TransformFactory}.
63 | * "extends"
is used when an interface
39 | * has another interface as a supertype and "implements"
when a
40 | * class and an enum uses it.
41 | *
42 | * @return "extends" or "implements".
43 | */
44 | String extendsOrImplementsInterfaces();
45 |
46 | /**
47 | * Render the supertype-part of the model. The
48 | * {@link #extendsOrImplementsInterfaces()}-method should be implemented to
49 | * answer which wording to use; 'implements' or 'extends'.
50 | *
51 | * @param gen the generator
52 | * @param model the model
53 | * @return the generated code
54 | */
55 | default String renderInterfaces(Generator gen, M model) {
56 | return gen.onEach(model.getInterfaces()).collect(
57 | joinIfNotEmpty(
58 | ", ",
59 | extendsOrImplementsInterfaces(),
60 | " "
61 | )
62 | );
63 | }
64 | }
--------------------------------------------------------------------------------
/src/main/java/com/speedment/common/codegen/internal/java/view/trait/HasImportsView.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Copyright (c) 2006-2017, Speedment, Inc. All Rights Reserved.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License"); You may not
6 | * use this file except in compliance with the License. You may obtain a copy of
7 | * 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, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 | package com.speedment.common.codegen.internal.java.view.trait;
18 |
19 | import com.speedment.common.codegen.Generator;
20 | import com.speedment.common.codegen.Transform;
21 | import com.speedment.common.codegen.model.trait.HasImports;
22 |
23 | import static com.speedment.common.codegen.internal.util.CollectorUtil.joinIfNotEmpty;
24 | import static com.speedment.common.codegen.util.Formatting.dnl;
25 | import static com.speedment.common.codegen.util.Formatting.nl;
26 |
27 | /**
28 | * A trait with the functionality to render models with the trait
29 | * {@link HasImports}.
30 | *
31 | * @author Emil Forslund
32 | * @param >> implements ArrayValue {
32 |
33 | public ArrayValueImpl() {
34 | super(new ArrayList<>());
35 | }
36 |
37 | public ArrayValueImpl(List