Examples of TransformationException


Examples of org.apache.xml.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 org.glassfish.grizzly.TransformationException

            if (expectedLength == -1 || originalMessage.remaining() < expectedLength) {
                return TransformationResult.createIncompletedResult(
                            originalMessage);
            }
        } catch (SSLException e) {
            throw new TransformationException(e);
        }
       
        final Buffer targetBuffer = memoryManager.allocate(
                    sslEngine.getSession().getApplicationBufferSize());

        TransformationResult<Buffer, Buffer> transformationResult = null;

        try {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE, "SSLDecoder engine: {0} input: {1} output: {2}",
                        new Object[]{sslEngine, originalMessage, targetBuffer});
            }

            final int pos = originalMessage.position();
            final SSLEngineResult sslEngineResult;
            if (!originalMessage.isComposite()) {
                sslEngineResult = sslEngine.unwrap(originalMessage.toByteBuffer(),
                        targetBuffer.toByteBuffer());
            } else {
                final ByteBuffer originalByteBuffer =
                        originalMessage.toByteBuffer(pos,
                        pos + expectedLength);

                sslEngineResult = sslEngine.unwrap(originalByteBuffer,
                        targetBuffer.toByteBuffer());
            }
           
            originalMessage.position(pos + sslEngineResult.bytesConsumed());
            targetBuffer.position(sslEngineResult.bytesProduced());


            final SSLEngineResult.Status status = sslEngineResult.getStatus();

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE, "SSLDecoderr done engine: {0} result: {1} input: {2} output: {3}",
                        new Object[]{sslEngine, sslEngineResult, originalMessage, targetBuffer});
            }

            if (status == SSLEngineResult.Status.OK) {
                targetBuffer.trim();

                return TransformationResult.createCompletedResult(
                        targetBuffer, originalMessage);
            } else if (status == SSLEngineResult.Status.CLOSED) {
                targetBuffer.dispose();

                return TransformationResult.createCompletedResult(
                        Buffers.EMPTY_BUFFER, originalMessage);
            } else {
                targetBuffer.dispose();

                if (status == SSLEngineResult.Status.BUFFER_UNDERFLOW) {
                    transformationResult =
                            TransformationResult.createIncompletedResult(
                            originalMessage);
                } else if (status == SSLEngineResult.Status.BUFFER_OVERFLOW) {
                    transformationResult =
                            TransformationResult.createErrorResult(
                            BUFFER_OVERFLOW_ERROR,
                            "Buffer overflow during unwrap operation");
                }
            }
        } catch (SSLException e) {
            targetBuffer.dispose();
            throw new TransformationException(e);
        }

        return transformationResult;
    }
View Full Code Here

Examples of org.jboss.soa.esb.services.transform.TransformationException

   */
  public Message transform(Message message) throws TransformationException {
    try {
      return process(message);
    } catch (ActionProcessingException e) {
      throw new TransformationException(e);
    }
  }
View Full Code Here

Examples of org.openhab.core.transform.TransformationException

   * @{inheritDoc
   */
  public String transform(String regExpression, String source) throws TransformationException {
   
    if (regExpression == null || source == null) {
      throw new TransformationException("the given parameters 'regex' and 'source' must not be null");
    }

    logger.debug("about to transform '{}' by the function '{}'", source, regExpression);

    String result = source;
View Full Code Here

Examples of org.teiid.core.types.TransformationException

   */
  public Object transformDirect(Object value) throws TransformationException {
    try {
      return Long.valueOf(((String)value).trim());
    } catch(NumberFormatException e) {
      throw new TransformationException("ERR.003.029.0022", CorePlugin.Util.getString("ERR.003.029.0022", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

Examples of org.teiid.core.types.TransformationException

   */
  public Object transformDirect(Object value) throws TransformationException {
    try {
      return new BigInteger(((String)value).trim());
    } catch(NumberFormatException e) {
      throw new TransformationException("ERR.003.029.0015", CorePlugin.Util.getString("ERR.003.029.0015", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

Examples of org.teiid.core.types.TransformationException

           }
             while (xmlReader.hasNext()) {
               xmlReader.next();
             }
        } catch (Exception e){
            throw new TransformationException(e, CorePlugin.Util.getString("invalid_string")); //$NON-NLS-1$
        } finally {
          try {
        reader.close();
      } catch (IOException e) {
      }
View Full Code Here

Examples of org.teiid.core.types.TransformationException

   */
  public Object transformDirect(Object value) throws TransformationException {
    try {
      return Double.valueOf((String)value);
    } catch(NumberFormatException e) {
      throw new TransformationException("ERR.003.029.0019", CorePlugin.Util.getString("ERR.003.029.0019", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

Examples of org.teiid.core.types.TransformationException

   */
  public Object transformDirect(Object value) throws TransformationException {
    try {
      return new BigDecimal(((String)value).trim());
    } catch(NumberFormatException e) {
      throw new TransformationException("ERR.003.029.0014", CorePlugin.Util.getString("ERR.003.029.0014", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

Examples of org.teiid.core.types.TransformationException

    value = ((String) value).trim();
    Timestamp result = null;
    try {
      result = Timestamp.valueOf( (String) value );
    } catch(Exception e) {
      throw new TransformationException(e, "ERR.003.029.0024", CorePlugin.Util.getString("ERR.003.029.0024", value)); //$NON-NLS-1$ //$NON-NLS-2$
    }
    //validate everything except for fractional seconds
    if (!((String)value).startsWith(result.toString().substring(0, 19))) {
      throw new TransformationException(CorePlugin.Util.getString("transform.invalid_string_for_date", value, getTargetType().getSimpleName())); //$NON-NLS-1$
    }
    return result;
  }
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.