T - Type of extended builder.U - Type of AbstractConfiguration implementation.public abstract class AbstractConfigurationBuilder<T extends AbstractConfigurationBuilder<T,U>,U extends AbstractConfiguration> extends Object
AbstractConfiguration instances, should be extended by custom configuration implementation.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConfigurationBuilder()
Build default configuration.
|
| Modifier and Type | Method and Description |
|---|---|
abstract U |
build()
Build the final configuration instance.
|
String |
getClasspath()
Get current
classpath. |
Map<String,String> |
getEnvProperties()
Get current
envProperties. |
List<Hook> |
getHooks()
Get current
hooks. |
String |
getOverrideDescriptor()
Get current
overrideDescriptor. |
ClassLoader |
getParentClassLoader()
Get current
parentClassLoader. |
String |
getPath()
Get current
path. |
int |
getPort()
Get current
port. |
String |
getWebapp()
Get current
webapp. |
protected abstract T |
self()
The
this object, useful to get correct chaining. |
T |
withClasspath(String classpath)
Change
classpath value. |
T |
withHook(Hook hook)
Add new executable hook to the
hooks list. |
T |
withOverrideDescriptor(String overrideDescriptor)
Change
overrideDescriptor (path of the custom web.xml file descriptor=. |
T |
withParentClassLoader(Class<?> cls)
Change
parentClassLoader value. |
T |
withParentClasspath(Collection<URL> classpath)
Change
parentClassLoader value. |
T |
withParentClasspath(URL classpath,
URL... others)
Change
parentClassLoader value. |
T |
withPath(String path)
Change
path value. |
T |
withPort(int port)
Change
port value. |
T |
withProperty(String name,
String value)
Add new property entry to the
envProperties map. |
T |
withWebapp(File webapp)
Change
webapp value. |
T |
withWebapp(String webapp)
Change
webapp value. |
protected AbstractConfigurationBuilder()
protected abstract T self()
this object, useful to get correct chaining.public abstract U build()
public Map<String,String> getEnvProperties()
envProperties.envProperties.public ClassLoader getParentClassLoader()
parentClassLoader.parentClassLoader.public String getOverrideDescriptor()
overrideDescriptor.overrideDescriptor.public T withPath(String path)
path value.path - New path value.NullPointerException - If path is null.public T withWebapp(String webapp)
webapp value.webapp - New webapp value.NullPointerException - If webapp is null.public T withWebapp(File webapp)
webapp value.webapp - New webapp value (the absolute path will be used).NullPointerException - If webapp is null.public T withPort(int port)
port value.port - New port value.IllegalArgumentException - If port is strictly lower than zero.public T withClasspath(String classpath)
classpath value.classpath - New classpath value.public T withProperty(String name, String value)
envProperties map.name - Property name.value - Property value.NullPointerException - If name or value are null.IllegalArgumentException - if name is empty or blank.public T withHook(Hook hook)
hooks list.hook - Hook.NullPointerException - if hook is null.public T withParentClassLoader(Class<?> cls)
parentClassLoader value.cls - The class that will be used to get classloader.public T withParentClasspath(URL classpath, URL... others)
parentClassLoader value.classpath - New classpath entry.others - Other (optional) classpath urls.public T withParentClasspath(Collection<URL> classpath)
parentClassLoader value.classpath - New parentClassLoader value.public T withOverrideDescriptor(String overrideDescriptor)
overrideDescriptor (path of the custom web.xml file descriptor=.overrideDescriptor - The new overrideDescriptor value.Copyright © 2019. All rights reserved.