This repository has been archived by the owner on May 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from CJSCommonPlatform/add-plugin-context
Add PluginContext for generator plugins
- Loading branch information
Showing
18 changed files
with
167 additions
and
138 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
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
7 changes: 1 addition & 6 deletions
7
...uk/gov/justice/generation/pojo/generators/plugin/classgenerator/ClassGeneratorPlugin.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 | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
package uk.gov.justice.generation.pojo.generators.plugin.classgenerator; | ||
|
||
import uk.gov.justice.generation.pojo.core.GenerationContext; | ||
import uk.gov.justice.generation.pojo.dom.ClassDefinition; | ||
import uk.gov.justice.generation.pojo.generators.ClassNameFactory; | ||
import uk.gov.justice.generation.pojo.generators.JavaGeneratorFactory; | ||
|
||
import com.squareup.javapoet.TypeSpec; | ||
|
||
public interface ClassGeneratorPlugin { | ||
|
||
TypeSpec.Builder generateWith(final TypeSpec.Builder typeSpecBuilder, | ||
final ClassDefinition classDefinition, | ||
final JavaGeneratorFactory javaGeneratorFactory, | ||
final ClassNameFactory classNameFactory, | ||
final GenerationContext generationContext); | ||
final PluginContext pluginContext); | ||
} |
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
30 changes: 30 additions & 0 deletions
30
...n/java/uk/gov/justice/generation/pojo/generators/plugin/classgenerator/PluginContext.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package uk.gov.justice.generation.pojo.generators.plugin.classgenerator; | ||
|
||
import uk.gov.justice.generation.pojo.generators.ClassNameFactory; | ||
import uk.gov.justice.generation.pojo.generators.JavaGeneratorFactory; | ||
|
||
public class PluginContext { | ||
private final JavaGeneratorFactory generatorFactory; | ||
private final ClassNameFactory classNameFactory; | ||
private final String sourceFilename; | ||
|
||
public PluginContext(final JavaGeneratorFactory generatorFactory, | ||
final ClassNameFactory classNameFactory, | ||
final String sourceFilename) { | ||
this.generatorFactory = generatorFactory; | ||
this.classNameFactory = classNameFactory; | ||
this.sourceFilename = sourceFilename; | ||
} | ||
|
||
public JavaGeneratorFactory getJavaGeneratorFactory() { | ||
return generatorFactory; | ||
} | ||
|
||
public ClassNameFactory getClassNameFactory() { | ||
return classNameFactory; | ||
} | ||
|
||
public String getSourceFilename() { | ||
return sourceFilename; | ||
} | ||
} |
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
Oops, something went wrong.