ro.isdc.wro.model.group.processor
Class GroupExtractorDecorator

java.lang.Object
  extended by ro.isdc.wro.model.group.processor.GroupExtractorDecorator
All Implemented Interfaces:
GroupExtractor

public class GroupExtractorDecorator
extends Object
implements GroupExtractor

A simple decorator for GroupsProcessor.

Author:
Alex Objelean

Constructor Summary
GroupExtractorDecorator(GroupExtractor decorated)
          Decorates a GroupExtractor implementation.
 
Method Summary
 String encodeGroupUrl(String groupName, ResourceType resourceType, boolean minimize)
          This method is a opposite of the other 3 methods.
 String getGroupName(javax.servlet.http.HttpServletRequest request)
          Retrieves a set of group names from supplied uri.
 ResourceType getResourceType(javax.servlet.http.HttpServletRequest request)
          
 boolean isMinimized(javax.servlet.http.HttpServletRequest request)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupExtractorDecorator

public GroupExtractorDecorator(GroupExtractor decorated)
Decorates a GroupExtractor implementation.

Parameters:
decorated - GroupExtractor to decorate.
Method Detail

getGroupName

public String getGroupName(javax.servlet.http.HttpServletRequest request)
Retrieves a set of group names from supplied uri.

Specified by:
getGroupName in interface GroupExtractor
Parameters:
request - to check.
Returns:
found group name. If no group is found, null is returned.

getResourceType

public ResourceType getResourceType(javax.servlet.http.HttpServletRequest request)

Specified by:
getResourceType in interface GroupExtractor
Parameters:
request - to check.
Returns:
requested ResourceType.

isMinimized

public boolean isMinimized(javax.servlet.http.HttpServletRequest request)

Specified by:
isMinimized in interface GroupExtractor
Parameters:
request - HttpServletRequest object.
Returns:
true if the expected result must be minimized.

encodeGroupUrl

public String encodeGroupUrl(String groupName,
                             ResourceType resourceType,
                             boolean minimize)
This method is a opposite of the other 3 methods. Instead of decoding, it encodes groupName, resourceType and minimize option into url. It should not return entire url, but only the last part.

Specified by:
encodeGroupUrl in interface GroupExtractor
Returns:
a part of the url path which encodes the groupName, resourceType and minimize option.


Copyright © 2008-2013. All Rights Reserved.