org.jomc.modlet
Class DefaultModletProvider

Package class diagram package DefaultModletProvider
java.lang.Object
  extended by org.jomc.modlet.DefaultModletProvider
All Implemented Interfaces:
ModletProvider

public class DefaultModletProvider
extends Object
implements ModletProvider

Default ModletProvider implementation.

Version:
$JOMC: DefaultModletProvider.java 4203 2012-01-26 08:32:45Z schulte2005 $
Author:
Christian Schulte
See Also:
ModelContext.findModlets()

Field Summary
static String ENABLED_ATTRIBUTE_NAME
          Constant for the name of the model context attribute backing property enabled.
static String MODLET_LOCATION_ATTRIBUTE_NAME
          Constant for the name of the model context attribute backing property modletLocation.
static String VALIDATING_ATTRIBUTE_NAME
          Constant for the name of the model context attribute backing property validating.
 
Constructor Summary
DefaultModletProvider()
          Creates a new DefaultModletProvider instance.
 
Method Summary
 Modlets findModlets(ModelContext context)
          Searches a given context for Modlets.
 Modlets findModlets(ModelContext context, String location)
          Searches a given context for Modlets.
static String getDefaultModletLocation()
          Gets the default location searched for Modlet resources.
 String getModletLocation()
          Gets the location searched for Modlet 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 setDefaultModletLocation(String value)
          Sets the default location searched for Modlet 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 setModletLocation(String value)
          Sets the location searched for Modlet 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:
findModlets(org.jomc.modlet.ModelContext), ModelContext.getAttribute(java.lang.String), Constant Field Values

MODLET_LOCATION_ATTRIBUTE_NAME

public static final String MODLET_LOCATION_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property modletLocation.

Since:
1.2
See Also:
findModlets(org.jomc.modlet.ModelContext), 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:
findModlets(org.jomc.modlet.ModelContext, java.lang.String), ModelContext.getAttribute(java.lang.String), Constant Field Values
Constructor Detail

DefaultModletProvider

public DefaultModletProvider()
Creates a new DefaultModletProvider 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.modlet.DefaultModletProvider.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:
isEnabled(), 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()

getDefaultModletLocation

public static String getDefaultModletLocation()
Gets the default location searched for Modlet resources.

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

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

setDefaultModletLocation

public static void setDefaultModletLocation(String value)
Sets the default location searched for Modlet resources.

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

getModletLocation

public final String getModletLocation()
Gets the location searched for Modlet resources.

Returns:
The location searched for Modlet resources.
See Also:
getDefaultModletLocation(), setModletLocation(java.lang.String)

setModletLocation

public final void setModletLocation(String value)
Sets the location searched for Modlet resources.

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

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.modlet.DefaultModletProvider.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()

findModlets

public Modlets findModlets(ModelContext context,
                           String location)
                    throws ModelException
Searches a given context for Modlets.

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

findModlets

public Modlets findModlets(ModelContext context)
                    throws ModelException
Searches a given context for Modlets.

Specified by:
findModlets in interface ModletProvider
Parameters:
context - The context to search for Modlets.
Returns:
The Modlets found in the context or null, if no Modlets are found or the provider is disabled.
Throws:
ModelException - if searching the context fails.
See Also:
isEnabled(), getModletLocation(), findModlets(org.jomc.modlet.ModelContext, java.lang.String), ENABLED_ATTRIBUTE_NAME, MODLET_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.