Package org.apache.ws.resource.properties.query

Examples of org.apache.ws.resource.properties.query.QueryEvaluationErrorException


            LOG.debug( MSG.getMessage( Keys.EVAL_XPATH, xpathExpr,
                    evalContextNode.getNodeName() ) );
        }
        if ( xpathExpr.getNamespaceContext() == null || !( xpathExpr.getNamespaceContext() instanceof Node ) )
        {
            throw new QueryEvaluationErrorException( MSG.getMessage( Keys.BAD_XPATH_NAMESPACE_CONTEXT ) );
        }
        try
        {
            XPath xpath = new DOMXPath( xpathExpr.getValue() );
            xpath.setNamespaceContext( new JaxenNamespaceContext( xpathExpr.getNamespaceContext() ) );
            return xpath.evaluate( evalContextNode );
        }
        catch ( JaxenException je )
        {
            throw new QueryEvaluationErrorException( MSG.getMessage( Keys.XPATH_FAILED, xpathExpr.getValue(),
                    je ) );
        }
    }
View Full Code Here


            LOG.debug( MSG.getMessage( Keys.EVAL_XPATH, xpathExpr,
                    evalContextNode.getNodeName() ) );
        }
        if ( xpathExpr.getNamespaceContext() == null || !( xpathExpr.getNamespaceContext() instanceof DomNamespaceContext ) )
        {
            throw new QueryEvaluationErrorException( MSG.getMessage( Keys.BAD_XPATH_NAMESPACE_CONTEXT ) );
        }
        DomNamespaceContext domNsContext = (DomNamespaceContext) xpathExpr.getNamespaceContext();
        XObject xResult;
        try
        {
            xResult = XPathAPI.eval( evalContextNode,
                    xpathExpr.getValue(),
                    domNsContext.getContextNode() );
        }
        catch ( Exception e )
        {
            throw new QueryEvaluationErrorException( MSG.getMessage( Keys.XPATH_FAILED, xpathExpr.getValue(),
                    e.getLocalizedMessage() ) );
        }
        return normalizeResult( xResult );
    }
View Full Code Here

      {
         return propsDocXBean.selectPath( xpathExpr.getValue(  ) );
      }
      catch ( RuntimeException re )
      {
         throw new QueryEvaluationErrorException( MSG.getMessage( Keys.QUERY_FAILED, xpathExpr.getValue(  ),re.getLocalizedMessage(  ) ));
      }
   }
View Full Code Here

                                  xpathExpr.getValue(  ),
                                  nsContextElem );
      }
      catch ( Exception e )
      {
         throw new QueryEvaluationErrorException( MSG.getMessage( Keys.XPATH_FAILED, xpathExpr.getValue(  ),
                                                                       e.getLocalizedMessage(  )));
      }

      return normalizeResult( xResult );
   }
View Full Code Here

                                    evalContextNode.getNodeName(  ) ) );
      }

      if ( ( xpathExpr.getNamespaceContext(  ) == null ) || !( xpathExpr.getNamespaceContext(  ) instanceof Node ) )
      {
         throw new QueryEvaluationErrorException( MSG.getMessage( Keys.BAD_XPATH_NAMESPACE_CONTEXT ) );
      }

      try
      {
         XPath xpath = new DOMXPath( xpathExpr.getValue(  ) );
         xpath.setNamespaceContext( new JaxenNamespaceContext( xpathExpr.getNamespaceContext(  ) ) );
         return xpath.evaluate( evalContextNode );
      }
      catch ( JaxenException je )
      {
         throw new QueryEvaluationErrorException( MSG.getMessage( Keys.XPATH_FAILED,
                                                                  xpathExpr.getValue(  ),
                                                                  je ) );
      }
   }
View Full Code Here

      }

      if ( ( xpathExpr.getNamespaceContext(  ) == null )
           || !( xpathExpr.getNamespaceContext(  ) instanceof DomNamespaceContext ) )
      {
         throw new QueryEvaluationErrorException( MSG.getMessage( Keys.BAD_XPATH_NAMESPACE_CONTEXT ) );
      }

      DomNamespaceContext domNsContext = (DomNamespaceContext) xpathExpr.getNamespaceContext(  );
      XObject             xResult;
      try
      {
         xResult = XPathAPI.eval( evalContextNode,
                                  xpathExpr.getValue(  ),
                                  domNsContext.getContextNode(  ) );
      }
      catch ( Exception e )
      {
         throw new QueryEvaluationErrorException( MSG.getMessage( Keys.XPATH_FAILED,
                                                                  xpathExpr.getValue(  ),
                                                                  e.getLocalizedMessage(  ) ) );
      }

      return normalizeResult( xResult );
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.properties.query.QueryEvaluationErrorException

Copyright © 2018 www.massapicom. 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.