Package org.exist.xquery.value

Examples of org.exist.xquery.value.StringValue


      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
   
    if (value.getObject() instanceof RequestWrapper) {
      return new StringValue(((RequestWrapper) value.getObject()).getRemoteHost());
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here


    private Sequence copyListToValueSequence(List<String> collectionNames) {
        final ValueSequence seq = new ValueSequence(collectionNames.size());
       
        for(final String collectionName : collectionNames) {
            seq.add(new StringValue(collectionName));
        }
       
        return seq;
    }
View Full Code Here

          }
          else
          {
            prevUpdateErrors = (ValueSequence)XPathUtil.javaObjectToXPath(ctxVarObj, context);
          }
          prevUpdateErrors.add(new StringValue(xpe.getMessage()));
      context.setXQueryContextVar(XQueryContext.XQUERY_CONTEXTVAR_XQUERY_UPDATE_ERROR, prevUpdateErrors);
     
          if(!inSeq.isEmpty())
            {throw xpe;//TODO: should we trap this instead of throwing an exception - deliriumsky?
        }
View Full Code Here

      if(fnames == null) {
        return Sequence.EMPTY_SEQUENCE;
      }
      final ValueSequence result = new ValueSequence();
      for (final String name: fnames) {
        result.add(new StringValue(name));
      }
      return result;
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

                {
                        final ValueSequence result = new ValueSequence();
                        for (final Enumeration<String> e = ((RequestWrapper) value.getObject()).getHeaderNames(); e.hasMoreElements();)
                        {
                                final String param = e.nextElement();
                                result.add(new StringValue(param));
                        }
                        return result;
                }
                else
                  {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
View Full Code Here

      {throw new XPathException(this, "Variable $request is not bound to an Java object.");}

    final JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
    if (value.getObject() instanceof RequestWrapper) {
            final String path = ((RequestWrapper) value.getObject()).getPathInfo();
            return new StringValue(path == null ? "" : path);
        } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

      final Collection newCollection = createCollectionPath(collection, collectionName);

      if (newCollection == null)
    {return Sequence.EMPTY_SEQUENCE;}
      else
    {return new StringValue(newCollection.getName());}

  } catch (final XMLDBException e) {
      logger.error("Unable to create new collection " + collectionName, e);
      throw new XPathException(this, "failed to create new collection " + collectionName + ": " + e.getMessage(), e);
  }
View Full Code Here

   
    final ValueSequence result = new ValueSequence();
    try {
      final String[] collections = collection.listChildCollections();
      for(int i = 0; i < collections.length; i++) {
        result.add(new StringValue(collections[i]));
      }
      return result;
    } catch (final XMLDBException e) {
      throw new XPathException(this, "Failed to retrieve child collections", e);
    }
View Full Code Here

        {
          final ValueSequence names = new ValueSequence();
       
          for(int c = 0; c < cookies.length; c++)
          {
            names.add(new StringValue(cookies[c].getName()));
          }
         
          return names;
        }
      }
View Full Code Here

        }

        if(metadataValue == null || metadataValue.isEmpty()) {
            return Sequence.EMPTY_SEQUENCE;
        } else {
            return new StringValue(metadataValue);
        }
    }
View Full Code Here

TOP

Related Classes of org.exist.xquery.value.StringValue

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.