public class NestedAttributeUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FAIL_TO_FIND_COLLECTION_ITEM |
static java.lang.String |
GETTER |
| Constructor and Description |
|---|
NestedAttributeUtils() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getArrayItem(java.lang.Object object,
java.lang.String propertyName)
Retreives a collection item at a specified index.
|
java.lang.String |
getNameOfClassWithoutModel(java.lang.Object object)
Obtain the name of the class that the object belongs to, but without the "Model" at the end.
|
java.lang.Object |
getNestedObject(java.lang.Object object,
java.lang.String propertyName)
Retrieve the instance of an attribute of an object.
|
java.lang.Object |
invokePropertyAsMethod(java.lang.Object object,
java.lang.String propertyName)
Converts a property to a getter.
|
java.lang.String |
propertyNameToGetter(java.lang.String propertyName)
Convert a string representing an attribute name to the name of a getter method.
|
java.util.List<java.lang.String> |
splitQualifier(java.lang.String qualifier)
Splits a qualifier for a nested attribute (ex.
|
public static final java.lang.String GETTER
public static final java.lang.String FAIL_TO_FIND_COLLECTION_ITEM
public java.lang.String propertyNameToGetter(java.lang.String propertyName)
public java.util.List<java.lang.String> splitQualifier(java.lang.String qualifier)
public java.lang.Object getNestedObject(java.lang.Object object,
java.lang.String propertyName)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException,
InvalidNestedAttributeException
java.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodExceptionInvalidNestedAttributeExceptionpublic java.lang.String getNameOfClassWithoutModel(java.lang.Object object)
public java.lang.Object getArrayItem(java.lang.Object object,
java.lang.String propertyName)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException,
InvalidNestedAttributeException
object - Object containing the collection.propertyName - Collection item with this format: collection[i]java.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodExceptionInvalidNestedAttributeExceptionpublic java.lang.Object invokePropertyAsMethod(java.lang.Object object,
java.lang.String propertyName)
throws java.lang.NoSuchMethodException,
java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException
object - Object to invoke the method on.propertyName - Property to invoke as method.java.lang.NoSuchMethodExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessExceptionCopyright © 2018 SAP SE. All Rights Reserved.