public abstract class KBean
extends java.lang.Object
JkRunbase.load(java.lang.Class)
.Modifier | Constructor and Description |
---|---|
protected |
KBean()
Use
init() instead! |
Modifier and Type | Method and Description |
---|---|
KBean |
cleanOutput()
Cleans output directory.
|
<T extends KBean> |
find(java.lang.Class<T> beanClass) |
java.nio.file.Path |
getBaseDir()
Returns the base directory of the project.
|
java.lang.String |
getBaseDirName()
Returns the name of the folder which stands for the project base directory.
|
java.nio.file.Path |
getBasePath(java.lang.String relativePath)
Resolves the given relative path against the base directory of the project.
|
java.nio.file.Path |
getOutputDir()
Returns the output directory where all the final and intermediate artifacts are generated.
|
JkRunbase |
getRunbase()
Returns the
JkRunbase where this KBean has been instantiated. |
protected void |
init()
This method is called by JeKa engine, right after public fields from command-line or properties have been injected.
|
<T extends KBean> |
load(java.lang.Class<T> beanClass) |
java.lang.String |
toString() |
protected KBean()
init()
instead!
Code added here won't work as expected since public fields (such as those from command-line properties, basedir, and imported KBeans) are not yet initialized.
protected void init()
Put your initialization/configuration code here.
public final java.nio.file.Path getBaseDir()
public final java.nio.file.Path getBasePath(java.lang.String relativePath)
public final java.lang.String getBaseDirName()
public final java.nio.file.Path getOutputDir()
public final JkRunbase getRunbase()
JkRunbase
where this KBean has been instantiated.public final <T extends KBean> T load(java.lang.Class<T> beanClass)
JkRunbase.load(Class)
public final <T extends KBean> java.util.Optional<T> find(java.lang.Class<T> beanClass)
JkRunbase.find(Class)
public java.lang.String toString()
toString
in class java.lang.Object
public KBean cleanOutput()