public class ToolsModelProvider extends Object implements ModelProvider
ModelProvider
implementation.ModelContext.findModel(java.lang.String)
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 |
---|
ToolsModelProvider()
Creates a new
ToolsModelProvider instance. |
Modifier and Type | Method and Description |
---|---|
Model |
findModel(ModelContext context,
Model model) |
static String |
getDefaultHeadComment()
Gets the head comment the provider is providing 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 SourceFilesType |
getDefaultSourceFilesType(ModelContext context,
Modules modules,
Implementation implementation)
Creates a new default source files model for a given implementation.
|
protected SourceFilesType |
getDefaultSourceFilesType(ModelContext context,
Modules modules,
Specification specification)
Creates a new default source files model 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 provider is providing by default.
|
String |
getHeadComment()
Gets the head comment the provider is providing.
|
String |
getTailComment()
Gets the tail comment the provider is providing.
|
static boolean |
isDefaultEnabled()
Gets a flag indicating the provider 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 provider is enabled.
|
boolean |
isModelObjectClasspathResolutionEnabled()
Gets a flag indicating model object class path resolution is enabled.
|
static void |
setDefaultEnabled(Boolean value)
Sets the flag indicating the provider is enabled by default.
|
static void |
setDefaultHeadComment(String value)
Sets the head comment the provider is providing 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 provider is providing by default.
|
void |
setEnabled(Boolean value)
Sets the flag indicating the provider is enabled.
|
void |
setHeadComment(String value)
Sets the head comment the provider is providing.
|
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 provider is providing.
|
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 ToolsModelProvider()
ToolsModelProvider
instance.public static boolean isDefaultEnabled()
The default enabled flag is controlled by system property
org.jomc.tools.modlet.ToolsModelProvider.defaultEnabled
holding a value indicating the provider is
enabled by default. If that property is not set, the true
default is returned.
true
, if the provider is enabled by default; false
, if the provider is disabled by
default.setDefaultEnabled(java.lang.Boolean)
public static void setDefaultEnabled(Boolean value)
value
- The new value of the flag indicating the provider is enabled by default or null
.isDefaultEnabled()
public final boolean isEnabled()
true
, if the provider is enabled; false
, if the provider is disabled.isDefaultEnabled()
,
setEnabled(java.lang.Boolean)
public final void setEnabled(Boolean value)
value
- The new value of the flag indicating the provider 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.ToolsModelProvider.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.ToolsModelProvider.defaultHeadComment
holding the head comment the provider is
providing 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 provider is providing 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 provider is providing or null
.getHeadComment()
public static String getDefaultTailComment()
The default tail comment is controlled by system property
org.jomc.tools.modlet.ToolsModelProvider.defaultTailComment
holding the tail comment the provider is
providing 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 provider is providing 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 provider is providing or null
.getTailComment()
public Model findModel(ModelContext context, Model model) throws ModelException
findModel
in interface ModelProvider
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
.getDefaultSourceFilesType(org.jomc.modlet.ModelContext, org.jomc.model.Modules, org.jomc.model.Specification)
,
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
.getDefaultSourceFilesType(org.jomc.modlet.ModelContext, org.jomc.model.Modules, org.jomc.model.Implementation)
,
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
.getDefaultSourceFilesType(org.jomc.modlet.ModelContext, org.jomc.model.Modules, org.jomc.model.Specification)
,
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
.getDefaultSourceFilesType(org.jomc.modlet.ModelContext, org.jomc.model.Modules, org.jomc.model.Implementation)
,
SourceSectionType.getName()
,
Implementation.getJavaTypeName()
protected SourceFilesType getDefaultSourceFilesType(ModelContext context, Modules modules, Specification specification)
context
- The context to create a new default source files model with.modules
- The model to create a new default source files model with.specification
- The specification to create a new default source files model for.specification
.NullPointerException
- if context
, modules
or specification
is null
.getDefaultSourceFileLocation(org.jomc.modlet.ModelContext, org.jomc.model.Modules, org.jomc.model.Specification)
,
getDefaultSourceSectionName(org.jomc.modlet.ModelContext, org.jomc.model.Modules, org.jomc.model.Specification)
protected SourceFilesType getDefaultSourceFilesType(ModelContext context, Modules modules, Implementation implementation)
context
- The context to create a new default source files model with.modules
- The model to create a new default source files model with.implementation
- The implementation to create a new default source files model for.implementation
.NullPointerException
- if context
, modules
or implementation
is null
.getDefaultSourceFileLocation(org.jomc.modlet.ModelContext, org.jomc.model.Modules, org.jomc.model.Implementation)
,
getDefaultSourceSectionName(org.jomc.modlet.ModelContext, org.jomc.model.Modules, org.jomc.model.Implementation)
Copyright © 2005–2015 The JOMC Project. All rights reserved.