Examples of TransformationException


Examples of cc.redberry.transformation.TransformationException

    @Override
    public Tensor transform(Tensor tensor) {
        if (!(tensor instanceof Sum))
            return tensor;
        if(inputPort.closed())
            throw new TransformationException("Transformation destroied: create new instance.");
        for (Tensor summand : tensor)
            inputPort.put(summand);
        inputPort.put(null);
        return inputPort.result();
    }
View Full Code Here

Examples of com.blogspot.mydailyjava.dp.handler.TransformationException

            return new MethodDecoder(type.getDeclaredMethod(VALUE_OF_METHOD_NAME, String.class));
        } catch (NoSuchMethodException ignore) {
            try {
                return new ConstructorDecoder(type.getDeclaredConstructor(String.class));
            } catch (NoSuchMethodException e) {
                throw new TransformationException(String.format("%s is not a non-abstract type with a single String " +
                        "constructor or has a static valueOf(String) method", type));
            }
        }
    }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.transforms.TransformationException

            traverseElement(rootNode,sb);
            byte[] decodedBytes = Base64.decode(sb.toString());
     
            return new XMLSignatureInput(decodedBytes);
      } catch (ParserConfigurationException e) {
        throw new TransformationException("c14n.Canonicalizer.Exception",e);
      } catch (SAXException e) {
        throw new TransformationException("SAX exception", e);
      }     
  } catch (Base64DecodingException e) {
        throw new TransformationException("Base64Decoding", e);
  }
   }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.transforms.TransformationException

                                                XSLTSpecNS,"stylesheet", 0);

         if (_xsltElement == null) {
            Object exArgs[] = { "xslt:stylesheet", "Transform" };

            throw new TransformationException("xml.WrongContent", exArgs);
         }

         TransformerFactory tFactory = TransformerFactory.newInstance();
   // Process XSLT stylesheets in a secure manner
   tFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);

         /*
          * This transform requires an octet stream as input. If the actual
          * input is an XPath node-set, then the signature application should
          * attempt to convert it to octets (apply Canonical XML]) as described
          * in the Reference Processing Model (section 4.3.3.2).
          */
         Source xmlSource =
            new StreamSource(new ByteArrayInputStream(input.getBytes()));
         Source stylesheet;

         /*
          * This complicated transformation of the stylesheet itself is necessary
          * because of the need to get the pure style sheet. If we simply say
          * Source stylesheet = new DOMSource(this._xsltElement);
          * whereby this._xsltElement is not the rootElement of the Document,
          * this causes problems;
          * so we convert the stylesheet to byte[] and use this as input stream
          */
         {
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            Transformer transformer = tFactory.newTransformer();
            DOMSource source = new DOMSource(_xsltElement);
            StreamResult result = new StreamResult(os);

            transformer.transform(source, result);

            stylesheet =
               new StreamSource(new ByteArrayInputStream(os.toByteArray()));
         }

         Transformer transformer = tFactory.newTransformer(stylesheet);
         if (baos==null) {
               ByteArrayOutputStream baos1 = new ByteArrayOutputStream();
               StreamResult outputTarget = new StreamResult(baos1);
               transformer.transform(xmlSource, outputTarget);
               return new XMLSignatureInput(baos1.toByteArray());

         }
         StreamResult outputTarget = new StreamResult(baos);

         transformer.transform(xmlSource, outputTarget);        
         XMLSignatureInput output=new XMLSignatureInput((byte[])null);
         output.setOutputStream(baos);
         return output;
      } catch (XMLSecurityException ex) {
         Object exArgs[] = { ex.getMessage() };

         throw new TransformationException("generic.EmptyMessage", exArgs, ex);
      } catch (TransformerConfigurationException ex) {
         Object exArgs[] = { ex.getMessage() };

         throw new TransformationException("generic.EmptyMessage", exArgs, ex);
      } catch (TransformerException ex) {
         Object exArgs[] = { ex.getMessage() };

         throw new TransformationException("generic.EmptyMessage", exArgs, ex);
      }
   }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.transforms.TransformationException

        signatureElement = signatureElement.getParentNode();
      }

      if (!found) {
        throw new TransformationException(
         "envelopedSignatureTransformNotInSignatureElement");
      }
      return signatureElement;
    }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.transforms.TransformationException

               Constants._TAG_XPATH,0);

         if (xpathElement == null) {
            Object exArgs[] = { "ds:XPath", "Transform" };

            throw new TransformationException("xml.WrongContent", exArgs);
         }
         Node xpathnode = xpathElement.getChildNodes().item(0);
         String str=CachedXPathFuncHereAPI.getStrFromNode(xpathnode);
         input.setNeedsToBeExpanded(needsCircunvent(str));
         if (xpathnode == null) {
           throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                  "Text must be in ds:Xpath");
        }


         input.addNodeFilter(new XPathNodeFilter( xpathElement, xpathnode, str));
         input.setNodeSet(true);
         return input;
      } catch (DOMException ex) {
         throw new TransformationException("empty", ex);
      }
   }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.transforms.TransformationException

   protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input)
           throws  TransformationException {

      Object exArgs[] = { implementedTransformURI };

      throw new TransformationException(
         "signature.Transform.NotYetImplemented", exArgs);
   }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.transforms.TransformationException


         if (noOfSteps == 0) {
            Object exArgs[] = { Transforms.TRANSFORM_XPATH2FILTER, "XPath" };

            throw new TransformationException("xml.WrongContent", exArgs);
         }

         Document inputDoc = null;
   if (input.getSubNode() != null) {  
            inputDoc = XMLUtils.getOwnerDocument(input.getSubNode());
   } else {
            inputDoc = XMLUtils.getOwnerDocument(input.getNodeSet());
   }

         for (int i = 0; i < noOfSteps; i++) {
            Element xpathElement =XMLUtils.selectNode(
               this._transformObject.getElement().getFirstChild(),
                  XPath2FilterContainer.XPathFilter2NS,
                  XPath2FilterContainer._TAG_XPATH2,i);
            XPath2FilterContainer xpathContainer =
               XPath2FilterContainer.newInstance(xpathElement,
                                                   input.getSourceURI());
          

            NodeList subtreeRoots = xPathFuncHereAPI.selectNodeList(inputDoc,
                                       xpathContainer.getXPathFilterTextNode(),
                                       CachedXPathFuncHereAPI.getStrFromNode(xpathContainer.getXPathFilterTextNode()),
                                       xpathContainer.getElement());
            if (xpathContainer.isIntersect()) {
                intersectNodes.add(subtreeRoots);
             } else if (xpathContainer.isSubtract()) {
               substractNodes.add(subtreeRoots);
             } else if (xpathContainer.isUnion()) {
                unionNodes.add(subtreeRoots);
             }
         }

         input.setNeedsToBeExpanded(true);
        
         input.addNodeFilter(new XPath2NodeFilter(unionNodes,substractNodes,intersectNodes));
         input.setNodeSet(true);
         return input;
      } catch (TransformerException ex) {
         throw new TransformationException("empty", ex);
      } catch (DOMException ex) {
         throw new TransformationException("empty", ex);
      } catch (CanonicalizationException ex) {
         throw new TransformationException("empty", ex);
      } catch (InvalidCanonicalizerException ex) {
         throw new TransformationException("empty", ex);
      } catch (XMLSecurityException ex) {
         throw new TransformationException("empty", ex);
      } catch (SAXException ex) {
         throw new TransformationException("empty", ex);
      } catch (IOException ex) {
         throw new TransformationException("empty", ex);
      } catch (ParserConfigurationException ex) {
         throw new TransformationException("empty", ex);
      }
   }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.concurrent.jupiter.TransformationException

        }
        JupiterVectorTime remoteVectorTime = (JupiterVectorTime) timestamp;

        int remoteOperationCount = remoteVectorTime.getRemoteOperationCount();
        if (remoteOperationCount > localOperationCount) {
            throw new TransformationException(
                "precondition #2 violated (Remote vector time ("
                    + remoteOperationCount + ") is greater than"
                    + " local vector time (" + localOperationCount + ")).");
        }
View Full Code Here

Examples of eu.admire.dispel.graph.optimise.TransformationException

    public Graph transform(RequestContext context, Graph graph)
        throws TransformationException
    {
        if (mTypeChecker == null)
        {
            throw new TransformationException("Type checker must not be null.");
        }
        List<RequestNode> newNodes = new ArrayList<RequestNode>();
        for (RequestNode requestNode : graph.getNodes())
        {
            if (!(requestNode instanceof ProcessingElementNode))
            {
                continue;
            }
           
            ProcessingElementNode pe = (ProcessingElementNode)requestNode;
            ProcessingElementDescriptor descriptor =
                pe.getProcessingElementDescriptor();
            for (ProcessingElementInputDescriptor inputDescriptor : descriptor.getInputs())
            {
                Map<Integer, Connection> input =
                    requestNode.getAllInputs().get(inputDescriptor.getName());
                if (input == null)
                {
                    // we have an optional input that is not connected
                    // this is valid so we're just ignoring it
                        continue;
                }
                for (Entry<Integer, Connection> connection : input.entrySet())
                {
                    RequestNode source = connection.getValue().getSource();
                    String name = connection.getValue().getSourceOutputName();
                    ProcessingElementOutputDescriptor outputDescriptor =
                        getOutputDescriptor(source, name);
                    try
                    {
                        RequestNode converter =
                            mTypeChecker.checkCompatibility(
                                    outputDescriptor, inputDescriptor);
                        insertConverter(
                                newNodes,
                                requestNode,
                                connection.getValue(),
                                converter);
                    }
                    catch (Exception e)
                    {
                        throw new TransformationException(
                                "Types in output descriptor " + name
                                + "[" + connection.getValue().getSourceOutputIndex()
                                + "] of PE " + source.getName()
                                + " are not compatible with input descriptor "
                                + inputDescriptor.getName()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.