Class NestedAttributeUtils
java.lang.Object
de.hybris.platform.omsbackoffice.renderers.NestedAttributeUtils
Contains common methods to the various nested attribute renderers.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetArrayItem(Object object, String propertyName) Retreives a collection item at a specified index.getNameOfClassWithoutModel(Object object) Obtain the name of the class that the object belongs to, but without the "Model" at the end.getNestedObject(Object object, String propertyName) Retrieve the instance of an attribute of an object.invokePropertyAsMethod(Object object, String propertyName) Converts a property to a getter.propertyNameToGetter(String propertyName) Convert a string representing an attribute name to the name of a getter method.splitQualifier(String qualifier) Splits a qualifier for a nested attribute (ex.
-
Field Details
-
GETTER
- See Also:
-
FAIL_TO_FIND_COLLECTION_ITEM
- See Also:
-
-
Constructor Details
-
NestedAttributeUtils
public NestedAttributeUtils()
-
-
Method Details
-
propertyNameToGetter
Convert a string representing an attribute name to the name of a getter method. -
splitQualifier
Splits a qualifier for a nested attribute (ex. product.name) into a map to retrieve the two tokens. -
getNestedObject
public Object getNestedObject(Object object, String propertyName) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, InvalidNestedAttributeException Retrieve the instance of an attribute of an object. -
getNameOfClassWithoutModel
Obtain the name of the class that the object belongs to, but without the "Model" at the end. -
getArrayItem
public Object getArrayItem(Object object, String propertyName) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, InvalidNestedAttributeException Retreives a collection item at a specified index.- Parameters:
object- Object containing the collection.propertyName- Collection item with this format: collection[i]- Returns:
- object at specified index.
- Throws:
IllegalAccessExceptionInvocationTargetExceptionNoSuchMethodExceptionInvalidNestedAttributeException
-
invokePropertyAsMethod
public Object invokePropertyAsMethod(Object object, String propertyName) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException Converts a property to a getter. Invokes it as a method on the passed object.- Parameters:
object- Object to invoke the method on.propertyName- Property to invoke as method.- Returns:
- Result of the method invocation
- Throws:
NoSuchMethodExceptionInvocationTargetExceptionIllegalAccessException
-