public class ProfileUtil extends Object
Constructor and Description |
---|
ProfileUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
convertToExplicitProfileDefinitions(GenericModel genModel,
Profiles profilesForClassesBelongingToAllProfiles,
Pattern schemaNameRegex,
boolean convertWholeModel) |
static SortedSet<String> |
findNamesOfAllProfiles(Model model,
boolean searchInWholeModel) |
static void |
removeProfiles(GenericModel genModel)
Removes the profiles in all classes and properties of the given model.
|
static void |
transferProfiles(SortedSet<String> namesOfProfilesToTransfer,
ClassInfo sourceCi,
ClassInfo targetCi)
Transfers a set of profiles from a source class to a target class.
|
static void |
transferProfiles(SortedSet<String> namesOfProfilesToTransfer,
PropertyInfo sourcePi,
PropertyInfo targetPi)
Transfers a set of profiles from a source property to a target property.
|
public static SortedSet<String> findNamesOfAllProfiles(Model model, boolean searchInWholeModel)
model
- searchInWholeModel
- true
if profiles shall be looked up in the whole
model, false
if the lookup shall only be
performed in the schemas selected for processing.null
.public static void convertToExplicitProfileDefinitions(GenericModel genModel, Profiles profilesForClassesBelongingToAllProfiles, Pattern schemaNameRegex, boolean convertWholeModel)
model
- The model whose profile definitions are not explicit (i.e.
classes without profile definitions belong to all profiles,
and properties without profile definitions inherit the
profiles of their class). Must not be null
.profilesForClassesBelongingToAllProfiles
- Set of profiles that shall be assigned to classes that belong
to all profiles (i.e., they do not have any profile definition
in the given model, which is what this method is meant to
convert into a set of explicit profile definitions). Must not
be null
.schemaNameRegex
- Regular expression to match the name of schemas in which the
profile definitions shall be converted to explicit ones. If
this parameter is null
, the conversion will be
applied to all classes and properties of the model if
parameter 'convertWholeModel' is true, otherwise just of the
schemas selected for processing.convertWholeModel
- true
if conversion shall be applied to all
classes of the model, false
if it shall only be
applied to the schemas selected for processing; irrelevant if
parameter 'schemaNameRegex' is not null
public static void removeProfiles(GenericModel genModel)
genModel
- public static void transferProfiles(SortedSet<String> namesOfProfilesToTransfer, ClassInfo sourceCi, ClassInfo targetCi)
namesOfProfilesToTransfer
- Names of profiles to transfer from the source to the target
class. If null
, all profiles shall be
transferred.sourceCi
- Source of profiles to be transferredtargetCi
- Target of the profile transferpublic static void transferProfiles(SortedSet<String> namesOfProfilesToTransfer, PropertyInfo sourcePi, PropertyInfo targetPi)
namesOfProfilesToTransfer
- Names of profiles to transfer from the source to the target
property. If null
, all profiles shall be
transferred.sourcePi
- Source of profiles to be transferredtargetPi
- Target of the profile transferCopyright © 2018. All rights reserved.