public class ToolsModelProcessor extends Object implements ModelProcessor
ModelProcessor
implementation.ModelContext.processModel(org.jomc.modlet.Model)
Modifier and Type | Field and Description |
---|---|
static String |
ENABLED_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property
enabled . |
static String |
HEAD_COMMENT_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property
headComment . |
static String |
MODEL_OBJECT_CLASSPATH_RESOLUTION_ENABLED_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property
modelObjectClasspathResolutionEnabled . |
static String |
TAIL_COMMENT_ATTRIBUTE_NAME
Constant for the name of the model context attribute backing property
tailComment . |
Constructor and Description |
---|
ToolsModelProcessor()
Creates a new
ToolsModelProcessor instance. |
Modifier and Type | Method and Description |
---|---|
static String |
getDefaultHeadComment()
Gets the head comment the processor is applying by default.
|
protected String |
getDefaultSourceFileLocation(ModelContext context,
Modules modules,
Implementation implementation)
Gets the default source code file location for a given implementation.
|
protected String |
getDefaultSourceFileLocation(ModelContext context,
Modules modules,
Specification specification)
Gets the default source code file location for a given specification.
|
protected String |
getDefaultSourceSectionName(ModelContext context,
Modules modules,
Implementation implementation)
Gets the default source section name for a given implementation.
|
protected String |
getDefaultSourceSectionName(ModelContext context,
Modules modules,
Specification specification)
Gets the default source section name for a given specification.
|
static String |
getDefaultTailComment()
Gets the tail comment the processor is applying by default.
|
String |
getHeadComment()
Gets the head comment the processor is applying.
|
String |
getTailComment()
Gets the tail comment the processor is applying.
|
static boolean |
isDefaultEnabled()
Gets a flag indicating the processor is enabled by default.
|
static boolean |
isDefaultModelObjectClasspathResolutionEnabled()
Gets a flag indicating model object class path resolution is enabled by default.
|
boolean |
isEnabled()
Gets a flag indicating the processor is enabled.
|
boolean |
isModelObjectClasspathResolutionEnabled()
Gets a flag indicating model object class path resolution 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 |
setDefaultHeadComment(String value)
Sets the head comment the processor is applying by default.
|
static void |
setDefaultModelObjectClasspathResolutionEnabled(Boolean value)
Sets the flag indicating model object class path resolution is enabled by default.
|
static void |
setDefaultTailComment(String value)
Sets the tail comment the processor is applying by default.
|
void |
setEnabled(Boolean value)
Sets the flag indicating the processor is enabled.
|
void |
setHeadComment(String value)
Sets the head comment the processor is applying.
|
void |
setModelObjectClasspathResolutionEnabled(Boolean value)
Sets the flag indicating model object class path resolution is is enabled.
|
void |
setTailComment(String value)
Sets the tail comment the processor is applying.
|
public static final String ENABLED_ATTRIBUTE_NAME
enabled
.public static final String MODEL_OBJECT_CLASSPATH_RESOLUTION_ENABLED_ATTRIBUTE_NAME
modelObjectClasspathResolutionEnabled
.public static final String HEAD_COMMENT_ATTRIBUTE_NAME
headComment
.public static final String TAIL_COMMENT_ATTRIBUTE_NAME
tailComment
.public ToolsModelProcessor()
ToolsModelProcessor
instance.public static boolean isDefaultEnabled()
The default enabled flag is controlled by system property
org.jomc.tools.modlet.ToolsModelProcessor.defaultEnabled
holding a value indicating the processor is
enabled by default. If that property is not set, the true
default is returned.
true
, if the processor is enabled by default; false
, if the processor is disabled by
default.setDefaultEnabled(java.lang.Boolean)
public static void setDefaultEnabled(Boolean value)
value
- The new value of the flag indicating the processor is enabled by default or null
.isDefaultEnabled()
public final boolean isEnabled()
true
, if the processor is enabled; false
, if the processor is disabled.isDefaultEnabled()
,
setEnabled(java.lang.Boolean)
public final void setEnabled(Boolean value)
value
- The new value of the flag indicating the processor is enabled or null
.isEnabled()
public static boolean isDefaultModelObjectClasspathResolutionEnabled()
The model object class path resolution default enabled flag is controlled by system property
org.jomc.tools.modlet.ToolsModelProcessor.defaultModelObjectClasspathResolutionEnabled
holding a value
indicating model object class path resolution is enabled by default. If that property is not set, the
true
default is returned.
true
, if model object class path resolution is enabled by default; false
, if model object
class path resolution is disabled by default.setDefaultModelObjectClasspathResolutionEnabled(java.lang.Boolean)
public static void setDefaultModelObjectClasspathResolutionEnabled(Boolean value)
value
- The new value of the flag indicating model object class path resolution is enabled by default or
null
.isDefaultModelObjectClasspathResolutionEnabled()
public final boolean isModelObjectClasspathResolutionEnabled()
true
, if model object class path resolution is enabled; false
, if model object class path
resolution is disabled.isDefaultModelObjectClasspathResolutionEnabled()
,
setModelObjectClasspathResolutionEnabled(java.lang.Boolean)
public final void setModelObjectClasspathResolutionEnabled(Boolean value)
value
- The new value of the flag indicating model object class path resolution is enabled or null
.isModelObjectClasspathResolutionEnabled()
public static String getDefaultHeadComment()
The default head comment is controlled by system property
org.jomc.tools.modlet.ToolsModelProcessor.defaultHeadComment
holding the head comment the processor is
applying by default. If that property is not set, the //
default is returned.
null
.setDefaultHeadComment(java.lang.String)
public static void setDefaultHeadComment(String value)
value
- The new head comment the processor is applying by default or null
.getDefaultHeadComment()
public final String getHeadComment()
null
.getDefaultHeadComment()
,
setDefaultHeadComment(java.lang.String)
public final void setHeadComment(String value)
value
- The new head comment the processor is applying or null
.getHeadComment()
public static String getDefaultTailComment()
The default tail comment is controlled by system property
org.jomc.tools.modlet.ToolsModelProcessor.defaultTailComment
holding the tail comment the processor is
applying by default. If that property is not set, the null
default is returned.
null
.setDefaultTailComment(java.lang.String)
public static void setDefaultTailComment(String value)
value
- The new tail comment the processor is applying by default or null
.getDefaultTailComment()
public final String getTailComment()
null
.getDefaultTailComment()
,
setDefaultTailComment(java.lang.String)
public final void setTailComment(String value)
value
- The new tail comment the processor is applying or null
.getTailComment()
public Model processModel(ModelContext context, Model model) throws ModelException
processModel
in interface ModelProcessor
ModelException
isEnabled()
,
isModelObjectClasspathResolutionEnabled()
,
getHeadComment()
,
getTailComment()
,
ENABLED_ATTRIBUTE_NAME
,
MODEL_OBJECT_CLASSPATH_RESOLUTION_ENABLED_ATTRIBUTE_NAME
,
HEAD_COMMENT_ATTRIBUTE_NAME
,
TAIL_COMMENT_ATTRIBUTE_NAME
protected String getDefaultSourceFileLocation(ModelContext context, Modules modules, Specification specification)
If the specification provides a Java type name, this method returns a Java source code file location based on that Java type name.
context
- The context to get the default location with.modules
- The model to get the default location with.specification
- The specification to get the default location for.specification
or null
.NullPointerException
- if context
, modules
or specification
is null
.SourceFileType.getLocation()
,
Specification.getJavaTypeName()
protected String getDefaultSourceFileLocation(ModelContext context, Modules modules, Implementation implementation)
If the implementation provides a Java type name, this method returns a Java source code file location based on that Java type name.
context
- The context to get the default location with.modules
- The model to get the default location with.implementation
- The implementation to get the default location for.implementation
or null
.NullPointerException
- if context
, modules
or implementation
is null
.SourceFileType.getLocation()
,
Implementation.getJavaTypeName()
protected String getDefaultSourceSectionName(ModelContext context, Modules modules, Specification specification)
If the specification provides a Java type name, this method returns a section name based on that Java type name.
context
- The context to get the default section name with.modules
- The model to get the default section name with.specification
- The specification to get the default section name for.specification
or null
.NullPointerException
- if context
, modules
or specification
is null
.SourceSectionType.getName()
,
Specification.getJavaTypeName()
protected String getDefaultSourceSectionName(ModelContext context, Modules modules, Implementation implementation)
If the implementation provides a Java type name, this method returns a section name based that Java type name.
context
- The context to get the default section name with.modules
- The model to get the default section name with.implementation
- The implementation to get the default section name for.implementation
or null
.NullPointerException
- if context
, modules
or implementation
is null
.SourceSectionType.getName()
,
Implementation.getJavaTypeName()
Copyright © 2005–2015 The JOMC Project. All rights reserved.