Package org.exist.xquery.value

Examples of org.exist.xquery.value.BooleanValue


              final Node n = ((NodeValue)arg).getNode();
              //TODO : think more...
              if (n.hasAttributes()) {
                final Node nilled = n.getAttributes().getNamedItemNS(Namespaces.SCHEMA_INSTANCE_NS, "nil");
                if (nilled != null)
                  {result = new BooleanValue(nilled.getNodeValue() == "false");}
                else
                  {result = BooleanValue.FALSE;}
              } else
                {result = BooleanValue.FALSE;}
            }
View Full Code Here


          if (hyphen != Constants.STRING_NOT_FOUND) {
            langValue = langValue.substring(0, hyphen);
            include = lang.equalsIgnoreCase(langValue);
          }       
        }
        result = new BooleanValue(include);
      }
            else
              {throw new XPathException(this, ErrorCodes.XPTY0004, "Sequence returned more than one item !");}
        }
       
View Full Code Here

        if (args[0].isEmpty())
            {result = Sequence.EMPTY_SEQUENCE;}
        else if (args[1].isEmpty())
            {result =  Sequence.EMPTY_SEQUENCE;}
        else {
            result = new BooleanValue(Collations.compare(
                //TODO : how ugly ! We should be able to use Collations.CODEPOINT here ! -pb
                context.getDefaultCollator(),
                getArgument(0).eval(contextSequence).getStringValue(),
                getArgument(1).eval(contextSequence).getStringValue())
                == Constants.EQUAL);
View Full Code Here

                    } else if (isCalledAs("getSRS")) {
                        result = new StringValue(((Element)geometryNode).getAttribute("srsName"));
                    } else if (isCalledAs("getGeometryType")) {
                        result = new StringValue(geometry.getGeometryType());
                    } else if (isCalledAs("isClosed")) {
                        result = new BooleanValue(!geometry.isEmpty());
                    } else if (isCalledAs("isSimple")) {
                        result = new BooleanValue(geometry.isSimple());
                    } else if (isCalledAs("isValid")) {
                        result = new BooleanValue(geometry.isValid());
                    } else {
                        logger.error("Unknown spatial property: " + mySignature.getName().getLocalName());
                        throw new XPathException("Unknown spatial property: " + mySignature.getName().getLocalName());
                    }
                }
View Full Code Here

            if (!rs.next())
                //Nothing returned
                return AtomicValue.EMPTY_VALUE;
            AtomicValue result = null;
            if (rs.getMetaData().getColumnClassName(1).equals(Boolean.class.getName())) {
                result = new BooleanValue(rs.getBoolean(1));
            } else if (rs.getMetaData().getColumnClassName(1).equals(Double.class.getName())) {
                result = new DoubleValue(rs.getDouble(1));
            } else if (rs.getMetaData().getColumnClassName(1).equals(String.class.getName())) {
                result = new StringValue(rs.getString(1));
            } else if (rs.getMetaData().getColumnType(1) == java.sql.Types.BINARY) {
View Full Code Here

                    //Node is in the context : check if it is accurate
                    //contextSet.contains(p) would have made more sense but there is a problem with
                    //VirtualNodeSet when on the DESCENDANT_OR_SELF axis
                    if (contextSet.get(p) != null) {
                        if (rs.getMetaData().getColumnClassName(1).equals(Boolean.class.getName())) {
                            result.add(new BooleanValue(rs.getBoolean(1)));
                        } else if (rs.getMetaData().getColumnClassName(1).equals(Double.class.getName())) {
                            result.add(new DoubleValue(rs.getDouble(1)));
                        } else if (rs.getMetaData().getColumnClassName(1).equals(String.class.getName())) {
                            result.add(new StringValue(rs.getString(1)));
                        } else if (rs.getMetaData().getColumnType(1) == java.sql.Types.BINARY) {
View Full Code Here

            }

        } else {
            try {
                if (getSignature().equals(destroyCounter)) {
                    return new BooleanValue(counters.destroyCounter(counterName));

                } else if (getSignature().equals(nextValue)) {
                    return new IntegerValue(counters.nextValue(counterName), Type.LONG);

                } else {
View Full Code Here

            builder.addAttribute(new QName("modified", null, null),
                    new DateTimeValue(new Date(entry.lastModified())).getStringValue());

            builder.addAttribute(new QName("hidden", null, null),
                    new BooleanValue(entry.isHidden()).getStringValue());

            builder.addAttribute(new QName("canRead", null, null),
                    new BooleanValue(entry.canRead()).getStringValue());

            builder.addAttribute(new QName("canWrite", null, null),
                    new BooleanValue(entry.canWrite()).getStringValue());

            builder.endElement();

        }
View Full Code Here

          throw new XPathException("Document " + path + " does not exist.");
      }
     
      LuceneIndexWorker index = (LuceneIndexWorker)
        context.getBroker().getIndexController().getWorkerByIndexId(LuceneIndex.ID);
      return new BooleanValue(index.hasIndex(doc.getDocId()));
    } catch (PermissionDeniedException e) {
      throw new XPathException(this, LuceneModule.EXXQDYFT0001, e.getMessage());
    } catch (URISyntaxException e) {
      throw new XPathException(this, LuceneModule.EXXQDYFT0003, e.getMessage());
    } catch (IOException e) {
View Full Code Here

   */
 
  public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
  {
   
    BooleanValue exists = BooleanValue.TRUE;
   
    RequestModule myModule = (RequestModule)context.getModule( RequestModule.NAMESPACE_URI );
   
    // request object is read from global variable $request
    Variable var = myModule.resolveVariable( RequestModule.REQUEST_VAR );
View Full Code Here

TOP

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

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.