Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
375 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
package com.speedment.codegen; | |||
|
|||
/** | |||
* | |||
* @author pemi | |||
* @param <T> the type of the containing class | |||
*/ | |||
public interface Adder<T> { | |||
|
|||
T add(); | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
src/main/java/com/speedment/codegen/model/field/FieldAdder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,96 @@ | |||
package com.speedment.codegen.model.field; | |||
|
|||
import com.speedment.codegen.Adder; | |||
import com.speedment.codegen.model.annotation.Annotation_; | |||
import com.speedment.codegen.model.modifier.FieldModifier_; | |||
import java.util.Set; | |||
|
|||
/** | |||
* | |||
* @author pemi | |||
* @param <T> | |||
*/ | |||
public abstract class FieldAdder<T> extends Field_ implements Adder<T> { | |||
|
|||
T parent; | |||
|
|||
public FieldAdder(T parent) { | |||
super(null, null); | |||
this.parent = parent; | |||
} | |||
|
|||
protected abstract void addToParent(T parent); | |||
|
|||
@Override | |||
public T add() { | |||
addToParent(parent); | |||
return parent; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> public_() { | |||
super.public_(); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> protected_() { | |||
super.protected_(); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> private_() { | |||
super.private_(); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> static_() { | |||
super.static_(); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> final_() { | |||
super.final_(); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> transient_() { | |||
super.transient_(); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> volatile_() { | |||
super.volatile_(); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> set(Set<FieldModifier_> newSet) { | |||
super.set(newSet); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> setName(CharSequence name) { | |||
super.setName(name); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> add(Annotation_ annotation) { | |||
super.add(annotation); | |||
return this; | |||
} | |||
|
|||
@Override | |||
public FieldAdder<T> add(FieldModifier_ firstModifier_m, FieldModifier_... restModifiers) { | |||
super.add(firstModifier_m, restModifiers); | |||
return this; | |||
} | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.