Class ProjectContext
- java.lang.Object
-
- io.freefair.gradle.codegenerator.api.ProjectContext
-
- All Implemented Interfaces:
java.io.Serializable
public class ProjectContext extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProjectContext(java.io.File rootDir, java.io.File inputDir, java.io.File outputDir, java.util.Map<java.lang.String,java.lang.Object> configurationValues, java.lang.String sourceSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
configurationExists(java.lang.String key)
java.util.List<ProjectFile>
getAllFiles()
java.lang.Object
getConfigurationValue(java.lang.String key)
<T> T
getConfigurationValueAs(java.lang.String key, java.lang.Class<T> clazz)
java.io.File
getInputDir()
java.lang.String
getNamespaceFromFile(java.io.File file)
java.io.File
getOutputDir()
java.io.File
getRootDir()
java.lang.String
getSourceSet()
java.lang.String
readFile(java.lang.String namespace, java.lang.String filename)
java.lang.String
readFile(java.lang.String namespace, java.lang.String filename, java.lang.String encoding)
byte[]
readFileToByteArray(java.lang.String namespace, java.lang.String filename)
void
writeOutputFile(java.lang.String namespace, java.lang.String filename, byte[] content)
void
writeOutputFile(java.lang.String namespace, java.lang.String filename, java.lang.String content)
-
-
-
Method Detail
-
getNamespaceFromFile
public java.lang.String getNamespaceFromFile(java.io.File file)
-
getAllFiles
public java.util.List<ProjectFile> getAllFiles()
-
readFileToByteArray
public byte[] readFileToByteArray(java.lang.String namespace, java.lang.String filename) throws java.io.IOException
- Throws:
java.io.IOException
-
readFile
public java.lang.String readFile(java.lang.String namespace, java.lang.String filename) throws java.io.IOException
- Throws:
java.io.IOException
-
readFile
public java.lang.String readFile(java.lang.String namespace, java.lang.String filename, java.lang.String encoding) throws java.io.IOException
- Throws:
java.io.IOException
-
writeOutputFile
public void writeOutputFile(java.lang.String namespace, java.lang.String filename, java.lang.String content) throws java.io.IOException
- Throws:
java.io.IOException
-
writeOutputFile
public void writeOutputFile(java.lang.String namespace, java.lang.String filename, byte[] content) throws java.io.IOException
- Throws:
java.io.IOException
-
configurationExists
public boolean configurationExists(java.lang.String key)
-
getConfigurationValue
public java.lang.Object getConfigurationValue(java.lang.String key)
-
getConfigurationValueAs
public <T> T getConfigurationValueAs(java.lang.String key, java.lang.Class<T> clazz)
-
getRootDir
public java.io.File getRootDir()
-
getInputDir
public java.io.File getInputDir()
-
getOutputDir
public java.io.File getOutputDir()
-
getSourceSet
public java.lang.String getSourceSet()
-
-