public class FieldPath extends Object
Constructor and Description |
---|
FieldPath(LinkedList<FieldMirror> fieldPath)
Public constructor for the reflection class.
|
Modifier and Type | Method and Description |
---|---|
LinkedList<FieldMirror> |
getFieldPath()
Gets the field path.
|
Object |
getValue(Object targetObject,
Boolean fieldAccess,
Boolean ignoreAccess)
Gets the value of the last field value in the path.
|
void |
setFields(LinkedList<FieldMirror> fieldPath)
Sets the field path.
|
void |
setValue(Object targetObject,
Object newValue,
Boolean fieldAccess,
Boolean ignoreAccess)
Sets the value of the last field in the path.
|
public FieldPath(LinkedList<FieldMirror> fieldPath)
fieldPath
- Field path.public LinkedList<FieldMirror> getFieldPath()
public void setFields(LinkedList<FieldMirror> fieldPath)
fieldPath
- New field path.public Object getValue(Object targetObject, Boolean fieldAccess, Boolean ignoreAccess) throws org.dejava.component.exception.localized.unchecked.EmptyParameterException, org.dejava.component.exception.localized.unchecked.InvalidParameterException, InvocationException
targetObject
- The target object to get the field value from. Might be null if it is a static field.fieldAccess
- If each field must be accessed directly (or via getter).ignoreAccess
- If the defined access (private or protected) must be ignored.org.dejava.component.exception.localized.unchecked.EmptyParameterException
- If the target object is null and a field/getter is not static.org.dejava.component.exception.localized.unchecked.InvalidParameterException
- If a field/getter in the field path cannot be accessed or found.InvocationException
- If a getter in the field path throws an exception.public void setValue(Object targetObject, Object newValue, Boolean fieldAccess, Boolean ignoreAccess) throws org.dejava.component.exception.localized.unchecked.EmptyParameterException, org.dejava.component.exception.localized.unchecked.InvalidParameterException, InvocationException
targetObject
- The target object to set the field value. Might be null if it is a static field.newValue
- The new value for the field.fieldAccess
- If each field must be accessed directly (or via setter).ignoreAccess
- If the defined access (private or protected) must be ignored.org.dejava.component.exception.localized.unchecked.EmptyParameterException
- If the target object is null and a field/setter is not static.org.dejava.component.exception.localized.unchecked.InvalidParameterException
- If a field/setter in the field path cannot be accessed or found. Or if the new value is
invalid.InvocationException
- If a setter in the field path for the field throws an exception.Copyright © 2013. All Rights Reserved.