org.jomc.model.modlet
Class DefaultModelProcessor

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

public class DefaultModelProcessor
extends Object
implements ModelProcessor

Default object management and configuration ModelProcessor implementation.

Version:
$JOMC: DefaultModelProcessor.java 4201 2012-01-25 09:47:12Z schulte2005 $
Author:
Christian Schulte
See Also:
ModelContext.processModel(org.jomc.modlet.Model)

Field Summary
static String ENABLED_ATTRIBUTE_NAME
          Constant for the name of the model context attribute backing property enabled.
static String TRANSFORMER_LOCATION_ATTRIBUTE_NAME
          Constant for the name of the model context attribute backing property transformerLocation.
 
Constructor Summary
DefaultModelProcessor()
          Creates a new DefaultModelProcessor instance.
 
Method Summary
 List<Transformer> findTransformers(ModelContext context, String location)
          Searches a given context for transformers.
static String getDefaultTransformerLocation()
          Gets the default location searched for transformer resources.
 String getTransformerLocation()
          Gets the location searched for transformer resources.
static boolean isDefaultEnabled()
          Gets a flag indicating the processor is enabled by default.
 boolean isEnabled()
          Gets a flag indicating the processor is enabled.
 Model processModel(ModelContext context, Model model)
          
static void setDefaultEnabled(Boolean value)
          Sets the flag indicating the processor is enabled by default.
static void setDefaultTransformerLocation(String value)
          Sets the default location searched for transformer resources.
 void setEnabled(Boolean value)
          Sets the flag indicating the processor is enabled.
 void setTransformerLocation(String value)
          Sets the location searched for transformer 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:
processModel(org.jomc.modlet.ModelContext, org.jomc.modlet.Model), ModelContext.getAttribute(java.lang.String), Constant Field Values

TRANSFORMER_LOCATION_ATTRIBUTE_NAME

public static final String TRANSFORMER_LOCATION_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property transformerLocation.

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

DefaultModelProcessor

public DefaultModelProcessor()
Creates a new DefaultModelProcessor instance.

Method Detail

isDefaultEnabled

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

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

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

setDefaultEnabled

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

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

isEnabled

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

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

setEnabled

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

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

getDefaultTransformerLocation

public static String getDefaultTransformerLocation()
Gets the default location searched for transformer resources.

The default transformer location is controlled by system property org.jomc.model.modlet.DefaultModelProcessor.defaultTransformerLocation holding the location to search for transformer resources by default. If that property is not set, the META-INF/jomc.xsl default is returned.

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

setDefaultTransformerLocation

public static void setDefaultTransformerLocation(String value)
Sets the default location searched for transformer resources.

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

getTransformerLocation

public final String getTransformerLocation()
Gets the location searched for transformer resources.

Returns:
The location searched for transformer resources.
See Also:
getDefaultTransformerLocation(), setTransformerLocation(java.lang.String)

setTransformerLocation

public final void setTransformerLocation(String value)
Sets the location searched for transformer resources.

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

findTransformers

public List<Transformer> findTransformers(ModelContext context,
                                          String location)
                                   throws ModelException
Searches a given context for transformers.

Parameters:
context - The context to search for transformers.
location - The location to search at.
Returns:
The transformers found at location in context or null, if no transformers are found.
Throws:
NullPointerException - if context or location is null.
ModelException - if getting the transformers fails.

processModel

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

Specified by:
processModel in interface ModelProcessor
Throws:
ModelException
See Also:
isEnabled(), getTransformerLocation(), findTransformers(org.jomc.modlet.ModelContext, java.lang.String), ENABLED_ATTRIBUTE_NAME, TRANSFORMER_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.