org.milyn.delivery
Class ContentHandlerConfigMapTable<T extends ContentHandler>

java.lang.Object
  extended by org.milyn.delivery.ContentHandlerConfigMapTable<T>

public class ContentHandlerConfigMapTable<T extends ContentHandler>
extends Object

Simple table for storing ContentHandlerConfigMap lists against a selector string.

Author:
tom.fennelly@gmail.com

Constructor Summary
ContentHandlerConfigMapTable()
           
 
Method Summary
 void addAll(ContentHandlerConfigMapTable<T> configMap)
          Add all the content handlers defined in the supplied configMap.
 void addMapping(String elementName, SmooksResourceConfiguration resourceConfig, T contentHandler)
          Add a delivery unit mapping for the specified selector.
 int getCount()
          Get the total number of mappings on this table.
 List<ContentHandlerConfigMap<T>> getMappings(String selector)
          Get the ContentHandlerConfigMap list for the supplied selector string.
 List<ContentHandlerConfigMap<T>> getMappings(String[] selectors)
          Get the combined ContentHandlerConfigMap list for the supplied list of selector strings.
 Map<String,List<ContentHandlerConfigMap<T>>> getTable()
           
 boolean isEmpty()
          Is the table empty.
 void sort(Sorter.SortOrder sortOrder)
          Sort the Table in the specified sort order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentHandlerConfigMapTable

public ContentHandlerConfigMapTable()
Method Detail

addMapping

public void addMapping(String elementName,
                       SmooksResourceConfiguration resourceConfig,
                       T contentHandler)
Add a delivery unit mapping for the specified selector.

Parameters:
elementName - The target element for the content handler.
resourceConfig - Resource configuration.
contentHandler - The delivery unit.

addAll

public void addAll(ContentHandlerConfigMapTable<T> configMap)
Add all the content handlers defined in the supplied configMap.

Parameters:
configMap - The config map.

getTable

public Map<String,List<ContentHandlerConfigMap<T>>> getTable()

getMappings

public List<ContentHandlerConfigMap<T>> getMappings(String selector)
Get the ContentHandlerConfigMap list for the supplied selector string.

Parameters:
selector - The lookup selector.
Returns:
It's list of ContentHandlerConfigMap instances, or null if there are none.

getMappings

public List<ContentHandlerConfigMap<T>> getMappings(String[] selectors)
Get the combined ContentHandlerConfigMap list for the supplied list of selector strings.

Parameters:
selectors - The lookup selectors.
Returns:
The combined ContentHandlerConfigMap list for the supplied list of selector strings, or an empty list if there are none.

isEmpty

public boolean isEmpty()
Is the table empty.

Returns:
True if the table is empty, otherwise false.

getCount

public int getCount()
Get the total number of mappings on this table.

Returns:
The total number of mappings on this table.

sort

public void sort(Sorter.SortOrder sortOrder)
Sort the Table in the specified sort order.

Parameters:
sortOrder - The sort order.


Copyright © 2009. All Rights Reserved.