com.sourceforge.jpatterns.core.configuration.model
Class JPatternsConfigBaseBean

java.lang.Object
  extended by com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBean
All Implemented Interfaces:
com.zmicer.utils.model.ICheckable, Serializable
Direct Known Subclasses:
JPatternsConfigBean, JPatternsConfigsBean

public class JPatternsConfigBaseBean
extends Object
implements com.zmicer.utils.model.ICheckable

This base class defines the fields are necessary for the defining the context of one/any combination of JPatternsConfig castor objects. Also it contains the utility methods could be used for the forming this fields (all of them are collections) with the appropriate information.
Currently there are two types of the storages: sections and business items. Both of them are necessary for us as they could be use for the differenty purposes. E.g. A. the logically separate global configuration item (we would use the business items storage) and B. factory configuration is represented as storage - in this case for the retrieving the "factory" pattern we would find the appropriate section based castor object, and then the concrete implementation of the factory would retrieve the business items.
The fields are introduced here could be extended (or modified) in the case the structure of the JPatternsConfig castor object would be changed (and we would need another storages for the configuration).

note [zmicer]: be noticed some additional infrustructure methods may be required here. note [zmicer]: class is not done as abstract to allow the convenient testing. Also there is possibility it could be used as is somewhere. $Author:: zmicer $
$Rev:: 67 $
$Date:: 2007-08-28 21:37:07 #$

See Also:
Serialized Form

Field Summary
static org.apache.log4j.Logger LOG
          Logger instance.
 
Constructor Summary
JPatternsConfigBaseBean()
          Default public constructor.
 
Method Summary
 boolean check()
           
 com.sourceforge.jpatterns.schema.CastorNameScopePriorityType getBusinessItem(String sectionScope, String sectionName, String itemScope, String itemName)
          Get the business item - the instance of the CastorNameScopePriorityType class.
 Map<String,Map<String,Map<String,Map<String,com.sourceforge.jpatterns.schema.CastorNameScopePriorityType>>>> getBusinessItems()
          Tested here com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBeanTest#testSetGetBusinessItems()
 List<com.sourceforge.jpatterns.schema.CastorSectionType> getListOfSectionItems()
           
 com.sourceforge.jpatterns.schema.CastorSectionType getSection(String scope, String sectionName)
          Get the section type castor object by the pointed path (basing on the scope/section name string)
 Map<String,Map<String,com.sourceforge.jpatterns.schema.CastorSectionType>> getSectionItems()
          Tested here: com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBeanTest#testSetGetSectionItems()
 void setBusinessItem(String sectionScope, String sectionName, com.sourceforge.jpatterns.schema.CastorNameScopePriorityType item)
          Set the provided business item using the provided path.
 void setBusinessItems(Map<String,Map<String,Map<String,Map<String,com.sourceforge.jpatterns.schema.CastorNameScopePriorityType>>>> businessItems)
          Set the new value for the business items.
 void setSection(String scope, com.sourceforge.jpatterns.schema.CastorSectionType section)
          Set the pointed section CastorSectionType castor object to the map is used for this purposes.
 void setSectionItems(Map<String,Map<String,com.sourceforge.jpatterns.schema.CastorSectionType>> sectionItems)
          Set the new value for the section items
Tested here: com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBeanTest#testSetGetSectionItems()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Logger instance.

Constructor Detail

JPatternsConfigBaseBean

public JPatternsConfigBaseBean()
Default public constructor.
Is tested at the setup method

Method Detail

setBusinessItems

public void setBusinessItems(Map<String,Map<String,Map<String,Map<String,com.sourceforge.jpatterns.schema.CastorNameScopePriorityType>>>> businessItems)
Set the new value for the business items.
Tested here com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBeanTest#testSetGetBusinessItems()

Parameters:
businessItems - the new value for the business items storage. Can not be null (otherwise IllegalArgumentException would appear).

getBusinessItems

public Map<String,Map<String,Map<String,Map<String,com.sourceforge.jpatterns.schema.CastorNameScopePriorityType>>>> getBusinessItems()
Tested here com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBeanTest#testSetGetBusinessItems()

Returns:
the business items storage

setSectionItems

public void setSectionItems(Map<String,Map<String,com.sourceforge.jpatterns.schema.CastorSectionType>> sectionItems)
Set the new value for the section items
Tested here: com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBeanTest#testSetGetSectionItems()

Parameters:
sectionItems - the section items storage Can not be null (otherwise IllegalArgumentException would appear).

getSectionItems

public Map<String,Map<String,com.sourceforge.jpatterns.schema.CastorSectionType>> getSectionItems()
Tested here: com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBeanTest#testSetGetSectionItems()

Returns:
the section items storage

getListOfSectionItems

public List<com.sourceforge.jpatterns.schema.CastorSectionType> getListOfSectionItems()
Returns:
another representation of the section items - the List of the CastorSectionType objects.

check

public boolean check()
Specified by:
check in interface com.zmicer.utils.model.ICheckable
See Also:
ICheckable.check()

getBusinessItem

public com.sourceforge.jpatterns.schema.CastorNameScopePriorityType getBusinessItem(String sectionScope,
                                                                                    String sectionName,
                                                                                    String itemScope,
                                                                                    String itemName)
Get the business item - the instance of the CastorNameScopePriorityType class.
Tested here: com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBeanTest#testSetGetBusinessItem()

Parameters:
sectionScope - section scope id. Can not be null (otherwise IllegalArgumentException would appear).
sectionName - section name. Can not be null (otherwise IllegalArgumentException would appear).
itemScope - item scope. Can not be null (otherwise IllegalArgumentException would appear).
itemName - business item name. Can not be null (otherwise IllegalArgumentException would appear).
Returns:
the appropriate CastorNameScopePriorityType castor object or the null in the case the provided path (these three keys) do not point to the real castor object.

setBusinessItem

public void setBusinessItem(String sectionScope,
                            String sectionName,
                            com.sourceforge.jpatterns.schema.CastorNameScopePriorityType item)
Set the provided business item using the provided path. In the case some parts of the path are not constructed yet - they would be constructed (new maps would be created). In the case another business items has been already stored under the same path - it would be replaced by this one.
tested here:com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBaseBeanTest#testSetGetBusinessItem()

Parameters:
sectionScope - sectionScope name. Can not be null (otherwise IllegalArgumentException would appear).
sectionName - section name. Can not be null (otherwise IllegalArgumentException would appear).
item - the castor object to be stored. Can not be null (otherwise IllegalArgumentException would appear). The item name would be get from this bean too, so item.getName() should not return null or empty String (IllegalArgumentException would appear in this wrong case)

getSection

public com.sourceforge.jpatterns.schema.CastorSectionType getSection(String scope,
                                                                     String sectionName)
Get the section type castor object by the pointed path (basing on the scope/section name string)

Parameters:
scope - the scope name. Can not be null (otherwise IllegalArgumentException would appear).
sectionName - the section name. Can not be null (otherwise IllegalArgumentException would appear).
Returns:
the CastorSectionType castor object in the case of success or null otherwise..

setSection

public void setSection(String scope,
                       com.sourceforge.jpatterns.schema.CastorSectionType section)
Set the pointed section CastorSectionType castor object to the map is used for this purposes.

Parameters:
scope - the name of the scope the provided CastorSectionType castor object should belong. Can not be null (otherwise IllegalArgumentException would appear).
section - CastorSectionType castor object which is based for all the "section based" JPatterns configurations items


Copyright © 2007 jzmicer.team. All Rights Reserved.