com.philemonworks.selfdiagnose.check
Class CheckBeanProperty
java.lang.Object
com.philemonworks.selfdiagnose.DiagnosticTask
com.philemonworks.selfdiagnose.PatternMatchingTask
com.philemonworks.selfdiagnose.check.CheckProperty
com.philemonworks.selfdiagnose.check.CheckBeanProperty
- All Implemented Interfaces:
- Serializable
public class CheckBeanProperty
- extends CheckProperty
CheckBeanProperty is a DiagnosticTask that checks a property and matches its (String) value to a regular expression pattern.
This task can only be used together with another task that provides the bean by inserting a variable into the execution context.
<checkbeanproperty bean="${name of var}" property="attribute name" pattern="regular expression" />
<checkbeanproperty bean="${name of var}" method="toString" pattern="regular expression" />
<checkbeanproperty bean="${name of var}" pattern="regular expression" />
Stores the property value into the (optional) specified variable.
- Author:
- Ernest Micklei
- See Also:
- Serialized Form
Methods inherited from class com.philemonworks.selfdiagnose.DiagnosticTask |
createResult, getComment, getDefaultReportTemplate, getRequestor, getTaskName, getVariableName, hasComment, isReportResults, run, run, setComment, setReportResults, setRequestor, setVariableName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PARAMETER_METHOD
protected static final String PARAMETER_METHOD
- See Also:
- Constant Field Values
PARAMETER_BEAN
protected static final String PARAMETER_BEAN
- See Also:
- Constant Field Values
CheckBeanProperty
public CheckBeanProperty()
getDescription
public String getDescription()
- Return the description of this task.
- Specified by:
getDescription
in class DiagnosticTask
- Returns:
- String the description
initializeFromAttributes
public void initializeFromAttributes(Attributes attributes)
- Description copied from class:
DiagnosticTask
- This method is sent from the SelfDiagnoseHandler when a configuration is being processed. Use the passed
attributes to initialize the receiver.
If a variable parameter is passed then store it.
- Overrides:
initializeFromAttributes
in class CheckProperty
- Parameters:
attributes
- org.xml.sax.Attributes
setUp
public void setUp(ExecutionContext ctx)
throws DiagnoseException
- Description copied from class:
DiagnosticTask
- Override this method to verify that task parameters are initialized/set correctly.
- Overrides:
setUp
in class CheckProperty
- Parameters:
ctx
- ExecutionContext
- Throws:
DiagnoseException
checkPropertyAccess
protected void checkPropertyAccess()
throws DiagnoseException
- Overrides:
checkPropertyAccess
in class CheckProperty
- Throws:
DiagnoseException
run
public void run(ExecutionContext ctx,
DiagnosticTaskResult result)
throws DiagnoseException
- Description copied from class:
DiagnosticTask
- Run the task. If an error is detected then raise a DiagnoseException.
Otherwise use the result object to the report any messages when a run is completed.
- Specified by:
run
in class DiagnosticTask
- Parameters:
ctx
- ExecutionContextresult
- DiagnosticTaskResult
- Throws:
DiagnoseException
constructGetter
public String constructGetter()
getMethod
public String getMethod()
setMethod
public void setMethod(String method)
setBean
public void setBean(String aString)
getBean
public String getBean()
Copyright © 2012. All Rights Reserved.