Class DefaultResourceConfigSeq
- java.lang.Object
-
- org.smooks.engine.resource.config.DefaultResourceConfigSeq
-
- All Implemented Interfaces:
Iterable<ResourceConfig>
,ResourceConfigSeq
public class DefaultResourceConfigSeq extends Object implements ResourceConfigSeq
ResourceConfig
list.- Author:
- tfennelly
-
-
Constructor Summary
Constructors Constructor Description DefaultResourceConfigSeq(String name)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ProfileSet profileSet)
Add aProfileSet
instance to this list.void
add(ResourceConfig resourceConfig)
Add aResourceConfig
instance to this list.void
addAll(ResourceConfigSeq resourceConfigSeq)
Add all theResourceConfig
instances in the specifiedResourceConfigSeq
to this list.ResourceConfig
get(int index)
Get theResourceConfig
instance at the specified index.List<ResourceConfig>
getAll()
List<ResourceConfig>
getAll(ProfileSet profileSet)
Get all ResourceConfig entries targeted at the specified profile set.String
getName()
Get the name of this list instance.List<ProfileSet>
getProfiles()
Get the list of profiles configured on this resource configuration list.boolean
isEmpty()
Is this list instance empty.boolean
isSystem()
Is this configuration list instance one of the system installed config lists.Iterator<ResourceConfig>
iterator()
List<ResourceConfig>
lookupResource(ConfigSearch searchCriteria)
Lookup a resource configuration from this config list.void
setSystem(boolean isSystem)
Set whether or not this configuration list instance is one of the system installed config lists.int
size()
Get the size of this list.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DefaultResourceConfigSeq
public DefaultResourceConfigSeq(String name)
Public constructor.- Parameters:
name
- The name of this instance.
-
-
Method Detail
-
add
public void add(ResourceConfig resourceConfig)
Add aResourceConfig
instance to this list.- Specified by:
add
in interfaceResourceConfigSeq
- Parameters:
resourceConfig
-ResourceConfig
instance to add.
-
addAll
public void addAll(ResourceConfigSeq resourceConfigSeq)
Add all theResourceConfig
instances in the specifiedResourceConfigSeq
to this list.- Specified by:
addAll
in interfaceResourceConfigSeq
- Parameters:
resourceConfigSeq
-ResourceConfigSeq
instance to add.
-
add
public void add(ProfileSet profileSet)
Add aProfileSet
instance to this list.- Specified by:
add
in interfaceResourceConfigSeq
- Parameters:
profileSet
-ProfileSet
instance to add.
-
getName
public String getName()
Get the name of this list instance.- Specified by:
getName
in interfaceResourceConfigSeq
- Returns:
- List name.
-
isSystem
public boolean isSystem()
Is this configuration list instance one of the system installed config lists.- Specified by:
isSystem
in interfaceResourceConfigSeq
- Returns:
- True if this configuration list instance one of the system installed config lists, otherwise false.
-
setSystem
public void setSystem(boolean isSystem)
Set whether or not this configuration list instance is one of the system installed config lists.- Specified by:
setSystem
in interfaceResourceConfigSeq
- Parameters:
isSystem
- True if this configuration list instance one of the system installed config lists, otherwise false.
-
isEmpty
public boolean isEmpty()
Is this list instance empty.- Specified by:
isEmpty
in interfaceResourceConfigSeq
- Returns:
- True if this list instance is empty, otherwise false.
-
size
public int size()
Get the size of this list.- Specified by:
size
in interfaceResourceConfigSeq
- Returns:
- The size of te list i.e. number of entries.
-
get
public ResourceConfig get(int index) throws ArrayIndexOutOfBoundsException
Get theResourceConfig
instance at the specified index.- Specified by:
get
in interfaceResourceConfigSeq
- Parameters:
index
- Resource index.- Returns:
- The
ResourceConfig
instance at the specified index. - Throws:
ArrayIndexOutOfBoundsException
- The specified index is out of bounds.
-
getAll
public List<ResourceConfig> getAll() throws ArrayIndexOutOfBoundsException
- Specified by:
getAll
in interfaceResourceConfigSeq
- Throws:
ArrayIndexOutOfBoundsException
-
getAll
public List<ResourceConfig> getAll(ProfileSet profileSet)
Get all ResourceConfig entries targeted at the specified profile set.- Specified by:
getAll
in interfaceResourceConfigSeq
- Parameters:
profileSet
- The profile set to searh against.- Returns:
- All ResourceConfig entries targeted at the specified profile set.
-
getProfiles
public List<ProfileSet> getProfiles()
Get the list of profiles configured on this resource configuration list.- Specified by:
getProfiles
in interfaceResourceConfigSeq
- Returns:
- List of profiles.
-
lookupResource
public List<ResourceConfig> lookupResource(ConfigSearch searchCriteria)
Lookup a resource configuration from this config list. Note that this is resource config order-dependent. It will not locate configs that have not yet been loaded.- Specified by:
lookupResource
in interfaceResourceConfigSeq
- Parameters:
searchCriteria
- The resource lookup criteria.- Returns:
- List of matches resources, or an empty List if no matches are found.
-
iterator
public Iterator<ResourceConfig> iterator()
- Specified by:
iterator
in interfaceIterable<ResourceConfig>
-
-