Package org.smooks.engine.delivery
Class ContentHandlerBindingIndex<T extends ContentHandler>
- java.lang.Object
-
- org.smooks.engine.delivery.ContentHandlerBindingIndex<T>
-
- All Implemented Interfaces:
Map<String,List<ContentHandlerBinding<T>>>
@NotThreadSafe public class ContentHandlerBindingIndex<T extends ContentHandler> extends Object implements Map<String,List<ContentHandlerBinding<T>>>
Simple table for storingContentHandlerBinding
lists against a selector string.- Author:
- tom.fennelly@gmail.com
-
-
Constructor Summary
Constructors Constructor Description ContentHandlerBindingIndex()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object selector)
boolean
containsValue(Object value)
Set<Map.Entry<String,List<ContentHandlerBinding<T>>>>
entrySet()
List<ContentHandlerBinding<T>>
get(Object selector)
Get theContentHandlerBinding
list for the supplied selector string.List<ContentHandlerBinding<T>>
get(String... selectors)
Get the combinedContentHandlerBinding
list for the supplied list of selector strings.boolean
isEmpty()
Is the table empty.Set<String>
keySet()
List<ContentHandlerBinding<T>>
put(String selector, List<ContentHandlerBinding<T>> contentHandlerBindings)
void
put(String selector, ContentHandlerBinding<T> contentHandlerBinding)
Add aContentHandlerBinding
for the specified selector.void
put(String selector, ResourceConfig resourceConfig, T contentHandler)
Add a delivery unit mapping for the specified selector.void
putAll(Map<? extends String,? extends List<ContentHandlerBinding<T>>> contentHandlerBindingIndex)
Add all the content handlers defined in the suppliedMap
.List<ContentHandlerBinding<T>>
remove(Object key)
int
size()
void
sort(Sorter.SortOrder sortOrder)
Sort the Table in the specified sort order.Collection<List<ContentHandlerBinding<T>>>
values()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
put
public void put(String selector, ResourceConfig resourceConfig, T contentHandler)
Add a delivery unit mapping for the specified selector.- Parameters:
selector
- The target element for the content handler.resourceConfig
- Resource configuration.contentHandler
- The delivery unit.
-
put
public void put(String selector, ContentHandlerBinding<T> contentHandlerBinding)
Add aContentHandlerBinding
for the specified selector.- Parameters:
selector
- The element name.contentHandlerBinding
- The mapping instance to be added.
-
get
public List<ContentHandlerBinding<T>> get(String... selectors)
Get the combinedContentHandlerBinding
list for the supplied list of selector strings.- Parameters:
selectors
- The lookup selectors.- Returns:
- The combined
ContentHandlerBinding
list for the supplied list of selector strings, or an empty list if there are none.
-
size
public int size()
- Specified by:
size
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
-
isEmpty
public boolean isEmpty()
Is the table empty.- Specified by:
isEmpty
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
- Returns:
- True if the table is empty, otherwise false.
-
containsKey
public boolean containsKey(Object selector)
- Specified by:
containsKey
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
-
get
public List<ContentHandlerBinding<T>> get(Object selector)
Get theContentHandlerBinding
list for the supplied selector string.- Specified by:
get
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
- Parameters:
selector
- The lookup selector.- Returns:
- It's list of
ContentHandlerBinding
instances, or null if there are none.
-
put
public List<ContentHandlerBinding<T>> put(String selector, List<ContentHandlerBinding<T>> contentHandlerBindings)
- Specified by:
put
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
-
remove
public List<ContentHandlerBinding<T>> remove(Object key)
- Specified by:
remove
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
-
putAll
public void putAll(Map<? extends String,? extends List<ContentHandlerBinding<T>>> contentHandlerBindingIndex)
Add all the content handlers defined in the suppliedMap
.- Specified by:
putAll
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
- Parameters:
contentHandlerBindingIndex
- The config map.
-
clear
public void clear()
- Specified by:
clear
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
-
keySet
public Set<String> keySet()
- Specified by:
keySet
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
-
values
public Collection<List<ContentHandlerBinding<T>>> values()
- Specified by:
values
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
-
entrySet
public Set<Map.Entry<String,List<ContentHandlerBinding<T>>>> entrySet()
- Specified by:
entrySet
in interfaceMap<String,List<ContentHandlerBinding<T extends ContentHandler>>>
-
sort
public void sort(Sorter.SortOrder sortOrder)
Sort the Table in the specified sort order.- Parameters:
sortOrder
- The sort order.
-
-