Class InspectionData
- java.lang.Object
-
- de.unistuttgart.informatik.fius.icge.simulation.inspection.InspectionData
-
public class InspectionData extends Object
Represents all data available for the inspection for a class- Author:
- Tim Neumann
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InspectionData.InspectionPointException
A exception that is thrown when an error with a inspection point occurs.
-
Constructor Summary
Constructors Constructor Description InspectionData(Class<?> cls)
Creates a new inspection data object for the given class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getAttributeNames()
Get the attribute names of the class for this inspection data.Class<?>
getAttributeType(String attributeName)
Get the type of the attribute with the given name.Object
getAttributeValue(Object obj, String name)
Get the value of the attribute with the given name from the given object.Method
getMethodByName(String methodName)
Get the method detail for the method with the given nameList<String>
getMethodNames()
Get the mathod names of the class for this inspection data.boolean
hasAnyInspectableElements()
Object
invokeMethod(Object obj, String methodName, Object... args)
Invoke the method with the given name in the given object, using the given argumentsboolean
isAttributeReadOnly(String attributeName)
Check whether the attribute with the given name is read only.boolean
setAttributeValue(Object obj, String name, Object value)
Set's the value of the attribute with the given name for the given object
-
-
-
Constructor Detail
-
InspectionData
public InspectionData(Class<?> cls)
Creates a new inspection data object for the given class- Parameters:
cls
- The class to create a inspection data object for.
-
-
Method Detail
-
getAttributeValue
public Object getAttributeValue(Object obj, String name)
Get the value of the attribute with the given name from the given object.- Parameters:
obj
- The object to get the value fromname
- The name of the attribute to get the value from- Returns:
- The value
-
setAttributeValue
public boolean setAttributeValue(Object obj, String name, Object value)
Set's the value of the attribute with the given name for the given object- Parameters:
obj
- The object to set the value in.name
- The name of the attribute to set.value
- The value to set.- Returns:
- Whether it worked.
-
getAttributeNames
public List<String> getAttributeNames()
Get the attribute names of the class for this inspection data.- Returns:
- A list of attribute names.
-
getAttributeType
public Class<?> getAttributeType(String attributeName)
Get the type of the attribute with the given name.- Parameters:
attributeName
- The name of the attribute- Returns:
- The type of the attribute.
-
isAttributeReadOnly
public boolean isAttributeReadOnly(String attributeName)
Check whether the attribute with the given name is read only.- Parameters:
attributeName
- The name of the attribute.- Returns:
- Whether the attribute is read only.
-
hasAnyInspectableElements
public boolean hasAnyInspectableElements()
- Returns:
- Whether this inspection data has any inspectable elements.
-
getMethodNames
public List<String> getMethodNames()
Get the mathod names of the class for this inspection data.- Returns:
- A list of method names.
-
getMethodByName
public Method getMethodByName(String methodName)
Get the method detail for the method with the given name- Parameters:
methodName
- The name of the method to get the detail for- Returns:
- The method detail.
-
invokeMethod
public Object invokeMethod(Object obj, String methodName, Object... args)
Invoke the method with the given name in the given object, using the given arguments- Parameters:
obj
- The object to call the method onmethodName
- The name of the method to callargs
- The arguments to use- Returns:
- The return value.
-
-