From 578ad0d6bc408edf9e6c875156054374f5fd8337 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Mon, 22 Mar 2021 18:40:26 +0100 Subject: change to EGIZ codestyle --- .../moa/spss/server/invoke/ProfileMapper.java | 187 ++++++++++----------- 1 file changed, 90 insertions(+), 97 deletions(-) (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java') diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java index c6eaa4f..474e74b 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/ProfileMapper.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moa.spss.server.invoke; import java.util.ArrayList; @@ -48,7 +47,7 @@ import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; /** * Map ProfileID objects to their explicit represantation. - * + * * @author Patrick Peck * @version $Id$ */ @@ -58,83 +57,79 @@ public class ProfileMapper { private static ProfileParser profileParser = new ProfileParser(); /** - * Map a CreateTransformsInfoProfile to a + * Map a CreateTransformsInfoProfile to a * CreateTransformsInfoProfileExplicit. - * + * * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. + * @param config The MOA configuration to use for looking up the profile. * @return profile, if the given profile is of type - * EXPLICIT_CREATETRANSFORMSINFOPROFILE, otherwise the profile - * that is looked up and parsed from the configuration. + * EXPLICIT_CREATETRANSFORMSINFOPROFILE, otherwise the + * profile that is looked up and parsed from the configuration. * @throws MOAApplicationException An error occurred parsing the profile. */ public static CreateTransformsInfoProfileExplicit mapCreateTransformsInfoProfile( - CreateTransformsInfoProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { + CreateTransformsInfoProfile profile, + ConfigurationProvider config) + throws MOAApplicationException { switch (profile.getCreateTransformsInfoProfileType()) { - case CreateTransformsInfoProfile.EXPLICIT_CREATETRANSFORMSINFOPROFILE : + case CreateTransformsInfoProfile.EXPLICIT_CREATETRANSFORMSINFOPROFILE: return (CreateTransformsInfoProfileExplicit) profile; - case CreateTransformsInfoProfile.ID_CREATETRANSFORMSINFOPROFILE : - CreateTransformsInfoProfileID profileIdObj = - (CreateTransformsInfoProfileID) profile; - String profileID = profileIdObj.getCreateTransformsInfoProfileID(); - Element profileElem = config.getCreateTransformsInfoProfile(profileID); + case CreateTransformsInfoProfile.ID_CREATETRANSFORMSINFOPROFILE: + final CreateTransformsInfoProfileID profileIdObj = + (CreateTransformsInfoProfileID) profile; + final String profileID = profileIdObj.getCreateTransformsInfoProfileID(); + final Element profileElem = config.getCreateTransformsInfoProfile(profileID); if (profileElem == null) { throw new MOAApplicationException("2234", new Object[] { profileID }); } - return ( - CreateTransformsInfoProfileExplicit) profileParser + return (CreateTransformsInfoProfileExplicit) profileParser .parseCreateTransformsInfoProfile( - profileElem); + profileElem); } return null; // this will not happen } /** - * Map a CreateSignatureEnvironmentProfile to a + * Map a CreateSignatureEnvironmentProfile to a * CreateSignatureEnvironmentProfileExplicit. - * + * * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. + * @param config The MOA configuration to use for looking up the profile. * @return profile, if the given profile is of type - * EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE, otherwise the - * profile that is looked up and parsed from the configuration. + * EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE, otherwise + * the profile that is looked up and parsed from the configuration. * @throws MOAApplicationException An error occurred parsing the profile. */ public static CreateSignatureEnvironmentProfileExplicit mapCreateSignatureEnvironmentProfile( - CreateSignatureEnvironmentProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { + CreateSignatureEnvironmentProfile profile, + ConfigurationProvider config) + throws MOAApplicationException { switch (profile.getCreateSignatureEnvironmentProfileType()) { - case CreateSignatureEnvironmentProfile - .EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE : + case CreateSignatureEnvironmentProfile.EXPLICIT_CREATESIGNATUREENVIRONMENTPROFILE: return (CreateSignatureEnvironmentProfileExplicit) profile; - case CreateSignatureEnvironmentProfile - .ID_CREATESIGNATUREENVIRONMENTPROFILE : + case CreateSignatureEnvironmentProfile.ID_CREATESIGNATUREENVIRONMENTPROFILE: - CreateSignatureEnvironmentProfileID profileIdObj = - (CreateSignatureEnvironmentProfileID) profile; - String profileID = - profileIdObj.getCreateSignatureEnvironmentProfileID(); - Element profileElem = - config.getCreateSignatureEnvironmentProfile(profileID); + final CreateSignatureEnvironmentProfileID profileIdObj = + (CreateSignatureEnvironmentProfileID) profile; + final String profileID = + profileIdObj.getCreateSignatureEnvironmentProfileID(); + final Element profileElem = + config.getCreateSignatureEnvironmentProfile(profileID); if (profileElem == null) { throw new MOAApplicationException("2236", new Object[] { profileID }); } - return ( - CreateSignatureEnvironmentProfileExplicit) profileParser + return (CreateSignatureEnvironmentProfileExplicit) profileParser .parseCreateSignatureEnvironmentProfile( - profileElem); + profileElem); } return null; @@ -142,25 +137,25 @@ public class ProfileMapper { } /** - * Map a List of SupplementProfiles to their - * explicit representation. - * + * Map a List of SupplementProfiles to their explicit + * representation. + * * @param profiles The profiles to map. - * @param config The MOA configuration to use for looking up profiles. + * @param config The MOA configuration to use for looking up profiles. * @return The mapped profiles. * @throws MOAApplicationException An error occurred mapping one of the - * profiles. + * profiles. */ public static List mapSupplementProfiles( - List profiles, - ConfigurationProvider config) - throws MOAApplicationException { + List profiles, + ConfigurationProvider config) + throws MOAApplicationException { - List mappedProfiles = new ArrayList(); + final List mappedProfiles = new ArrayList(); Iterator iter; for (iter = profiles.iterator(); iter.hasNext();) { - SupplementProfile profile = (SupplementProfile) iter.next(); + final SupplementProfile profile = (SupplementProfile) iter.next(); mappedProfiles.add(mapSupplementProfile(profile, config)); } @@ -168,63 +163,62 @@ public class ProfileMapper { } /** - * Map a SupplementProfile to a + * Map a SupplementProfile to a * SupplementProfileExplicit. - * + * * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. + * @param config The MOA configuration to use for looking up the profile. * @return profile, if the given profile is of type - * EXPLICIT_SUPPLEMENTPROFILE, otherwise the - * profile that is looked up and parsed from the configuration. + * EXPLICIT_SUPPLEMENTPROFILE, otherwise the profile that + * is looked up and parsed from the configuration. * @throws MOAApplicationException An error occurred parsing the profile. */ public static SupplementProfileExplicit mapSupplementProfile( - SupplementProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { + SupplementProfile profile, + ConfigurationProvider config) + throws MOAApplicationException { switch (profile.getSupplementProfileType()) { - case SupplementProfile.EXPLICIT_SUPPLEMENTPROFILE : + case SupplementProfile.EXPLICIT_SUPPLEMENTPROFILE: return (SupplementProfileExplicit) profile; - case SupplementProfile.ID_SUPPLEMENTPROFILE : - SupplementProfileID profileIdObj = (SupplementProfileID) profile; - String profileID = profileIdObj.getSupplementProfileID(); - Element profileElem = config.getSupplementProfile(profileID); + case SupplementProfile.ID_SUPPLEMENTPROFILE: + final SupplementProfileID profileIdObj = (SupplementProfileID) profile; + final String profileID = profileIdObj.getSupplementProfileID(); + final Element profileElem = config.getSupplementProfile(profileID); if (profileElem == null) { throw new MOAApplicationException("2267", new Object[] { profileID }); } - return ( - SupplementProfileExplicit) profileParser.parseSupplementProfile( - profileElem); + return (SupplementProfileExplicit) profileParser.parseSupplementProfile( + profileElem); } return null; } /** - * Map a List of VerifyTransformsInfoProfiles to - * their explicit representation. - * + * Map a List of VerifyTransformsInfoProfiles to their + * explicit representation. + * * @param profiles The profiles to map. - * @param config The MOA configuration to use for looking up profiles. + * @param config The MOA configuration to use for looking up profiles. * @return The mapped profiles. * @throws MOAApplicationException An error occurred mapping one of the - * profiles. + * profiles. */ public static List mapVerifyTransformsInfoProfiles( - List profiles, - ConfigurationProvider config) - throws MOAApplicationException { + List profiles, + ConfigurationProvider config) + throws MOAApplicationException { - List mappedProfiles = new ArrayList(); + final List mappedProfiles = new ArrayList(); Iterator iter; for (iter = profiles.iterator(); iter.hasNext();) { - VerifyTransformsInfoProfile profile = - (VerifyTransformsInfoProfile) iter.next(); + final VerifyTransformsInfoProfile profile = + (VerifyTransformsInfoProfile) iter.next(); mappedProfiles.add(mapVerifyTransformsInfoProfile(profile, config)); } @@ -232,40 +226,39 @@ public class ProfileMapper { } /** - * Map a VerifyTransformsInfoProfile to a + * Map a VerifyTransformsInfoProfile to a * VerifyTransformsInfoProfileExplicit. - * + * * @param profile The profile object to map. - * @param config The MOA configuration to use for looking up the profile. + * @param config The MOA configuration to use for looking up the profile. * @return profile, if the given profile is of type - * EXPLICIT_VERIFYTRANSFORMSINFOPROFILE, otherwise the - * profile that is looked up and parsed from the configuration. + * EXPLICIT_VERIFYTRANSFORMSINFOPROFILE, otherwise the + * profile that is looked up and parsed from the configuration. * @throws MOAApplicationException An error occurred parsing the profile. */ public static VerifyTransformsInfoProfileExplicit mapVerifyTransformsInfoProfile( - VerifyTransformsInfoProfile profile, - ConfigurationProvider config) - throws MOAApplicationException { + VerifyTransformsInfoProfile profile, + ConfigurationProvider config) + throws MOAApplicationException { switch (profile.getVerifyTransformsInfoProfileType()) { - case VerifyTransformsInfoProfile.EXPLICIT_VERIFYTRANSFORMSINFOPROFILE : + case VerifyTransformsInfoProfile.EXPLICIT_VERIFYTRANSFORMSINFOPROFILE: return (VerifyTransformsInfoProfileExplicit) profile; - case VerifyTransformsInfoProfile.ID_VERIFYTRANSFORMSINFOPROFILE : - VerifyTransformsInfoProfileID profileIdObj = - (VerifyTransformsInfoProfileID) profile; - String profileID = profileIdObj.getVerifyTransformsInfoProfileID(); - Element profileElem = - config.getVerifyTransformsInfoProfile(profileID); - + case VerifyTransformsInfoProfile.ID_VERIFYTRANSFORMSINFOPROFILE: + final VerifyTransformsInfoProfileID profileIdObj = + (VerifyTransformsInfoProfileID) profile; + final String profileID = profileIdObj.getVerifyTransformsInfoProfileID(); + final Element profileElem = + config.getVerifyTransformsInfoProfile(profileID); + if (profileElem == null) { - throw new MOAApplicationException("2268", new Object[] { profileID }); + throw new MOAApplicationException("2268", new Object[] { profileID }); } - return ( - VerifyTransformsInfoProfileExplicit) profileParser + return (VerifyTransformsInfoProfileExplicit) profileParser .parseVerifyTransformsInfoProfile( - profileElem); + profileElem); } return null; -- cgit v1.2.3