congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
XQStaticContext
Code IndexAdd Tabnine to your IDE (free)

How to use
XQStaticContext
in
javax.xml.xquery

Best Java code snippets using javax.xml.xquery.XQStaticContext (Showing top 6 results out of 315)

origin: dsukhoroslov/bagri

String prop = props.getProperty(pn_xqj_baseURI);
if (prop != null) {
  ctx.setBaseURI(prop);
  ctx.setBindingMode(Integer.valueOf(prop));
  ctx.setBoundarySpacePolicy(Integer.valueOf(prop));
  ctx.setConstructionMode(Integer.valueOf(prop));
  ctx.setCopyNamespacesModeInherit(Integer.valueOf(prop));
  ctx.setCopyNamespacesModePreserve(Integer.valueOf(prop));
  ctx.setDefaultCollation(prop);
  ctx.setDefaultElementTypeNamespace(prop);
  ctx.setDefaultFunctionNamespace(prop);
  for (String ns: nspaces) {
    int pos = ns.indexOf(":");
    ctx.declareNamespace(ns.substring(0, pos), ns.substring(pos + 1));
  ctx.setDefaultOrderForEmptySequences(Integer.valueOf(prop));
  ctx.setHoldability(Integer.valueOf(prop));
  ctx.setOrderingMode(Integer.valueOf(prop));
origin: dsukhoroslov/bagri

public void copyFrom(XQStaticContext from) throws XQException {
  this.prefixes = null;
  this.namespaces.clear();
  for (String prefix: from.getNamespacePrefixes()) {
    this.declareNamespace(prefix, from.getNamespaceURI(prefix));
  }
  this.defaultElementTypeNamespace = from.getDefaultElementTypeNamespace();
  this.defaultFunctionNamespace = from.getDefaultFunctionNamespace();
  this.defaultCollationUri = from.getDefaultCollation();
  this.constructionMode = from.getConstructionMode();
  this.orderingMode = from.getOrderingMode();
  this.defaultOrderForEmptySequences = from.getDefaultOrderForEmptySequences();
  this.boundarySpacePolicy = from.getBoundarySpacePolicy();
  this.copyNamespacesModePreserve = from.getCopyNamespacesModePreserve();
  this.copyNamespacesModeInherit = from.getCopyNamespacesModeInherit();
  this.baseUri = from.getBaseURI();
  this.bindingMode = from.getBindingMode();
  this.holdability = from.getHoldability();
  this.queryLanguageTypeAndVersion = from.getQueryLanguageTypeAndVersion();
  this.scrollability = from.getScrollability();
  this.queryTimeout = from.getQueryTimeout();
  setContextItemStaticType(from.getContextItemStaticType());
}
origin: dsukhoroslov/bagri

protected void setStaticContext(StaticQueryContext sqc, XQStaticContext ctx) throws XQException {
  sqc.setBaseURI(ctx.getBaseURI());
  sqc.setPreserveBoundarySpace(ctx.getBoundarySpacePolicy() == BOUNDARY_SPACE_PRESERVE);
  if (ctx.getConstructionMode() == CONSTRUCTION_MODE_PRESERVE) {
    sqc.setConstructionMode(Validation.PRESERVE);
  } else {
  sqc.setInheritNamespaces(ctx.getCopyNamespacesModeInherit() == COPY_NAMESPACES_MODE_INHERIT);
  sqc.setPreserveNamespaces(ctx.getCopyNamespacesModePreserve() == COPY_NAMESPACES_MODE_PRESERVE);
  sqc.declareDefaultCollation(ctx.getDefaultCollation());
  sqc.setDefaultElementNamespace(ctx.getDefaultElementTypeNamespace());
  sqc.setDefaultFunctionNamespace(ctx.getDefaultFunctionNamespace());
  sqc.setEmptyLeast(ctx.getDefaultOrderForEmptySequences() == DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST);
  sqc.clearNamespaces();
  String[] prefixes = ctx.getNamespacePrefixes();
  for (String prefix: prefixes) {
    sqc.declareNamespace(prefix, ctx.getNamespaceURI(prefix));
  if (ctx.getQueryLanguageTypeAndVersion() == LANGTYPE_XQUERY) {
    sqc.setLanguageVersion(saxon_xquery_version); 
origin: org.jboss.soa.bpel/riftsaw-bpel-compiler

staticContext.declareNamespace(prefix, uri);
if ("".equals(prefix)) {
  declarations.declareDefaultElementNamespace(uri);
origin: org.jboss.soa.bpel/riftsaw-bpel-runtime

for (String prefix : prefixes) {
  String uri = nsContext.getNamespaceURI(prefix);
  staticEnv.declareNamespace(prefix, uri);
origin: dsukhoroslov/bagri

result.put(pn_xqj_baseURI, ctx.getBaseURI());
result.setProperty(pn_xqj_bindingMode, String.valueOf(ctx.getBindingMode()));
result.setProperty(pn_xqj_boundarySpacePolicy, String.valueOf(ctx.getBoundarySpacePolicy()));
result.setProperty(pn_xqj_constructionMode, String.valueOf(ctx.getConstructionMode()));
result.setProperty(pn_xqj_copyNamespacesModeInherit, String.valueOf(ctx.getCopyNamespacesModeInherit()));
result.setProperty(pn_xqj_copyNamespacesModePreserve, String.valueOf(ctx.getCopyNamespacesModePreserve()));
result.setProperty(pn_xqj_defaultCollationUri, ctx.getDefaultCollation());
result.setProperty(pn_xqj_defaultElementTypeNamespace, ctx.getDefaultElementTypeNamespace());
result.setProperty(pn_xqj_defaultFunctionNamespace, ctx.getDefaultFunctionNamespace());
if (ctx.getNamespacePrefixes().length > 0) {
  StringBuilder namespaces = new StringBuilder();
  for (String prefix: ctx.getNamespacePrefixes()) {
    namespaces.append(prefix).append(":").append(ctx.getNamespaceURI(prefix));
    namespaces.append(" ");
result.setProperty(pn_xqj_defaultOrderForEmptySequences, String.valueOf(ctx.getDefaultOrderForEmptySequences()));
result.setProperty(pn_xqj_holdability, String.valueOf(ctx.getHoldability()));
result.setProperty(pn_xqj_orderingMode, String.valueOf(ctx.getOrderingMode()));
result.setProperty(pn_xqj_queryLanguageTypeAndVersion, String.valueOf(ctx.getQueryLanguageTypeAndVersion()));
result.setProperty(pn_xqj_queryTimeout, String.valueOf(ctx.getQueryTimeout()));
result.setProperty(pn_xqj_scrollability, String.valueOf(ctx.getScrollability()));
return result;
javax.xml.xqueryXQStaticContext

Javadoc

An XQStaticContext represents default values for various XQuery Static Context Components. Further it includes the static XQJ properties for an XQExpression or XQPreparedExpression object.

The following XQuery Static Context Components are supported through the XQStaticContext interface:

  • Statically known namespaces
  • Default element/type namespace
  • Default function namespace
  • Context item static type
  • Default collation
  • Construction mode
  • Ordering mode
  • Default order for empty sequences
  • Boundary-space policy
  • Copy-namespaces mode
  • Base URI
As described in the XQuery specification, each of these default values can be overridden or augmented in the query prolog.

In addition XQStaticContext includes the static XQJ properties for an XQExpression or XQPreparedExpression object:

  • Binding mode
  • Holdability of the result sequences
  • Scrollability of the result sequences
  • Query language
  • Query timeout

Note that XQStaticContext is a value object, changing attributes in such object doesn't affect any existing XQExpression or XQPreparedExpression object.
In order to take effect, the application needs to explicitly change the XQConnection default values, or specify an XQStaticContext object when creating an XQExpression or XQPreparedExpression.

 
XQConnection conn = XQDatasource.getConnection(); 
// get the default values from the implementation 
XQStaticContext cntxt = conn.getStaticContext(); 
// change the base uri 
cntxt.setBaseURI("http://www.foo.com/xml/"); 
// change the implementation defaults 
conn.setStaticContext(cntxt); 
// create an XQExpression using the new defaults 
XQExpression expr1 = conn.createExpression(); 
// creat an XQExpression, using BaseURI "file:///root/user/john/" 
cntxt.setBaseURI("file:///root/user/john/"); 
XQExpression expr2 = conn.createExpression(cntxt); 
... 

Most used methods

  • declareNamespace
    Declares a namespace prefix and associates it with a namespace URI. If the namespace URI is the empt
  • getBaseURI
    Gets the Base URI, if set in the static context, else the empty string.
  • getBoundarySpacePolicy
    Gets the boundary-space policy defined in the static context.
  • getConstructionMode
    Gets the construction mode defined in the static context.
  • getCopyNamespacesModeInherit
    Gets the inherit part of the copy-namespaces mode defined in the static context.
  • getCopyNamespacesModePreserve
    Gets the preserve part of the copy-namespaces mode defined in the static context.
  • getDefaultCollation
    Gets the URI of the default collation.
  • getDefaultElementTypeNamespace
    Gets the URI of the default element/type namespace, the empty string if not set.
  • getDefaultFunctionNamespace
    Gets the URI of the default function namespace, the empty string if not set.
  • getDefaultOrderForEmptySequences
    Gets the default order for empty sequences defined in the static context.
  • getNamespacePrefixes
    Returns the prefixes of all the statically known namespaces. Use the getNamespaceURI method to look
  • getNamespaceURI
    Retrieves the namespace URI associated with a prefix. An XQException is thrown if an unknown prefix
  • getNamespacePrefixes,
  • getNamespaceURI,
  • getQueryLanguageTypeAndVersion,
  • getBindingMode,
  • getHoldability,
  • getOrderingMode,
  • getQueryTimeout,
  • getScrollability,
  • getContextItemStaticType,
  • setBaseURI

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Permission (java.security)
    Legacy security code; do not use.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • JTable (javax.swing)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now