Class ResourceWebScriptHelper


  • public class ResourceWebScriptHelper
    extends java.lang.Object
    Helps a Webscript with various tasks
    Author:
    Gethin James, janv
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object processAdditionsToTheResponse​(org.springframework.extensions.webscripts.WebScriptResponse res, Api api, java.lang.String entityCollectionName, Params params, java.lang.Object objectToWrap)
      Looks at the object passed in and recursively expands any @EmbeddedEntityResource annotations or related relationship.
      void setExecutor​(ActionExecutor executor)  
      void setLocator​(ResourceLocator locator)  
      static void setUniqueId​(java.lang.Object theObj, java.lang.String uniqueId)
      Set the id of theObj to the uniqueId.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResourceWebScriptHelper

        public ResourceWebScriptHelper()
    • Method Detail

      • setUniqueId

        public static void setUniqueId​(java.lang.Object theObj,
                                       java.lang.String uniqueId)
        Set the id of theObj to the uniqueId. Attempts to find a set method and invoke it. If it fails it just swallows the exceptions and doesn't throw them further.
        Parameters:
        theObj - Object
        uniqueId - String
      • processAdditionsToTheResponse

        public java.lang.Object processAdditionsToTheResponse​(org.springframework.extensions.webscripts.WebScriptResponse res,
                                                              Api api,
                                                              java.lang.String entityCollectionName,
                                                              Params params,
                                                              java.lang.Object objectToWrap)
        Looks at the object passed in and recursively expands any @EmbeddedEntityResource annotations or related relationship. EmbeddedEntityResource is expanded by calling the ReadById method for this entity. Either returns a ExecutionResult object or a CollectionWithPagingInfo containing a collection of ExecutionResult objects.
        Parameters:
        api - Api
        entityCollectionName - String
        params - Params
        objectToWrap - Object
        Returns:
        Object - Either ExecutionResult or CollectionWithPagingInfo