Class DefaultParametersManager.DefaultHandlerData
- java.lang.Object
-
- org.apache.commons.configuration2.builder.DefaultParametersManager.DefaultHandlerData
-
- Enclosing class:
- DefaultParametersManager
private static final class DefaultParametersManager.DefaultHandlerData extends java.lang.Object
A data class storing information aboutDefaultParametersHandler
objects added to aParameters
object. Using this class it is possible to find out which default handlers apply for a given parameters object and to invoke them.
-
-
Field Summary
Fields Modifier and Type Field Description private DefaultParametersHandler<?>
handler
The handler object.private java.lang.Class<?>
parameterClass
The class supported by this handler.private java.lang.Class<?>
startClass
The start class for applying this handler.
-
Constructor Summary
Constructors Constructor Description DefaultHandlerData(DefaultParametersHandler<?> h, java.lang.Class<?> cls, java.lang.Class<?> startCls)
Creates a new instance ofDefaultHandlerData
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyHandlerIfMatching(BuilderParameters obj)
Checks whether the managedDefaultParametersHandler
can be applied to the given parameters object.boolean
isOccurrence(DefaultParametersHandler<?> h, java.lang.Class<?> startCls)
Tests whether this instance refers to the specified occurrence of aDefaultParametersHandler
.
-
-
-
Field Detail
-
handler
private final DefaultParametersHandler<?> handler
The handler object.
-
parameterClass
private final java.lang.Class<?> parameterClass
The class supported by this handler.
-
startClass
private final java.lang.Class<?> startClass
The start class for applying this handler.
-
-
Constructor Detail
-
DefaultHandlerData
public DefaultHandlerData(DefaultParametersHandler<?> h, java.lang.Class<?> cls, java.lang.Class<?> startCls)
Creates a new instance ofDefaultHandlerData
.- Parameters:
h
- theDefaultParametersHandler
cls
- the handler's data classstartCls
- the start class
-
-
Method Detail
-
applyHandlerIfMatching
public void applyHandlerIfMatching(BuilderParameters obj)
Checks whether the managedDefaultParametersHandler
can be applied to the given parameters object. If this is the case, it is executed on this object and can initialize it with default values.- Parameters:
obj
- the parameters object to be initialized
-
isOccurrence
public boolean isOccurrence(DefaultParametersHandler<?> h, java.lang.Class<?> startCls)
Tests whether this instance refers to the specified occurrence of aDefaultParametersHandler
.- Parameters:
h
- the handler to be checkedstartCls
- the start class- Returns:
- true if this instance refers to this occurrence, false otherwise
-
-