|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sourceforge.jpatterns.core.configuration.model.JPatternsConfigBeansBuilderImpl
public class JPatternsConfigBeansBuilderImpl
Default, "native" implementation of the appropriate interface.
$Author:: zmicer $
$Rev:: 67 $
* $Date:: 2007-08-28 21:37:07 #$
$Date:: 2007-08-28 21:37:07 #$
Field Summary | |
---|---|
static org.apache.log4j.Logger |
LOG
Logger instance. |
Constructor Summary | |
---|---|
JPatternsConfigBeansBuilderImpl()
|
Method Summary | |
---|---|
JPatternsConfigBean |
build(com.sourceforge.jpatterns.schema.JPatternsConfig config)
Build the JPatternsConfigBaseBean using the provided JPatternsConfig object. |
JPatternsConfigsBean |
build(List<JPatternsConfigBaseBean> beans)
Build as JPatternsConfigsBean using the List of JPatternsConfigBean objects
Please be noticed this method could be used for the prioritized building. |
protected com.sourceforge.jpatterns.schema.CastorNameScopePriorityType |
choiceOrMergeCastorNameScopePriorityTypes(com.sourceforge.jpatterns.schema.CastorNameScopePriorityType castor1,
com.sourceforge.jpatterns.schema.CastorNameScopePriorityType castor2)
Choice one of the given CastorNameScopePriorityType castor objects or perform the merging if it is necessary. |
protected void |
fill(JPatternsConfigBaseBean initialBaseBean,
List<com.sourceforge.jpatterns.schema.CastorSectionType> sections)
Please review the Java Docs to the method fill
todo [zmicer]: adjust Java Doc
todo [zmicer]: think if this method could be moved to interface of the builder too |
protected static boolean |
getOverrideNotDependingOnPriority()
|
protected static String |
getOverridingDepth()
|
protected static void |
setOverrideNotDependingOnPriority(boolean value)
Set the OverrideNotDependingOnPriority static field with the new value. |
protected static void |
setOverridingDepth(String depth)
Set the overriding depth. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger LOG
Constructor Detail |
---|
public JPatternsConfigBeansBuilderImpl()
Method Detail |
---|
public JPatternsConfigBean build(com.sourceforge.jpatterns.schema.JPatternsConfig config)
IJPatternsConfigBeansBuilder
JPatternsConfigBaseBean
using the provided JPatternsConfig
object.
build
in interface IJPatternsConfigBeansBuilder
config
- JPatternsConfig castor object. Not normalized castor config object should be passed here\
(CastorUtils.validateAndNormalizeScopesPriorities(com.sourceforge.jpatterns.schema.JPatternsConfig)
).
Can not be null (otherwise IllegalArgumentException
would appear).
JPatternsConfig
castor root object.
The algorithm is used here as follows:
Sections filling:
1. the List of "section based" objects is formed
- in the case the section has not explicit scope - the default one from the root castor object or the
{@link com.sourceforge.jpatterns.core.JPConstants.DEFAULT_SCOPE_NAME} is set.
2. all the "section based" objects are put to the map
- in the case {@link com.sourceforge.jpatterns.core.configuration.PropertiesProvider.JPProperties.XML_CONFIG_OVERRIDING_DEPTH}
property equals to
com.sourceforge.jpatterns.core.configuration.PropertiesProvider.OverridingDepths.OVERRIDING_LEVEL_ITEM
then in the case
of two identical sections (scopes, section name and priority), they would be merged to the one by joining the appropriate business
items. If there are identical business items (scopes, name and priority) - the
com.sourceforge.jpatterns.core.configuration.exceptions.JPInitializationException
exception would appear
- in the case {@link com.sourceforge.jpatterns.core.configuration.PropertiesProvider.JPProperties.XML_CONFIG_OVERRIDING_DEPTH}
property equals to
com.sourceforge.jpatterns.core.configuration.PropertiesProvider.OverridingDepths.OVERRIDING_LEVEL_SECTION
then in the
case of two identical sections (scopes, section name and priority)
com.sourceforge.jpatterns.core.configuration.exceptions.JPConfigException
exception would appear
- in the case of the identical pathes but different priorities they would be taken into consideration (in this case
com.sourceforge.jpatterns.core.configuration.PropertiesProvider.JPProperties.XML_CONFIG_CUSTOM_OVERRIDES_NOT_DEPENDING_ON_PRIORITY
would be considered too).
Business items filling:
todo [zmicer]: <>
note [zmicer]: please be noticed the Section with the certain scope is allowed to store the business items with different scopes
public JPatternsConfigsBean build(List<JPatternsConfigBaseBean> beans)
IJPatternsConfigBeansBuilder
JPatternsConfigsBean
using the List of JPatternsConfigBean
objects
CastorUtils.makePrioritized(com.sourceforge.jpatterns.schema.JPatternsConfig)
method)
build
in interface IJPatternsConfigBeansBuilder
beans
- the List of JPatternsConfigBean objects, Can not be null (otherwise IllegalArgumentException
would appear).
Should be built using normalized configs.
JPatternsConfigsBean
, in the case of empty beans
just initial version of this bean
would returned.IJPatternsConfigBeansBuilder.build(com.sourceforge.jpatterns.schema.JPatternsConfig)
protected void fill(JPatternsConfigBaseBean initialBaseBean, List<com.sourceforge.jpatterns.schema.CastorSectionType> sections)
fill
todo [zmicer]: adjust Java Doc
todo [zmicer]: think if this method could be moved to interface of the builder too
initialBaseBean
- the initial bean to fill.
Can not be null (otherwise IllegalArgumentException
would appear).sections
- the List of the CastorSectionType objects. They should be normalized in the sense of scopes and priorities(for
details study
CastorUtils.validateAndNormalizeScopesPriorities(JPatternsConfig)
).
Can not be null (otherwise IllegalArgumentException
would appear).protected com.sourceforge.jpatterns.schema.CastorNameScopePriorityType choiceOrMergeCastorNameScopePriorityTypes(com.sourceforge.jpatterns.schema.CastorNameScopePriorityType castor1, com.sourceforge.jpatterns.schema.CastorNameScopePriorityType castor2)
fill
method to understand how it works (depending on the mentioned properties etc.)
castor1
- the first object, Can not be null (otherwise IllegalArgumentException
would appear).castor2
- the second object, Can not be null (otherwise IllegalArgumentException
would appear).
protected static void setOverridingDepth(String depth)
depth
- the value we ned to set, Can not be null (otherwise IllegalArgumentException
would appear).protected static String getOverridingDepth()
protected static void setOverrideNotDependingOnPriority(boolean value)
value
- new boolean valueprotected static boolean getOverrideNotDependingOnPriority()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |