javax.xml.xquery.XQPreparedExpression.getAllExternalVariables()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中javax.xml.xquery.XQPreparedExpression.getAllExternalVariables()方法的一些代码示例,展示了XQPreparedExpression.getAllExternalVariables()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XQPreparedExpression.getAllExternalVariables()方法的具体详情如下:
包路径:javax.xml.xquery.XQPreparedExpression
类名称:XQPreparedExpression
方法名:getAllExternalVariables

XQPreparedExpression.getAllExternalVariables介绍

[英]Retrieves all the external variables defined in the prolog of the prepared expression.
[中]检索在准备好的表达式的序言中定义的所有外部变量。

代码示例

代码示例来源:origin: spring-projects/spring-integration-extensions

  1. XQConnection conn = getConnection();
  2. XQPreparedExpression expression = conn.prepareExpression(xQuery);
  3. QName[] extParameters = expression.getAllExternalVariables();
  4. if(extParameters != null && extParameters.length > 0) {
  5. xQueryParameters = new ArrayList<String>();

代码示例来源:origin: dsukhoroslov/bagri

  1. @ManagedOperation(description="Parse XQuery. Return array of parameter names, if any")
  2. @ManagedOperationParameters({
  3. @ManagedOperationParameter(name = "query", description = "A query request provided in XQuery syntax"),
  4. @ManagedOperationParameter(name = "props", description = "Query processing properties")})
  5. public String[] parseQuery(String query, Properties props) {
  6. XQPreparedExpression xqpExp = null;
  7. try {
  8. XQStaticContext ctx = xqConn.getStaticContext();
  9. props2Context(schemaManager.getEntity().getProperties(), ctx);
  10. props2Context(props, ctx);
  11. xqpExp = xqConn.prepareExpression(query, ctx);
  12. QName[] vars = xqpExp.getAllExternalVariables();
  13. String[] result = null;
  14. if (vars != null) {
  15. result = new String[vars.length];
  16. for (int i=0; i < vars.length; i++) {
  17. result[i] = vars[i].toString();
  18. }
  19. }
  20. xqpExp.close();
  21. return result;
  22. } catch (XQException ex) {
  23. logger.error("parseQuery.error", ex);
  24. throw new RuntimeException(ex.getMessage());
  25. }
  26. }

相关文章