public class Flattener extends Object implements Transformer, MessageSource
Constructor and Description |
---|
Flattener() |
Modifier and Type | Method and Description |
---|---|
protected String |
join(Set<String> parts,
String delimiter)
Creates a string that contains the parts, separated by the given
delimiter (if
null it defaults to the empty string). |
String |
message(int mnr)
Return a message for a message number.
|
void |
process(GenericModel genModel,
Options options,
TransformerConfiguration trfConfig,
ShapeChangeResult result)
Processes the model.
|
public static final String TRANSFORMER_NAMESPACE_SUFFIX_PARAMETER
public static final String PARAM_REMOVE_TYPE
public static final String TRANSFORMER_LOWER_CASE_ALIAS_FOR_PROPERTIES
public static final String TRANSFORMER_LOWER_CASE_CODE_FOR_PROPERTIES
public static final String TRANSFORMER_ALIAS_FOR_ENUMERATION_VALUES
public static final String TRANSFORMER_CODE_FOR_ENUMERATION_VALUES
public static final String TRANSFORMER_ENFORCE_OPTIONALITY
public static final String TRANSFORMER_KEEP_ORIGINAL_NAME_AS_ALIAS
public static final String TRANSFORMER_KEEP_ORIGINAL_NAME_AS_CODE
public static final String TRANSFORMER_SEPARATOR_FOR_PROPERTY_FROM_UNION
public static final String TRANSFORMER_SEPARATOR_FOR_PROPERTY_FROM_NON_UNION
public static final String TRANSFORMER_SEPARATOR_FOR_PROPERTY_INDEX_NUMBER
public static final String TRANSFORMER_SEPARATOR_FOR_GEOMETRY_TYPE_SUFFIX
public static final String TRANSFORMER_REMOVE_PROPERTY_NAME_AND_ALIAS_COMPONENT
public static final String TRANSFORMER_REMOVE_PROPERTY_NAME_AND_CODE_COMPONENT
public static final String TRANSFORMER_CODEBY_TAGGEDVALUE
public static final String PARAM_OBJECT_TO_FEATURE_TYPE_NAV_REGEX
Applies to "rule-trf-prop-removeObjectToFeatureTypeNavigability". The parameter is required if this rule is in effect.
public static final String PARAM_INCLUDE_OBJECT_NAV
true
then execution of
"rule-trf-prop-removeObjectToFeatureTypeNavigability" will
also remove navigable properties whose value type is an object type.
Default value is false
.
public static final String PARAM_INHERITANCE_INCLUDE_REGEX
public static final String PARAM_INHERITANCE_LINKED_DOC_PAGEBREAK
public static final String PARAM_FLATTEN_OBJECT_TYPES
public static final String PARAM_FLATTEN_OBJECT_TYPES_INCLUDE_REGEX
public static final String PARAM_FLATTEN_DATATYPES_EXCLUDE_REGEX
public static final String PARAM_REPLACE_UNION_EXCLUDE_REGEX
Type: String (with Java compliant regular expression)
Default Value: none
Behavior: This parameter identifies the unions that shall NOT be flattened. The value of this parameter contains a (Java compliant) regular expression which, if it matches the name of a union, marks it to be excluded by the Flattener.
Applies to Rule(s): rule-trf-cls-replace-with-union-properties
public static final String PARAM_INCLUDE_UNION_IDENTIFIER_TV
true
, then properties that
originate from flattening a specific union will be tagged (with tag '
UNION_SET_TAG_NAME
'). This allows identifying which properties
belong to the union after it has been flattened - just by looking at the
tagged values. Properties from a union that are copied into another union
will not be tracked. Also, tracking information will be removed / not
created if union options replace a property with max multiplicity > 1
(because then the union semantics will become irrelevant, as that
property can have values from more than one union option).public static final String PARAM_SIMPLE_BASE_TYPES
public static final String[] DEFAULT_SIMPLE_BASE_TYPES
public static final String PARAM_SET_MIN_CARDINALITY_TO_ZERO_WHEN_MERGING_UNION
false
(the default is
true
).public static final String PARAM_IGNORE_REFLEXIVE_RELATIONSHIP_IN_TYPE_FLATTENING
public static final String PARAM_MAXOCCURS
public static final String PARAM_MAXOCCURS_FOR_SPECIFIC_PROPERTIES
public static final String PARAM_IGNORE_FEATURE_OR_OBJECT_TYPED_PROPERTIES
public static final String PARAM_IGNORE_FEATURE_TYPED_PROPERTIES
public static final String PARAM_MAX_MULTIPLICITY_THRESHOLD
public static final String PARAM_HOMOGENEOUSGEOMETRIES_APPLY_ON_SUBTYPES
public static final String PARAM_HOMOGENEOUSGEOMETRIES_OMIT_RULE_FOR_CASE_OF_SINGLE_GEOMETRY_PROP
public static final String PARAM_REMOVE_INHERITANCE_INCLUDE_REGEX
public static final String PARAM_DESCRIPTOR_MOD_NON_UNION_SEPARATOR
public static final String PARAM_DESCRIPTOR_MOD_UNION_SEPARATOR
public static final String PARAM_DESCRIPTOR_MOD_PROPERTY_INDEX_NUMBER
public static final String PARAM_DESCRIPTOR_MOD_GEOMETRY_TYPE_SUFFIX_SEPARATOR
public static final String PARAM_DESCRIPTOR_MOD_GEOM_TYPE_ALIAS
public static final String RULE_TRF_ALL_FLATTEN_CODELISTS
public static final String RULE_TRF_ALL_FLATTEN_CONSTRAINTS
public static final String RULE_TRF_ALL_FLATTEN_REMOVE_CONSTRAINTS
public static final String RULE_TRF_ALL_FLATTEN_NAME
public static final String RULE_TRF_ALL_REMOVETYPE
public static final String RULE_TRF_ALL_REMOVE_FEATURETYPE_RELATIONSHIPS
public static final String RULE_TRF_CLS_FLATTEN_INHERITANCE
public static final String RULE_TRF_CLS_FLATTEN_INHERITANCE_ADD_ATTRIBUTES_AT_BOTTOM
public static final String RULE_TRF_CLS_FLATTEN_INHERITANCE_ASSOCIATIONROLENAME_USING_CODE_OF_VALUETYPE
public static final String RULE_TRF_CLS_FLATTEN_INHERITANCE_MERGE_LINKED_DOCUMENTS
public static final String RULE_TRF_PROP_FLATTEN_HOMOGENEOUSGEOMETRIES
public static final String RULE_TRF_PROP_FLATTEN_MULTIPLICITY
public static final String RULE_TRF_PROP_FLATTEN_MULTIPLICITY_WITHMAXMULTTHRESHOLD
public static final String RULE_TRF_PROP_FLATTEN_MULTIPLICITY_KEEPBIDIRECTIONALASSOCIATIONS
public static final String RULE_TRF_PROP_FLATTEN_ONINAS
public static final String RULE_TRF_PROP_FLATTEN_ONINAS_ONLY_REMOVE_REASONS
public static final String RULE_TRF_PROP_FLATTEN_TYPES
public static final String RULE_TRF_PROP_FLATTEN_TYPE_MAP_TO_SIMPLEBASETYPE
public static final String RULE_TRF_PROP_FLATTEN_TYPES_IGNORE_SELF_REF_BY_PROP_WITH_ASSO_CLASS_ORIGIN
public static final String RULE_TRF_PROP_FLATTEN_TYPES_IGNORE_UNIONS_REPRESENTING_FEATURE_TYPE_SETS
public static final String RULE_TRF_PROP_FLATTEN_TYPES_REMOVE_MAPPED_TYPES
public static final String RULE_TRF_PROP_OPTIONALITY
public static final String RULE_TRF_PROP_REMOVE_OBJECT_TO_FEATURE_TYPE_NAVIGABILITY
public static final String RULE_TRF_PROP_REMOVE_NAVIGABILITY_BASEDON_ISFLATTARGET
This will ensure that the contents of the class (A) that owns the property (so the class on the other end of the association) can be copied into the value type (B) of the property but not the other way round - if (A) was flattened by "rule-trf-prop-flatten-types". Setting the isFlatTarget tagged value is especially useful for managing how complex type flattening is applied in case of bi-directional association.
NOTE: if the isFlatTarget setting(s) on the association leads to the removal of the whole association (because both ends have been removed / are no longer navigable) a warning will be logged.
public static final String RULE_TRF_PROP_REMOVE_NAME_AND_ALIAS_COMPONENT
public static final String RULE_TRF_PROP_REMOVE_NAME_AND_CODE_COMPONENT
public static final String RULE_TRF_PROP_UNION_DIRECT_OPTIONALITY
public static final String RULE_TRF_CLS_DISSOLVE_MIXINS
Does NOT copy associations!
public static final String RULE_TRF_CLS_REMOVE_INHERITANCE_RELATIONSHIP
public static final String RULE_TRF_CLS_REPLACE_WITH_UNION_PROPERTIES
public static final String RULE_TRF_CLS_FLATTEN_GEOMETRY_TYPE_INHERITANCE
Parameters: none
public static final String REQ_FLATTEN_TYPES_IDENTIFY_CIRCULAR_DEPENDENCIES
public static final String CHARACTER_STRING_CLASS_ID
public static final String TAGGED_VALUE_IS_FLAT_TARGET
public static final String UNION_SET_TAG_NAME
public static final Pattern descriptorModBasicPattern
public static final Pattern descriptorModValKvpPattern
public void process(GenericModel genModel, Options options, TransformerConfiguration trfConfig, ShapeChangeResult result) throws ShapeChangeAbortException
Transformer
process
in interface Transformer
genModel
- The model to process.options
- Options to control the process execution.result
- Logging target.ShapeChangeAbortException
protected String join(Set<String> parts, String delimiter)
null
it defaults to the empty string). If the
set contains a null element, it is ignored. Joins the parts in the order
returned by the iterator. If order of the set is important, ensure that
an ordered set is used (e.g. TreeSet).parts
- delimiter
- public String message(int mnr)
MessageSource
message
in interface MessageSource
Copyright © 2018. All rights reserved.