Package org.exist.xquery.value

Examples of org.exist.xquery.value.StringValue


        return result;  
       
  }

  private void getIdRef(NodeSet result, DocumentSet docs, String id) throws XPathException {
    final NodeSet attribs = context.getBroker().getValueIndex().find(context.getWatchDog(), Constants.EQ, docs, null, -1, null, new StringValue(id, Type.IDREF));

    for (final NodeProxy n : attribs) {
            n.setNodeType(Node.ATTRIBUTE_NODE);
            result.add(n);
    }
View Full Code Here


      for (final Enumeration<String> e =
        ((RequestWrapper) value.getObject()).getParameterNames();
        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

    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {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()).getScheme());
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

      if (res != null) {
        final String lockUser = ums.hasUserLock(res);
        if (lockUser != null && isCalledAs("clear-lock")) {
          ums.unlockResource(res);
        }
                return lockUser == null ? Sequence.EMPTY_SEQUENCE : new StringValue(lockUser);
      } else {
                logger.error("Unable to locate resource " + args[1].getStringValue());
          throw new XPathException(this, "Unable to locate resource " + args[1].getStringValue());
      }
    } catch (final XMLDBException e) {
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

   */
  public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
  {
    try
    {
      return new StringValue(URLDecoder.decode(args[0].getStringValue(), args[1].getStringValue()));
    }
    catch(final java.io.UnsupportedEncodingException e)
    {
      throw new XPathException(this, "Unsupported Encoding Scheme: " + e.getMessage(), e);
    }
View Full Code Here

    if (var.getValue().getItemType() != Type.JAVA_OBJECT)
      {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()).getMethod());
    } else
      {throw new XPathException(this, "Variable $request is not bound to a Request object.");}
  }
View Full Code Here

        final Sequence result = new ValueSequence();

        // Check input parameters
        if (args.length == 0) {
            final String uuid = UUIDGenerator.getUUIDversion4();
            result.add(new StringValue(uuid));

        } else if (args.length == 1) {
            final String parameter = args[0].getStringValue();
            final String uuid = UUIDGenerator.getUUIDversion3(parameter);
            result.add(new StringValue(uuid));

        } else {
            logger.error("Not a supported number of parameters");
            throw new XPathException("Not a supported number of parameters");
        }
View Full Code Here

      {
        for(int c = 0; c < cookies.length; c++)
        {
          if(cookies[c].getName().equals(cookieName))
          {
            return new StringValue(decode(cookies[c].getValue()));
          }
        }
      }
     
      return Sequence.EMPTY_SEQUENCE;
View Full Code Here

    String locale;
    for(int i = 0; i < locales.length; i++) {
      locale = locales[i].getLanguage();
      if(locales[i].getCountry().length() > 0)
        {locale += '-' + locales[i].getCountry();}
      result.add(new StringValue(locale));
    }
    return result;
  }
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.