public class ProfileLoader extends Object implements Transformer, MessageSource
Modifier and Type | Field and Description |
---|---|
static String[] |
DEFAULT_DIFF_ELEMENT_TYPES |
static String |
PARAM_DIFF_ELEMENT_TYPES
Alias: none
Required / Optional: optional
Type: String (with comma separated values)
Default Value: CLASS, ENUM, MULTIPLICITY, PROPERTY, NAME, STEREOTYPE,
SUPERTYPE, SUBPACKAGE, VALUETYPE
Explanation: Comma-separated list of names of diff element types.
|
static String |
PARAM_INPUT_MODEL_EXPLICIT_PROFILES
Alias: none
Required / Optional: optional
Type: Boolean
Default Value:
true
Explanation: Indicates if profile definitions in the input model are
explicitly set ( true ) or not (false ). |
static String |
PARAM_LOAD_MODEL_DIRECTORY
Alias: none
Required / Optional: required
Type: String
Default Value: none
Explanation: The path to the folder that contains the profiles.
|
static String |
PARAM_LOAD_MODEL_FILE_REGEX
Alias: none
Required / Optional: optional
Type: String (with regular expression)
Default Value: .*(\.xml|\.zip)$
Explanation: By default, the ProfileLoader loads all XML and ZIP files in
the directory that is stated by the transformation parameter
"directoryWithProfilesToLoad" (excluding subdirectories).
|
static String |
PARAM_PROCESS_ALL_SCHEMAS
Alias: none
Required / Optional: optional
Type: Boolean
Default Value:
false
Explanation: By default, only the profiles of classes (and their
properties) from schemas that are selected for processing are processed. |
static String |
PARAM_PROFILES_FOR_CLASSES_WITHOUT_EXPLICIT_PROFILES
Alias: none
Required / Optional: optional
Type: String (with comma separated values)
Default Value: all profiles defined in the input model
Explanation: Comma-separated list of names of profiles that will be set
for input model classes that do not belong to a specific profile.
|
static String |
PARAM_PROFILES_TO_LOAD
Alias: none
Required / Optional: optional
Type: String (comma separated list of values)
Default Value: all profiles
Explanation: Names of profiles to be loaded into the input model.
|
static String |
RULE_DIFF_MODELS
If this rule is enabled, differences between a loaded model and the input
model are logged.
|
static String |
RULE_POST_VALIDATE_RESULTING_MODEL_PROFILES
If this rule is enabled, the profiles in the resulting model are
validated during the post-processing phase (i.e., after profiles have
been loaded).
|
static String |
RULE_PRE_DELETE_INPUT_MODEL_PROFILES
If this rule is enabled, the tagged value 'profiles' as well as the
profile information parsed from that tagged value are removed from all
classes and properties of the input model.
|
static String |
RULE_PRE_VALIDATE_INPUT_MODEL_PROFILES
If this rule is enabled, the profiles defined in the input model are
validated during the pre-processing phase.
|
static String |
RULE_VALIDATE_LOADED_MODEL_PROFILES
If this rule is enabled, the profiles in each external model are
validated after that model has been loaded.
|
Constructor and Description |
---|
ProfileLoader() |
Modifier and Type | Method and Description |
---|---|
String |
message(int mnr)
Return a message for a message number.
|
void |
process(GenericModel m,
Options o,
TransformerConfiguration trfConfig,
ShapeChangeResult r)
Processes the model.
|
public static final String RULE_PRE_DELETE_INPUT_MODEL_PROFILES
NOTE: This can be useful to create a 'clean slate' before loading profiles into the model.
public static final String RULE_PRE_VALIDATE_INPUT_MODEL_PROFILES
public static final String RULE_POST_VALIDATE_RESULTING_MODEL_PROFILES
public static final String RULE_VALIDATE_LOADED_MODEL_PROFILES
public static final String RULE_DIFF_MODELS
public static final String PARAM_PROCESS_ALL_SCHEMAS
Required / Optional: optional
Type: Boolean
Default Value: false
Explanation: By default, only the profiles of classes (and their
properties) from schemas that are selected for processing are processed.
If this parameter is set to true
, classes (and their
properties) from all schemas are processed.
Applies to Rule(s): none – default behavior
public static final String PARAM_INPUT_MODEL_EXPLICIT_PROFILES
Required / Optional: optional
Type: Boolean
Default Value: true
Explanation: Indicates if profile definitions in the input model are
explicitly set ( true
) or not (false
). If they
are not, then profile inheritance would apply, which must be converted
before loading (also see parameter
"profilesForClassesWithoutExplicitProfileAssignments").
Applies to Rule(s): none – default behavior
public static final String PARAM_LOAD_MODEL_FILE_REGEX
Required / Optional: optional
Type: String (with regular expression)
Default Value: .*(\.xml|\.zip)$
Explanation: By default, the ProfileLoader loads all XML and ZIP files in the directory that is stated by the transformation parameter "directoryWithProfilesToLoad" (excluding subdirectories). That behavior can be changed to only use the files from that directory whose name matches the regular expression given by the parameter "regexToFilterProfilesToLoad".
Applies to Rule(s): none – default behavior
public static final String PARAM_PROFILES_FOR_CLASSES_WITHOUT_EXPLICIT_PROFILES
Required / Optional: optional
Type: String (with comma separated values)
Default Value: all profiles defined in the input model
Explanation: Comma-separated list of names of profiles that will be set
for input model classes that do not belong to a specific profile. This is
relevant while pre-processing the input model in case that the profiles
are not set explicitly in the input model (parameter
"profilesInModelSetExplicitly" is false
).
Applies to Rule(s): none – default behavior
public static final String PARAM_PROFILES_TO_LOAD
Required / Optional: optional
Type: String (comma separated list of values)
Default Value: all profiles
Explanation: Names of profiles to be loaded into the input model.
Applies to Rule(s): none – default behavior
public static final String PARAM_LOAD_MODEL_DIRECTORY
Required / Optional: required
Type: String
Default Value: none
Explanation: The path to the folder that contains the profiles.
Applies to Rule(s): none – default behavior
public static final String PARAM_DIFF_ELEMENT_TYPES
Required / Optional: optional
Type: String (with comma separated values)
Default Value: CLASS, ENUM, MULTIPLICITY, PROPERTY, NAME, STEREOTYPE, SUPERTYPE, SUBPACKAGE, VALUETYPE
Explanation: Comma-separated list of names of diff element types. The diff result will only provide information on these types of differences (in addition to a possibly existing schema version difference).
The following diff element types are currently supported: NAME, DOCUMENTATION, MULTIPLICITY, VALUETYPE, CLASS, SUPERTYPE, SUBPACKAGE, PROPERTY, ENUM, STEREOTYPE, TAG, ALIAS, DEFINITION, DESCRIPTION, PRIMARYCODE, GLOBALIDENTIFIER, LEGALBASIS, AAAMODELLART, AAAGRUNDDATENBESTAND
Applies to Rule(s): "rule-trf-profileLoader-diffModels"
public static final String[] DEFAULT_DIFF_ELEMENT_TYPES
public void process(GenericModel m, Options o, TransformerConfiguration trfConfig, ShapeChangeResult r) throws ShapeChangeAbortException
Transformer
process
in interface Transformer
m
- The model to process.o
- Options to control the process execution.r
- Logging target.ShapeChangeAbortException
public String message(int mnr)
MessageSource
message
in interface MessageSource
Copyright © 2017. All rights reserved.