Class JavaInputReader
- java.lang.Object
-
- com.devonfw.cobigen.javaplugin.inputreader.JavaInputReader
-
- All Implemented Interfaces:
com.devonfw.cobigen.api.extension.InputReader
public class JavaInputReader extends java.lang.Object implements com.devonfw.cobigen.api.extension.InputReaderExtension for theInputReaderInterface of the CobiGen, to be able to read Java classes into FreeMarker models
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVALID_EXTENSIONValid file extension for the reader
-
Constructor Summary
Constructors Constructor Description JavaInputReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>createModel(java.lang.Object o)java.util.List<java.lang.Object>getInputObjects(java.lang.Object input, java.nio.charset.Charset inputCharset)java.util.List<java.lang.Object>getInputObjects(java.lang.Object input, java.nio.charset.Charset inputCharset, boolean recursively)Returns all input objects for the given container input.java.util.List<java.lang.Object>getInputObjectsRecursively(java.lang.Object input, java.nio.charset.Charset inputCharset)booleanisMostLikelyReadable(java.nio.file.Path path)booleanisValidInput(java.lang.Object input)java.lang.Objectread(java.nio.file.Path path, java.nio.charset.Charset inputCharset, java.lang.Object... additionalArguments)Reads the data at the specified path.
-
-
-
Field Detail
-
VALID_EXTENSION
public static final java.lang.String VALID_EXTENSION
Valid file extension for the reader- See Also:
- Constant Field Values
-
-
Method Detail
-
isValidInput
public boolean isValidInput(java.lang.Object input)
- Specified by:
isValidInputin interfacecom.devonfw.cobigen.api.extension.InputReader
-
createModel
public java.util.Map<java.lang.String,java.lang.Object> createModel(java.lang.Object o)
- Specified by:
createModelin interfacecom.devonfw.cobigen.api.extension.InputReader
-
getInputObjects
public java.util.List<java.lang.Object> getInputObjects(java.lang.Object input, java.nio.charset.Charset inputCharset)- Specified by:
getInputObjectsin interfacecom.devonfw.cobigen.api.extension.InputReader
-
getInputObjectsRecursively
public java.util.List<java.lang.Object> getInputObjectsRecursively(java.lang.Object input, java.nio.charset.Charset inputCharset)- Specified by:
getInputObjectsRecursivelyin interfacecom.devonfw.cobigen.api.extension.InputReader
-
getInputObjects
public java.util.List<java.lang.Object> getInputObjects(java.lang.Object input, java.nio.charset.Charset inputCharset, boolean recursively)Returns all input objects for the given container input.- Parameters:
input- container input (onlyPackageFolderinstances will be supported)inputCharset-Charsetto be used to read the childrenrecursively- states, whether the children should be retrieved recursively- Returns:
- the list of children. In this case
Fileobjects
-
read
public java.lang.Object read(java.nio.file.Path path, java.nio.charset.Charset inputCharset, java.lang.Object... additionalArguments) throws com.devonfw.cobigen.api.exception.InputReaderExceptionReads the data at the specified path.- Specified by:
readin interfacecom.devonfw.cobigen.api.extension.InputReader- Parameters:
path- the Path of the content to readadditionalArguments-- In case of path pointing to a folder
- packageName: String, required
- classLoader: ClassLoader, required
- In case of path pointing to a file
- In case of path pointing to a folder
- Throws:
com.devonfw.cobigen.api.exception.InputReaderException
-
isMostLikelyReadable
public boolean isMostLikelyReadable(java.nio.file.Path path)
- Specified by:
isMostLikelyReadablein interfacecom.devonfw.cobigen.api.extension.InputReader
-
-