|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sourceforge.jpatterns.utils.CastorUtils
public class CastorUtils
This class contains the castor utils related to the JPatterns project (appropriate project specific model is used here).
$Author:: zmicer $
Field Summary | |
---|---|
protected static String |
GROUP_ITEM_CLASS_NAME
Base name of the class to be used. |
static org.apache.log4j.Logger |
LOG
Logger instance. |
Constructor Summary | |
---|---|
CastorUtils()
|
Method Summary | |
---|---|
static void |
addConfig(com.sourceforge.jpatterns.schema.JPatternsConfig config,
com.sourceforge.jpatterns.schema.Config configItem)
Add the instance of Config type to the provided JPatternsConfig root config object |
static void |
addFactory(com.sourceforge.jpatterns.schema.JPatternsConfig config,
com.sourceforge.jpatterns.schema.Factory factoryItem)
Add the instance of Config type to the provided JPatternsConfig root config object |
static com.sourceforge.jpatterns.schema.CastorGroupTypeItem |
constructGroupItem(com.sourceforge.jpatterns.schema.CastorNameScopePriorityType object)
Construct the CastorGroupTypeItem (choice object) using the provided Object. |
static List<com.sourceforge.jpatterns.schema.CastorNameScopePriorityType> |
extractCastorNameScopePriorityTypeObjects(com.sourceforge.jpatterns.schema.CastorSectionType sectionType)
Extract all the possible CastorNameScopePriorityType castor objects from the provided CastorSectionType. |
static List<com.sourceforge.jpatterns.schema.CastorSectionType> |
extractCastorSectionTypeObjects(com.sourceforge.jpatterns.schema.JPatternsConfig config)
Stores and retrive all the objects of CastorSectionType (it means all the objects of this type and also child of this type). |
static List<com.sourceforge.jpatterns.schema.Config> |
getConfig(com.sourceforge.jpatterns.schema.JPatternsConfig config)
Get the List of Config castor objects by the root JPatterns configuration object. |
static List<com.sourceforge.jpatterns.schema.Factory> |
getFactory(com.sourceforge.jpatterns.schema.JPatternsConfig config)
Get the List of Factory castor objects by the root JPatterns configuration object. |
static com.sourceforge.jpatterns.schema.JPatternsConfig |
getJPatternsConfig(File file)
Get JPatternsConfig using the provided file. |
static int |
getPriority(com.sourceforge.jpatterns.schema.CastorNameScopePriorityType castor)
Get the int representation of the priority. |
static void |
makePrioritized(com.sourceforge.jpatterns.schema.JPatternsConfig castorConfig)
All the items of the provided JPatternsConfig - sections, business items - are made prioritized. |
static void |
makePrioritized(JPatternsConfigBaseBean bean)
Make prioritized the provided bean. |
protected static void |
setValidatePriority(com.sourceforge.jpatterns.schema.CastorNameScopePriorityType castor,
boolean makePrioritized)
Set new / validate (is any) the priority field of the given castor object. |
static String |
toString(com.sourceforge.jpatterns.schema.CastorSectionType section,
com.sourceforge.jpatterns.schema.CastorNameScopePriorityType item)
Get the String representation of the Item in the format we need (the full path would be provided). |
static void |
validateAndNormalizeScopesPriorities(com.sourceforge.jpatterns.schema.JPatternsConfig config)
Make the scopes of all the elements here normalized. |
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
protected static final String GROUP_ITEM_CLASS_NAME
Constructor Detail |
---|
public CastorUtils()
Method Detail |
---|
public static com.sourceforge.jpatterns.schema.JPatternsConfig getJPatternsConfig(File file)
JPatternsConfig
using the provided file.
file
- File using which we need to obtain JPatternsConfig
Can not be null (otherwise IllegalArgumentException
would appear), also should point to the existed file
(otherwise IllegalArgumentException
would appear).
JPatternsConfig
. In the case of the failure it returns null
$Rev:: 67 $
* $Date:: 2007-08-28 21:37:07 #$
public static List<com.sourceforge.jpatterns.schema.CastorSectionType> extractCastorSectionTypeObjects(com.sourceforge.jpatterns.schema.JPatternsConfig config)
config
- JPatternsConfig object to be parsed. Can not be null (otherwise IllegalArgumentException
would appear).
CastorSectionType
objects, could be empty List returned in the case the provided config doesn't store
the necessary objects
$Rev:: 67 $public static List<com.sourceforge.jpatterns.schema.CastorNameScopePriorityType> extractCastorNameScopePriorityTypeObjects(com.sourceforge.jpatterns.schema.CastorSectionType sectionType)
sectionType
- the section type to be analyzed. Can not be null (otherwise IllegalArgumentException
would appear).
CastorNameScopePriorityType
objects.
$Rev:: 67 $public static void validateAndNormalizeScopesPriorities(com.sourceforge.jpatterns.schema.JPatternsConfig config)
com.sourceforge.jpatterns.core.JPConstants.DEFAULT_SCOPE_NAME
config
- castor root config objects to be processed.
Can not be null (otherwise IllegalArgumentException
would appear).public static void makePrioritized(com.sourceforge.jpatterns.schema.JPatternsConfig castorConfig)
JPatternsConfig
- sections, business items - are made prioritized. For this
com.sourceforge.jpatterns.core.JPConstants.PRIORITIZED_PRIOTITY_PREFIX
would be added as the prefix to all the
priorities. Then later, during the prioritized merging this items would have priority over the identical, but without this prefix.
castorConfig
- the target JPatternsConfig root castor object objects of which should be modified (their priorities)
Can not be null (otherwise IllegalArgumentException
would appear).
$Rev:: 67 $public static void makePrioritized(JPatternsConfigBaseBean bean)
bean
- the instance to be prioritized.
$Rev:: 67 $protected static void setValidatePriority(com.sourceforge.jpatterns.schema.CastorNameScopePriorityType castor, boolean makePrioritized)
castor
- CastorNameScopePriorityType instance. Can not be null (otherwise IllegalArgumentException
would appear).makePrioritized
- signs if we need to make the priority prioritized (using JPConstants.PRIORITIZED_PRIOTITY_PREFIX)
$Rev:: 67 $public static int getPriority(com.sourceforge.jpatterns.schema.CastorNameScopePriorityType castor)
castor
- castor object storing the priority to be used.
Can not be null (otherwise IllegalArgumentException
would appear).
public static List<com.sourceforge.jpatterns.schema.Config> getConfig(com.sourceforge.jpatterns.schema.JPatternsConfig config)
Config
castor objects by the root JPatterns configuration object. It is necessary for the convinient
opering with the Config object.
config
- the JPatternsConfig
root castor config objects,
Can not be null (otherwise IllegalArgumentException
would appear).
public static List<com.sourceforge.jpatterns.schema.Factory> getFactory(com.sourceforge.jpatterns.schema.JPatternsConfig config)
Factory
castor objects by the root JPatterns configuration object. It is necessary for the convinient
opering with the Factory object.
config
- the JPatternsConfig
root castor config objects,
Can not be null (otherwise IllegalArgumentException
would appear).
public static void addConfig(com.sourceforge.jpatterns.schema.JPatternsConfig config, com.sourceforge.jpatterns.schema.Config configItem)
Config
type to the provided JPatternsConfig root config object
config
- JPatternsConfig, Can not be null (otherwise IllegalArgumentException
would appear).configItem
- Config castor object. Can not be null (otherwise IllegalArgumentException
would appear).
$Rev:: 67 $public static void addFactory(com.sourceforge.jpatterns.schema.JPatternsConfig config, com.sourceforge.jpatterns.schema.Factory factoryItem)
Config
type to the provided JPatternsConfig root config object
config
- JPatternsConfig, Can not be null (otherwise IllegalArgumentException
would appear).factoryItem
- Factory castor object. Can not be null (otherwise IllegalArgumentException
would appear).
$Rev:: 67 $public static com.sourceforge.jpatterns.schema.CastorGroupTypeItem constructGroupItem(com.sourceforge.jpatterns.schema.CastorNameScopePriorityType object)
object
- CastorNameScopePriorityType instance, can not be null, CastorGroupTypeItem should have appropriate method
set***, where *** - the base name of the provided object. Otherwise IllegalArgumentException would appeared
public static String toString(com.sourceforge.jpatterns.schema.CastorSectionType section, com.sourceforge.jpatterns.schema.CastorNameScopePriorityType item)
section
- the Section object for which we need to get the full representation in the format we need
Could be null, in this case information about the section is displayeditem
- Item castor object. Can not be null (otherwise IllegalArgumentException
would appear).
Can not be null (otherwise IllegalArgumentException
would appear).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |