Class InspectionManager
- java.lang.Object
-
- de.unistuttgart.informatik.fius.icge.simulation.inspection.InspectionManager
-
public class InspectionManager extends Object
A class for managing the inspections- Author:
- Tim Neumann
-
-
Constructor Summary
Constructors Constructor Description InspectionManager()
Create a new inspection manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getAttributeNamesOfEntity(Entity entity)
Get's all attribute names of the given entity.Class<?>
getAttributeType(Entity entity, String attributeName)
Get's the type of the attribute with the given name in the given entity.Object
getAttributeValue(Entity entity, String attributeName)
Get the value of the attribute with the given name from the given entityMethod
getMethodDetail(Entity entity, String methodName)
Get the detail of the method with the given name of the given name.List<String>
getMethodNamesOfEntity(Entity entity)
Get's all method names of the given entity.Object
invokeMethod(Entity entity, String methodName, Object... args)
Invokes the method with the given name on the given entity.boolean
isAttributeEditable(Entity entity, String attributeName)
Checks whether the attribute with the given name in the given entity is writable.boolean
setAttributeValue(Entity entity, String attributeName, Object value)
Set the value of the attribute with the given name in the given entity
-
-
-
Method Detail
-
getAttributeNamesOfEntity
public List<String> getAttributeNamesOfEntity(Entity entity)
Get's all attribute names of the given entity.- Parameters:
entity
- The entity to get the names for- Returns:
- A List of attribute names.
-
getMethodNamesOfEntity
public List<String> getMethodNamesOfEntity(Entity entity)
Get's all method names of the given entity.- Parameters:
entity
- The entity to get the names for- Returns:
- A List of method names.
-
isAttributeEditable
public boolean isAttributeEditable(Entity entity, String attributeName)
Checks whether the attribute with the given name in the given entity is writable.- Parameters:
entity
- The entity.attributeName
- The name of the attribute- Returns:
- Whether the attribute is writable.
-
getAttributeType
public Class<?> getAttributeType(Entity entity, String attributeName)
Get's the type of the attribute with the given name in the given entity.- Parameters:
entity
- The entity.attributeName
- The name of the attribute- Returns:
- The type of the attribute.
-
getAttributeValue
public Object getAttributeValue(Entity entity, String attributeName)
Get the value of the attribute with the given name from the given entity- Parameters:
entity
- The entity to get the value fromattributeName
- The name of the attribute to get the value from- Returns:
- The value or null if it didn't work.
-
setAttributeValue
public boolean setAttributeValue(Entity entity, String attributeName, Object value)
Set the value of the attribute with the given name in the given entity- Parameters:
entity
- The entity to set the value inattributeName
- The name of the attribute to set the value for.value
- The value to set.- Returns:
- Whether it worked.
-
getMethodDetail
public Method getMethodDetail(Entity entity, String methodName)
Get the detail of the method with the given name of the given name.- Parameters:
entity
- The entity to get the method of.methodName
- The name of the method to get.- Returns:
- The method detail.
-
invokeMethod
public Object invokeMethod(Entity entity, String methodName, Object... args)
Invokes the method with the given name on the given entity. Uses the given arguments.- Parameters:
entity
- The entity to invoke the method in.methodName
- The name of the method to invoke.args
- The arguments for the method invocation.- Returns:
- The return value of the method.
- Throws:
IllegalStateException
- When anything goes wrong.
-
-