Annotation Type ChildOf


  • @Target(METHOD)
    @Retention(RUNTIME)
    public @interface ChildOf
    Marks a method as one which locates a child of a parent with a given name. This will be used in preference to ChildrenOf for locating single items. If not present Milton will iterate over the list of children.

    Optionally, ChildOf methods may be marked as user locator methods by setting the isUser property of the annotation to true. If this is done then the method will be used for authentication, and the returned object will be used to derive an Access Control List which will be used for authorization.

    Note that to perform authentication you MUST use a ChildOf method, you cannot use a ChildrenOf method

    The method must:

    • return a single object. This must be the same object as would be returned in a corresponding ChildrenOf object (ie both may be called in a single request)
    • the first argument must be the hierarchical parent of these objects
    • the second argument must be the name of the resource
    Eg
     @ChildOf
     public User findUser(UsersHome homeFolder, String userId) {
        return UserDao.findUser(userId);
     }
     
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String pathSuffix
      Will only match on paths which end with the given suffix.
    • Element Detail

      • pathSuffix

        String pathSuffix
        Will only match on paths which end with the given suffix. Default is empty string so will always match
        Returns:
        Default:
        ""