org.jomc.model.modlet
Class DefaultModelProvider

Package class diagram package DefaultModelProvider
java.lang.Object
  extended by org.jomc.model.modlet.DefaultModelProvider
All Implemented Interfaces:
ModelProvider

public class DefaultModelProvider
extends Object
implements ModelProvider

Default object management and configuration ModelProvider implementation.

Version:
$JOMC: DefaultModelProvider.java 4201 2012-01-25 09:47:12Z schulte2005 $
Author:
Christian Schulte
See Also:
ModelContext.findModel(java.lang.String)

Field Summary
static String ENABLED_ATTRIBUTE_NAME
          Constant for the name of the model context attribute backing property enabled.
static String MODULE_LOCATION_ATTRIBUTE_NAME
          Constant for the name of the model context attribute backing property moduleLocation.
static String VALIDATING_ATTRIBUTE_NAME
          Constant for the name of the model context attribute backing property validating.
 
Constructor Summary
DefaultModelProvider()
          Creates a new DefaultModelProvider instance.
 
Method Summary
 Model findModel(ModelContext context, Model model)
          
 Modules findModules(ModelContext context, String model, String location)
          Searches a given context for modules.
static String getDefaultModuleLocation()
          Gets the default location searched for module resources.
 String getModuleLocation()
          Gets the location searched for module resources.
static boolean isDefaultEnabled()
          Gets a flag indicating the provider is enabled by default.
static boolean isDefaultValidating()
          Gets a flag indicating the provider is validating resources by default.
 boolean isEnabled()
          Gets a flag indicating the provider is enabled.
 boolean isValidating()
          Gets a flag indicating the provider is validating resources.
static void setDefaultEnabled(Boolean value)
          Sets the flag indicating the provider is enabled by default.
static void setDefaultModuleLocation(String value)
          Sets the default location searched for module resources.
static void setDefaultValidating(Boolean value)
          Sets the flag indicating the provider is validating resources by default.
 void setEnabled(Boolean value)
          Sets the flag indicating the provider is enabled.
 void setModuleLocation(String value)
          Sets the location searched for module resources.
 void setValidating(Boolean value)
          Sets the flag indicating the provider is validating resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENABLED_ATTRIBUTE_NAME

public static final String ENABLED_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property enabled.

Since:
1.2
See Also:
findModel(org.jomc.modlet.ModelContext, org.jomc.modlet.Model), ModelContext.getAttribute(java.lang.String), Constant Field Values

MODULE_LOCATION_ATTRIBUTE_NAME

public static final String MODULE_LOCATION_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property moduleLocation.

Since:
1.2
See Also:
findModel(org.jomc.modlet.ModelContext, org.jomc.modlet.Model), ModelContext.getAttribute(java.lang.String), Constant Field Values

VALIDATING_ATTRIBUTE_NAME

public static final String VALIDATING_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property validating.

Since:
1.2
See Also:
findModules(org.jomc.modlet.ModelContext, java.lang.String, java.lang.String), ModelContext.getAttribute(java.lang.String), Constant Field Values
Constructor Detail

DefaultModelProvider

public DefaultModelProvider()
Creates a new DefaultModelProvider instance.

Method Detail

isDefaultEnabled

public static boolean isDefaultEnabled()
Gets a flag indicating the provider is enabled by default.

The default enabled flag is controlled by system property org.jomc.model.modlet.DefaultModelProvider.defaultEnabled holding a value indicating the provider is enabled by default. If that property is not set, the true default is returned.

Returns:
true, if the provider is enabled by default; false, if the provider is disabled by default.
See Also:
setDefaultEnabled(java.lang.Boolean)

setDefaultEnabled

public static void setDefaultEnabled(Boolean value)
Sets the flag indicating the provider is enabled by default.

Parameters:
value - The new value of the flag indicating the provider is enabled by default or null.
See Also:
isDefaultEnabled()

isEnabled

public final boolean isEnabled()
Gets a flag indicating the provider is enabled.

Returns:
true, if the provider is enabled; false, if the provider is disabled.
See Also:
isDefaultEnabled(), setEnabled(java.lang.Boolean)

setEnabled

public final void setEnabled(Boolean value)
Sets the flag indicating the provider is enabled.

Parameters:
value - The new value of the flag indicating the provider is enabled or null.
See Also:
isEnabled()

getDefaultModuleLocation

public static String getDefaultModuleLocation()
Gets the default location searched for module resources.

The default module location is controlled by system property org.jomc.model.modlet.DefaultModelProvider.defaultModuleLocation holding the location to search for module resources by default. If that property is not set, the META-INF/jomc.xml default is returned.

Returns:
The location searched for module resources by default.
See Also:
setDefaultModuleLocation(java.lang.String)

setDefaultModuleLocation

public static void setDefaultModuleLocation(String value)
Sets the default location searched for module resources.

Parameters:
value - The new default location to search for module resources or null.
See Also:
getDefaultModuleLocation()

getModuleLocation

public final String getModuleLocation()
Gets the location searched for module resources.

Returns:
The location searched for module resources.
See Also:
getDefaultModuleLocation(), setModuleLocation(java.lang.String)

setModuleLocation

public final void setModuleLocation(String value)
Sets the location searched for module resources.

Parameters:
value - The new location to search for module resources or null.
See Also:
getModuleLocation()

isDefaultValidating

public static boolean isDefaultValidating()
Gets a flag indicating the provider is validating resources by default.

The default validating flag is controlled by system property org.jomc.model.modlet.DefaultModelProvider.defaultValidating holding a value indicating the provider is validating resources by default. If that property is not set, the true default is returned.

Returns:
true, if the provider is validating resources by default; false, if the provider is not validating resources by default.
Since:
1.2
See Also:
isValidating(), setDefaultValidating(java.lang.Boolean)

setDefaultValidating

public static void setDefaultValidating(Boolean value)
Sets the flag indicating the provider is validating resources by default.

Parameters:
value - The new value of the flag indicating the provider is validating resources by default or null.
Since:
1.2
See Also:
isDefaultValidating()

isValidating

public final boolean isValidating()
Gets a flag indicating the provider is validating resources.

Returns:
true, if the provider is validating resources; false, if the provider is not validating resources.
Since:
1.2
See Also:
isDefaultValidating(), setValidating(java.lang.Boolean)

setValidating

public final void setValidating(Boolean value)
Sets the flag indicating the provider is validating resources.

Parameters:
value - The new value of the flag indicating the provider is validating resources or null.
Since:
1.2
See Also:
isValidating()

findModules

public Modules findModules(ModelContext context,
                           String model,
                           String location)
                    throws ModelException
Searches a given context for modules.

Parameters:
context - The context to search for modules.
model - The identifier of the model to search for modules.
location - The location to search at.
Returns:
The modules found at location in context or null, if no modules are found.
Throws:
NullPointerException - if context, model or location is null.
ModelException - if searching the context fails.
See Also:
isValidating(), VALIDATING_ATTRIBUTE_NAME

findModel

public Model findModel(ModelContext context,
                       Model model)
                throws ModelException

Specified by:
findModel in interface ModelProvider
Returns:
The Model found in the context or null, if no Model is found or the provider is disabled.
Throws:
ModelException
See Also:
isEnabled(), getModuleLocation(), findModules(org.jomc.modlet.ModelContext, java.lang.String, java.lang.String), ENABLED_ATTRIBUTE_NAME, MODULE_LOCATION_ATTRIBUTE_NAME


Copyright © 2005-2012 The JOMC Project. All Rights Reserved.Get JOMC at SourceForge.net. Fast, secure and Free Open Source software downloads
Please note that this documentation is maintained by non-native english speaking authors. As such, you may encounter phrases or wordings which seem imprecise or may even have a totally different meaning to native english speaking readers than what the individual author was trying to express. If you are a native english speaking reader and find any such phrases or wordings we kindly ask you to send an email to the corresponding author and help us improve this documentation in order to avoid misunderstandings. You will find the authors' email addresses at the top of each class. Please accept our apologies for any inconvenience caused.