congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
javax.xml.xquery
Code IndexAdd Tabnine to your IDE (free)

How to use javax.xml.xquery

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

origin: dsukhoroslov/bagri

@Override
public String queryDocumentByUri(String uri) throws XQException {
  String query = "for $doc in fn:doc(\"" + uri + "\")\n" +
      "return $doc\n";
  XQExpression xqe = xqConn.createExpression();
  XQResultSequence xqs = xqe.executeQuery(query);
  String result = null;
  if (xqs.next()) {
    result = xqs.getItemAsString(null);
  }
  return result;
}
 
origin: dsukhoroslov/bagri

private void fireCloseEvent() {
  XQConnectionEvent event = new XQConnectionEvent(this);
  for (XQConnectionEventListener listener: listeners) {
    listener.connectionClosed(event);
  }
}
 
origin: dsukhoroslov/bagri

private void fireErrorEvent(XQException error) {
  XQConnectionEvent event = new XQConnectionEvent(this, error);
  for (XQConnectionEventListener listener: listeners) {
    listener.connectionErrorOccurred(event);
  }
}
 
origin: dsukhoroslov/bagri

@Override
public <T> ResultCursor<T> executeXQuery(String query, XQStaticContext ctx) throws XQException {
  // implement it? what for..?
    throw new XQException("Not implemented on the server side. Use another executeXQuery method taking Properties as a parameter instead");
}
 
origin: org.mule.modules/mule-module-xml

private Object getItemValue(XQItem item) throws XQException
{
  try
  {
    return item.getNode();
  }
  catch (XQException e)
  {
    return item.getAtomicValue();
  }
}
origin: org.mule.modules/mule-module-xml

@Override
public Object makeObject() throws Exception
{
  return connection.prepareExpression(xquery);
}
origin: org.mule.modules/mule-module-xml

@Override
public void dispose()
{
  try
  {
    connection.close();
  }
  catch (XQException e)
  {
    logger.warn(e.getMessage());
  }
}
origin: dsukhoroslov/bagri

@Override
public String queryDocumentFromCollection() throws XQException {
  String query = "for $doc in fn:collection()\n" +
      "return $doc\n";
  XQExpression xqe = xqConn.createExpression();
  XQResultSequence xqs = xqe.executeQuery(query);
  String result = null;
  if (xqs.next()) {
    result = xqs.getItemAsString(null);
  }
  return result;
}
 
origin: dsukhoroslov/bagri

@Override
public XQItemType getItemType() throws XQException {
  
  if (closed) {
    throw new XQException(ex_item_closed);
  }
  if (!positioned) {
    throw new XQException("not positioned on the Item");
  }
  return type;
}
origin: dsukhoroslov/bagri

@Override
public Object getObject() throws XQException {
  
  if (closed) {
    throw new XQException(ex_item_closed);
  }
  return value;
}
origin: dsukhoroslov/bagri

@Override
public void setCopyNamespacesModePreserve(int mode) throws XQException {
  
  if (mode != COPY_NAMESPACES_MODE_PRESERVE && mode != COPY_NAMESPACES_MODE_NO_PRESERVE) {
    throw new XQException("Wrong copy namespace mode preserve value: " + mode);
  }  
  this.copyNamespacesModePreserve = mode;
}
 
origin: dsukhoroslov/bagri

protected void checkAccess(boolean checkPosition) throws XQException {
  if (checkPosition && !positioned) {
    throw new XQException("Not positioned on an Item");
  }
  if (accessed) {
    throw new XQException("Item has been already accessed");
  }
}
 
origin: dsukhoroslov/bagri

@Override
public void setDefaultElementTypeNamespace(String uri) throws XQException {
  
  if (uri == null) {
    throw new XQException("Default element type namespace URI is null");
  }  
  defaultElementTypeNamespace = uri;
}
origin: dsukhoroslov/bagri

@Override
public void setDefaultCollation(String uri) throws XQException {
  
  if (uri == null) {
    throw new XQException("Default collation URI is null");
  }  
  this.defaultCollationUri = uri;
}
 
origin: dsukhoroslov/bagri

@Override
public void setQueryLanguageTypeAndVersion(int langType) throws XQException {
  
  if (langType != LANGTYPE_XQUERY && langType != LANGTYPE_XQUERYX) {
    throw new XQException("Wrong language type and version value: " + langType);
  }  
  // we do not support XQueryX, don't see how it can be set.. 
  this.queryLanguageTypeAndVersion = langType;
}
 
origin: dsukhoroslov/bagri

@Override
public void setQueryTimeout(int seconds) throws XQException {
  
  if (seconds < 0) {
    throw new XQException("Wrong query timeout value: " + seconds);
  }
  this.queryTimeout = seconds;
}
origin: dsukhoroslov/bagri

/** {@inheritDoc} */
@Override
public XQConnection getConnection(Connection connection) throws XQException {
  
  // will work only if the Connection provided is an 
  // another connection to the underlying cache
  throw new XQException("method not supported"); 
}
 
origin: dsukhoroslov/bagri

@Override
public void setCopyNamespacesModeInherit(int mode) throws XQException {
  
  if (mode != COPY_NAMESPACES_MODE_INHERIT && mode != COPY_NAMESPACES_MODE_NO_INHERIT) {
    throw new XQException("Wrong copy namespace mode inherit value: " + mode);
  }  
  this.copyNamespacesModeInherit = mode;
}
origin: dsukhoroslov/bagri

@Override
public void setBaseURI(String baseUri) throws XQException {
  
  if (baseUri == null) {
    throw new XQException("Base URI is null");
  }  
  this.baseUri = baseUri;
}
 
origin: dsukhoroslov/bagri

@Override
public void setBindingMode(int bindingMode) throws XQException {
  if (bindingMode != BINDING_MODE_IMMEDIATE && bindingMode != BINDING_MODE_DEFERRED) {
    throw new XQException("Wrong binding mode value: " + bindingMode);
  }  
  this.bindingMode = bindingMode;
}
 
javax.xml.xquery

Most used classes

  • XQPreparedExpression
    This interface describes an expression that can be prepared for multiple subsequent executions. A pr
  • XQResultSequence
    This interface represents a sequence of items obtained as a result of evaluation XQuery expressions.
  • XQConnection
    A connection (session) with a specific XQuery engine. Connections are obtained through an XQDataSour
  • XQException
    An exception that provides information on XQJ, XQuery or other errors reported by an XQJ implementat
  • XQDataSource
    An XQDataSource is a factory for XQConnection objects. The datasource may be obtained from a JNDI so
  • XQItemAccessor,
  • XQItemType,
  • XQSequence,
  • XQStaticContext,
  • XQDataFactory,
  • XQExpression,
  • XQDynamicContext,
  • PooledXQConnection,
  • XQCancelledException,
  • XQConnectionEvent,
  • XQConnectionEventListener,
  • XQQueryException,
  • XQSequenceType
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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