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 --- .../spss/server/invoke/TransformationFactory.java | 165 ++++++++++----------- 1 file changed, 82 insertions(+), 83 deletions(-) (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java') diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java index 7842f14..1eec502 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/TransformationFactory.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; @@ -30,14 +29,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import iaik.server.modules.xml.Base64Transformation; -import iaik.server.modules.xml.Canonicalization; -import iaik.server.modules.xml.EnvelopedSignatureTransformation; -import iaik.server.modules.xml.Transformation; -import iaik.server.modules.xml.XPath2Transformation; -import iaik.server.modules.xml.XPathTransformation; -import iaik.server.modules.xml.XSLTTransformation; - import at.gv.egovernment.moa.spss.MOAApplicationException; import at.gv.egovernment.moa.spss.api.common.ExclusiveCanonicalizationTransform; import at.gv.egovernment.moa.spss.api.common.Transform; @@ -53,41 +44,49 @@ import at.gv.egovernment.moa.spss.server.iaik.xml.XPath2FilterImpl; import at.gv.egovernment.moa.spss.server.iaik.xml.XPath2TransformationImpl; import at.gv.egovernment.moa.spss.server.iaik.xml.XPathTransformationImpl; import at.gv.egovernment.moa.spss.server.iaik.xml.XSLTTransformationImpl; +import iaik.server.modules.xml.Base64Transformation; +import iaik.server.modules.xml.Canonicalization; +import iaik.server.modules.xml.EnvelopedSignatureTransformation; +import iaik.server.modules.xml.Transformation; +import iaik.server.modules.xml.XPath2Transformation; +import iaik.server.modules.xml.XPathTransformation; +import iaik.server.modules.xml.XSLTTransformation; /** - * A factory to create Transformation objects from + * A factory to create Transformation objects from * Transform objects. - * + * * @author Patrick Peck * @version $Id$ */ public class TransformationFactory { - /** The single instance of this class. */ private static TransformationFactory instance = null; - /** Maps XPathFilter filter types to - * XPath2Transformation filter types. */ + /** + * Maps XPathFilter filter types to + * XPath2Transformation filter types. + */ private static Map FILTER_TYPE_MAPPING; static { FILTER_TYPE_MAPPING = new HashMap(); FILTER_TYPE_MAPPING.put( - XPathFilter.INTERSECT_TYPE, - XPath2Transformation.XPath2Filter.INTERSECTION); + XPathFilter.INTERSECT_TYPE, + XPath2Transformation.XPath2Filter.INTERSECTION); FILTER_TYPE_MAPPING.put( - XPathFilter.SUBTRACT_TYPE, - XPath2Transformation.XPath2Filter.SUBTRACTION); + XPathFilter.SUBTRACT_TYPE, + XPath2Transformation.XPath2Filter.SUBTRACTION); FILTER_TYPE_MAPPING.put( - XPathFilter.UNION_TYPE, - XPath2Transformation.XPath2Filter.UNION); + XPathFilter.UNION_TYPE, + XPath2Transformation.XPath2Filter.UNION); } /** * Get the single instance of the factory. - * + * * @return TransformationFactory The single instance. */ public static synchronized TransformationFactory getInstance() { @@ -99,37 +98,36 @@ public class TransformationFactory { /** * Create a new TransformationFactory. - * + * * Protected to disallow multiple instances. */ protected TransformationFactory() { } /** - * Create a Transformation based on a - * Transform object. - * - * @param transform The Transform object to extract - * transformation data from. - * @return The transformation contained in the transform + * Create a Transformation based on a Transform * object. + * + * @param transform The Transform object to extract transformation + * data from. + * @return The transformation contained in the transform object. * @throws MOAApplicationException An error occured creating the - * Transformation. See exception message for details. + * Transformation. See exception + * message for details. */ public Transformation createTransformation(Transform transform) - throws MOAApplicationException { - String algorithmUri = transform.getAlgorithmURI(); + throws MOAApplicationException { + final String algorithmUri = transform.getAlgorithmURI(); if (Canonicalization.CANONICAL_XML.equals(algorithmUri) - || Canonicalization.CANONICAL_XML_WITH_COMMENTS.equals(algorithmUri)) { + || Canonicalization.CANONICAL_XML_WITH_COMMENTS.equals(algorithmUri)) { return createC14nTransformation(algorithmUri); - } else if ( - Canonicalization.EXCLUSIVE_CANONICAL_XML.equals(algorithmUri) + } else if (Canonicalization.EXCLUSIVE_CANONICAL_XML.equals(algorithmUri) || Canonicalization.EXCLUSIVE_CANONICAL_XML_WITH_COMMENTS.equals( - algorithmUri)) { + algorithmUri)) { return createExclusiveC14nTransformation( - (ExclusiveCanonicalizationTransform) transform); + (ExclusiveCanonicalizationTransform) transform); } else if (Base64Transformation.ALL.contains(algorithmUri)) { return createBase64Transformation(); @@ -147,23 +145,24 @@ public class TransformationFactory { } /** - * Create a List of Transformations from a + * Create a List of Transformations from a * List of Transforms. - * - * @param transforms The List containing the - * Transforms. + * + * @param transforms The List containing the + * Transforms. * @return The List of Transformations corresponding - * to the transforms. + * to the transforms. * @throws MOAApplicationException An error occurred building one of the - * transformations. See exception message for details. + * transformations. See exception message for + * details. */ public List createTransformationList(List transforms) - throws MOAApplicationException { - List transformationList = new ArrayList(); + throws MOAApplicationException { + final List transformationList = new ArrayList(); Iterator trIter; for (trIter = transforms.iterator(); trIter.hasNext();) { - Transform transform = (Transform) trIter.next(); + final Transform transform = (Transform) trIter.next(); transformationList.add(createTransformation(transform)); } @@ -172,7 +171,7 @@ public class TransformationFactory { /** * Create a Canonicalization. - * + * * @param algorithmUri The algorithm URI of the canonicalization. * @return The Canonicalization. */ @@ -182,20 +181,20 @@ public class TransformationFactory { /** * Create a ExclusiveCanonicalization. - * - * @param transform The ExclusiveCanonicalizationTransform - * containing the transformation data. + * + * @param transform The ExclusiveCanonicalizationTransform + * containing the transformation data. * @return The ExclusiveCanonicalization. */ private Transformation createExclusiveC14nTransformation(ExclusiveCanonicalizationTransform transform) { return new ExclusiveCanonicalizationImpl( - transform.getAlgorithmURI(), - transform.getInclusiveNamespacePrefixes()); + transform.getAlgorithmURI(), + transform.getInclusiveNamespacePrefixes()); } /** * Create a Base64Transformation. - * + * * @return The */ private Transformation createBase64Transformation() { @@ -204,7 +203,7 @@ public class TransformationFactory { /** * Create an EnvelopedSignatureTransformation. - * + * * @return An EnvelopedSignatureTransformation. */ private Transformation createEnvelopedSignatureTransformation() { @@ -213,47 +212,47 @@ public class TransformationFactory { /** * Create an XPathTransformation. - * - * @param transform The Transform object containing the - * XPath transformation. - * @return An XPathTransformation corresponding the - * transformation given in transform. - * @throws MOAApplicationException An error occurred creating the - * Transformation. + * + * @param transform The Transform object containing the XPath + * transformation. + * @return An XPathTransformation corresponding the transformation + * given in transform. + * @throws MOAApplicationException An error occurred creating the + * Transformation. */ private Transformation createXPathTransformation(XPathTransform transform) - throws MOAApplicationException { + throws MOAApplicationException { return new XPathTransformationImpl( - transform.getXPathExpression(), - transform.getNamespaceDeclarations()); + transform.getXPathExpression(), + transform.getNamespaceDeclarations()); } /** * Create an XPath2Transformation. - * - * @param transform The Transform object containing the - * XPath filter transformation. - * @return An XPath2Transformation corresponding the - * transformation given in transform. + * + * @param transform The Transform object containing the XPath + * filter transformation. + * @return An XPath2Transformation corresponding the transformation + * given in transform. * @throws MOAApplicationException An error occurred creating the - * Transformation. + * Transformation. */ private Transformation createXPath2Transformation(XPathFilter2Transform transform) - throws MOAApplicationException { + throws MOAApplicationException { - XPath2TransformationImpl xpath2 = new XPath2TransformationImpl(); + final XPath2TransformationImpl xpath2 = new XPath2TransformationImpl(); Iterator iter; for (iter = transform.getFilters().iterator(); iter.hasNext();) { - XPathFilter filter = (XPathFilter) iter.next(); - String mappedFilterType = - (String) FILTER_TYPE_MAPPING.get(filter.getFilterType()); - XPath2FilterImpl mappedFilter = - new XPath2FilterImpl( - mappedFilterType, - filter.getXPathExpression(), - filter.getNamespaceDeclarations()); + final XPathFilter filter = (XPathFilter) iter.next(); + final String mappedFilterType = + (String) FILTER_TYPE_MAPPING.get(filter.getFilterType()); + final XPath2FilterImpl mappedFilter = + new XPath2FilterImpl( + mappedFilterType, + filter.getXPathExpression(), + filter.getNamespaceDeclarations()); xpath2.addXPathFilter(mappedFilter); } @@ -266,15 +265,15 @@ public class TransformationFactory { /** * Create an XSLTTransformation. - * + * * @param transform The Transform containing the XSLT stylesheet. * @return An XSLTTransformation corresponding the transformation - * given in transform. + * given in transform. * @throws MOAApplicationException An error occurred creating the - * Transformation. + * Transformation. */ private Transformation createXSLTTransformation(XSLTTransform transform) - throws MOAApplicationException { + throws MOAApplicationException { return new XSLTTransformationImpl(transform.getStylesheet()); } -- cgit v1.2.3