org.jomc.ant
Class JomcModelTask

Package class diagram package JomcModelTask
java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.jomc.ant.JomcTask
              extended by org.jomc.ant.JomcModelTask
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
JomcToolTask, MergeModulesTask, ValidateModelTask, WriteModelTask

public class JomcModelTask
extends JomcTask

Base class for executing model based tasks.

Version:
$JOMC: JomcModelTask.java 4200 2012-01-25 09:46:13Z schulte2005 $
Author:
Christian Schulte

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
JomcModelTask()
          Creates a new JomcModelTask instance.
 
Method Summary
 JomcModelTask clone()
          Creates and returns a copy of this object.
 ModuleResourceType createModuleResource()
          Creates a new moduleResource element instance.
 Model getModel(ModelContext context)
          Gets a Model from a given ModelContext.
 String getModuleLocation()
          Gets the location searched for modules.
 Set<ModuleResourceType> getModuleResources()
          Gets a set of module resources.
 String getTransformerLocation()
          Gets the location searched for transformers.
 boolean isModelObjectClasspathResolutionEnabled()
          Gets a flag indicating model object class path resolution is enabled.
 boolean isModelResourceValidationEnabled()
          Gets a flag indicating JAXP schema validation of model resources is enabled.
 ModelContext newModelContext(ClassLoader classLoader)
          Creates a new ModelContext instance using a given class loader.
 void preExecuteTask()
          Called by the execute method prior to the executeTask method.
 void setModelObjectClasspathResolutionEnabled(boolean value)
          Sets the flag indicating model object class path resolution is enabled.
 void setModelResourceValidationEnabled(boolean value)
          Sets the flag indicating JAXP schema validation of model resources is enabled.
 void setModuleLocation(String value)
          Sets the location to search for modules.
 void setTransformerLocation(String value)
          Sets the location to search for transformers.
 
Methods inherited from class org.jomc.ant.JomcTask
assertKeysNotNull, assertLocationsNotNull, assertNamesNotNull, assertNotNull, createClasspath, createModelContextAttribute, createTransformationOutputProperty, createTransformationParameter, createTransformationParameterResource, execute, executeTask, getClasspath, getDirectory, getIf, getModel, getModelContextAttributes, getModelContextFactoryClassName, getModletLocation, getModletSchemaSystemId, getPlatformProviderLocation, getProperties, getProviderLocation, getResource, getResources, getTransformationOutputProperties, getTransformationParameterResources, getTransformationParameters, getTransformer, getUnless, isModelProcessingEnabled, isModletResourceValidationEnabled, logMessage, logMessage, logSeparator, logValidationReport, newProjectClassLoader, postExecuteTask, setClasspath, setClasspathRef, setIf, setModel, setModelContextFactoryClassName, setModelProcessingEnabled, setModletLocation, setModletResourceValidationEnabled, setModletSchemaSystemId, setPlatformProviderLocation, setProviderLocation, setUnless
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JomcModelTask

public JomcModelTask()
Creates a new JomcModelTask instance.

Method Detail

getModuleLocation

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

Returns:
The location searched for modules or null.
See Also:
setModuleLocation(java.lang.String)

setModuleLocation

public final void setModuleLocation(String value)
Sets the location to search for modules.

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

getTransformerLocation

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

Returns:
The location searched for transformers or null.
See Also:
setTransformerLocation(java.lang.String)

setTransformerLocation

public final void setTransformerLocation(String value)
Sets the location to search for transformers.

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

isModelObjectClasspathResolutionEnabled

public final boolean isModelObjectClasspathResolutionEnabled()
Gets a flag indicating model object class path resolution is enabled.

Returns:
true, if model object class path resolution is enabled; false, else.
See Also:
setModelObjectClasspathResolutionEnabled(boolean)

setModelObjectClasspathResolutionEnabled

public final void setModelObjectClasspathResolutionEnabled(boolean value)
Sets the flag indicating model object class path resolution is enabled.

Parameters:
value - true, to enable model object class path resolution; false, to disable model object class path resolution.
See Also:
isModelObjectClasspathResolutionEnabled()

getModuleResources

public Set<ModuleResourceType> getModuleResources()
Gets a set of module resources.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the module resources property.

Returns:
A set of module resources.
See Also:
createModuleResource()

createModuleResource

public ModuleResourceType createModuleResource()
Creates a new moduleResource element instance.

Returns:
A new moduleResource element instance.
See Also:
getModuleResources()

isModelResourceValidationEnabled

public final boolean isModelResourceValidationEnabled()
Gets a flag indicating JAXP schema validation of model resources is enabled.

Returns:
true, if JAXP schema validation of model resources is enabled; false, else.
See Also:
setModelResourceValidationEnabled(boolean)

setModelResourceValidationEnabled

public final void setModelResourceValidationEnabled(boolean value)
Sets the flag indicating JAXP schema validation of model resources is enabled.

Parameters:
value - true, to enable JAXP schema validation of model resources; false, to disable JAXP schema validation of model resources.
See Also:
isModelResourceValidationEnabled()

getModel

public Model getModel(ModelContext context)
               throws org.apache.tools.ant.BuildException,
                      ModelException
Gets a Model from a given ModelContext.

Overrides:
getModel in class JomcTask
Parameters:
context - The context to get a Model from.
Returns:
The Model from context.
Throws:
NullPointerException - if contexŧ is null.
org.apache.tools.ant.BuildException - if no model is found.
ModelException - if getting the model fails.
See Also:
JomcTask.getModel(), isModelObjectClasspathResolutionEnabled(), JomcTask.isModelProcessingEnabled()

preExecuteTask

public void preExecuteTask()
                    throws org.apache.tools.ant.BuildException
Called by the execute method prior to the executeTask method.

Overrides:
preExecuteTask in class JomcTask
Throws:
org.apache.tools.ant.BuildException - if execution fails.
See Also:
JomcTask.execute()

newModelContext

public ModelContext newModelContext(ClassLoader classLoader)
                             throws ModelException
Creates a new ModelContext instance using a given class loader.

Overrides:
newModelContext in class JomcTask
Parameters:
classLoader - The class loader to create a new ModelContext instance with.
Returns:
A new ModelContext instance backed by classLoader.
Throws:
ModelException - if creating a new ModelContext instance fails.

clone

public JomcModelTask clone()
Creates and returns a copy of this object.

Overrides:
clone in class JomcTask
Returns:
A copy of this object.


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.